{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://teleport.eco/schemas/tap/provider/0.1",
  "title": "TAP Provider Protocol v0.1",
  "description": "Messages between the Teleport TAP Router and supply providers (teleport-tap-provider-protocol-v0.1.md). Validate a message against the matching $defs entry.",
  "$defs": {
    "Money": {
      "type": "object",
      "properties": {
        "amountCents": {
          "type": "integer",
          "minimum": 0
        },
        "currency": {
          "const": "USD"
        }
      },
      "required": [
        "amountCents",
        "currency"
      ],
      "additionalProperties": false
    },
    "Manifest": {
      "type": "object",
      "properties": {
        "schema": {
          "const": "teleport.provider.manifest/0.1"
        },
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{2,39}$"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://"
        },
        "kinds": {
          "type": "array",
          "items": {
            "enum": [
              "HUMAN",
              "HUMANOID",
              "ROBOT",
              "AUTONOMOUS_VEHICLE",
              "DRONE",
              "DEVICE",
              "MULTI_ACTOR"
            ]
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "categories": {
          "type": "array",
          "items": {
            "enum": [
              "INSPECT",
              "OPERATE",
              "MAINTAIN",
              "CLEAN",
              "REPAIR",
              "CAPTURE",
              "DEMONSTRATE",
              "UNLOAD",
              "TRANSPORT",
              "OBSERVE",
              "CUSTOM"
            ]
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "coverage": {
          "type": "object",
          "properties": {
            "countries": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              }
            },
            "regions": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[A-Z]{2}-[A-Z0-9]{1,3}$"
              }
            },
            "areas": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "type",
                  "coordinates"
                ],
                "properties": {
                  "type": {
                    "enum": [
                      "Polygon",
                      "MultiPolygon"
                    ]
                  },
                  "coordinates": {
                    "type": "array",
                    "minItems": 1
                  }
                }
              }
            },
            "remote": {
              "type": "boolean"
            }
          },
          "required": [
            "countries",
            "remote"
          ]
        },
        "leadTimeMinutes": {
          "type": "object",
          "properties": {
            "min": {
              "type": "integer",
              "minimum": 0
            },
            "typical": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "min",
            "typical"
          ]
        },
        "evidence": {
          "type": "object",
          "properties": {
            "origins": {
              "type": "array",
              "items": {
                "enum": [
                  "TELEPORT_CAPTURE",
                  "THIRD_PARTY_SUBMITTED",
                  "ACTOR_TELEMETRY",
                  "ATTESTED_DEVICE"
                ]
              },
              "minItems": 1,
              "uniqueItems": true
            },
            "teleportCaptureLink": {
              "type": "boolean"
            },
            "types": {
              "type": "array",
              "items": {
                "enum": [
                  "VIDEO",
                  "IMAGE",
                  "AUDIO",
                  "DEPTH",
                  "IMU",
                  "POSE",
                  "JOINT_STATE",
                  "FORCE_TORQUE",
                  "ODOMETRY",
                  "LIDAR",
                  "TELEMETRY",
                  "SENSOR_MEASUREMENT",
                  "EVENT_LOG",
                  "BARCODE_SCAN",
                  "NFC",
                  "GPS",
                  "MANIFEST",
                  "CUSTOM"
                ]
              },
              "uniqueItems": true
            }
          },
          "required": [
            "origins",
            "teleportCaptureLink"
          ]
        },
        "modes": {
          "type": "array",
          "items": {
            "enum": [
              "push",
              "pull",
              "mcp"
            ]
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "endpoints": {
          "type": "object",
          "properties": {
            "events": {
              "type": "string",
              "format": "uri",
              "pattern": "^https://"
            },
            "quote": {
              "type": "string",
              "format": "uri",
              "pattern": "^https://"
            }
          },
          "required": []
        },
        "jwksUrl": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://"
        },
        "currency": {
          "const": "USD"
        },
        "support": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string",
              "format": "email"
            }
          },
          "required": [
            "email"
          ]
        }
      },
      "required": [
        "schema",
        "id",
        "label",
        "url",
        "kinds",
        "categories",
        "coverage",
        "leadTimeMinutes",
        "evidence",
        "modes",
        "currency",
        "support"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "modes": {
                "contains": {
                  "const": "push"
                }
              }
            }
          },
          "then": {
            "required": [
              "endpoints"
            ],
            "properties": {
              "endpoints": {
                "required": [
                  "events"
                ]
              }
            }
          }
        }
      ]
    },
    "TaskProjection": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "maxLength": 200
        },
        "objective": {
          "type": "string",
          "maxLength": 2000
        },
        "instructions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "doneWhen": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "category": {
          "enum": [
            "INSPECT",
            "OPERATE",
            "MAINTAIN",
            "CLEAN",
            "REPAIR",
            "CAPTURE",
            "DEMONSTRATE",
            "UNLOAD",
            "TRANSPORT",
            "OBSERVE",
            "CUSTOM"
          ]
        },
        "actorKinds": {
          "type": "array",
          "items": {
            "enum": [
              "HUMAN",
              "HUMANOID",
              "ROBOT",
              "AUTONOMOUS_VEHICLE",
              "DRONE",
              "DEVICE",
              "MULTI_ACTOR"
            ]
          },
          "minItems": 1
        },
        "area": {
          "type": "object",
          "properties": {
            "city": {
              "type": [
                "string",
                "null"
              ]
            },
            "region": {
              "type": [
                "string",
                "null"
              ]
            },
            "countryCode": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[A-Z]{2}$"
            },
            "approx": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "type": "object",
                  "properties": {
                    "lat": {
                      "type": "number",
                      "multipleOf": 0.01
                    },
                    "lng": {
                      "type": "number",
                      "multipleOf": 0.01
                    },
                    "radiusMeters": {
                      "type": "integer",
                      "minimum": 1000
                    }
                  },
                  "required": [
                    "lat",
                    "lng",
                    "radiusMeters"
                  ]
                }
              ]
            }
          },
          "required": [
            "city",
            "region",
            "countryCode"
          ]
        },
        "window": {
          "type": "object",
          "properties": {
            "startsAfter": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "Z$"
                }
              ]
            },
            "deadline": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "Z$"
                }
              ]
            }
          },
          "required": [
            "startsAfter",
            "deadline"
          ]
        },
        "evidence": {
          "type": "object",
          "properties": {
            "items": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "VIDEO",
                      "IMAGE",
                      "AUDIO",
                      "DEPTH",
                      "IMU",
                      "POSE",
                      "JOINT_STATE",
                      "FORCE_TORQUE",
                      "ODOMETRY",
                      "LIDAR",
                      "TELEMETRY",
                      "SENSOR_MEASUREMENT",
                      "EVENT_LOG",
                      "BARCODE_SCAN",
                      "NFC",
                      "GPS",
                      "MANIFEST",
                      "CUSTOM"
                    ]
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "description": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "required"
                ]
              }
            },
            "minimumAssurance": {
              "enum": [
                "STANDARD",
                "VERIFIED",
                "HIGH_ASSURANCE"
              ]
            },
            "captureLinkRequired": {
              "type": "boolean"
            }
          },
          "required": [
            "items",
            "minimumAssurance",
            "captureLinkRequired"
          ]
        }
      },
      "required": [
        "title",
        "objective",
        "instructions",
        "doneWhen",
        "category",
        "actorKinds",
        "area",
        "window",
        "evidence"
      ],
      "additionalProperties": false
    },
    "OfferCreated": {
      "type": "object",
      "properties": {
        "offerId": {
          "type": "string",
          "pattern": "^ofr_[A-Za-z0-9]{8,40}$"
        },
        "taskRef": {
          "type": "string",
          "pattern": "^tref_[A-Za-z0-9]{8,40}$"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "Z$"
        },
        "quoteBy": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          ]
        },
        "task": {
          "$ref": "#/$defs/TaskProjection"
        },
        "payCeiling": {
          "$ref": "#/$defs/Money"
        },
        "prequote": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "priceCents": {
                  "type": "integer",
                  "minimum": 0
                },
                "currency": {
                  "const": "USD"
                },
                "etaMinutes": {
                  "type": "integer",
                  "minimum": 0
                },
                "validUntil": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "Z$"
                }
              },
              "required": [
                "priceCents",
                "currency",
                "etaMinutes",
                "validUntil"
              ]
            }
          ]
        }
      },
      "required": [
        "offerId",
        "taskRef",
        "expiresAt",
        "quoteBy",
        "task",
        "payCeiling",
        "prequote"
      ]
    },
    "OfferCancelled": {
      "type": "object",
      "properties": {
        "offerId": {
          "type": "string",
          "pattern": "^ofr_[A-Za-z0-9]{8,40}$"
        },
        "reason": {
          "enum": [
            "FILLED_ELSEWHERE",
            "REQUESTER_CANCELLED",
            "EXPIRED",
            "SAFETY"
          ]
        }
      },
      "required": [
        "offerId",
        "reason"
      ]
    },
    "AssignmentDetails": {
      "type": "object",
      "properties": {
        "assignmentId": {
          "type": "string",
          "pattern": "^asg_[A-Za-z0-9]{8,40}$"
        },
        "offerId": {
          "type": "string",
          "pattern": "^ofr_[A-Za-z0-9]{8,40}$"
        },
        "price": {
          "$ref": "#/$defs/Money"
        },
        "place": {
          "type": "object",
          "properties": {
            "address": {
              "type": "string"
            },
            "lat": {
              "type": "number"
            },
            "lng": {
              "type": "number"
            },
            "spot": {
              "type": [
                "string",
                "null"
              ]
            },
            "accessNotes": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "address",
            "lat",
            "lng",
            "spot",
            "accessNotes"
          ]
        },
        "deadline": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          ]
        },
        "captureLink": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^https://"
                },
                "expiresAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "Z$"
                }
              },
              "required": [
                "url",
                "expiresAt"
              ]
            }
          ]
        }
      },
      "required": [
        "assignmentId",
        "offerId",
        "price",
        "place",
        "deadline",
        "captureLink"
      ]
    },
    "AssignmentCancelled": {
      "type": "object",
      "properties": {
        "assignmentId": {
          "type": "string",
          "pattern": "^asg_[A-Za-z0-9]{8,40}$"
        },
        "reason": {
          "enum": [
            "REQUESTER_CANCELLED",
            "SAFETY",
            "POLICY"
          ]
        },
        "at": {
          "type": "string",
          "format": "date-time",
          "pattern": "Z$"
        }
      },
      "required": [
        "assignmentId",
        "reason",
        "at"
      ]
    },
    "DecisionMade": {
      "type": "object",
      "properties": {
        "assignmentId": {
          "type": "string",
          "pattern": "^asg_[A-Za-z0-9]{8,40}$"
        },
        "decision": {
          "enum": [
            "ACCEPT",
            "REJECT"
          ]
        },
        "rejectionReason": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "enum": [
                "EVIDENCE_INSUFFICIENT",
                "ORIGIN_BELOW_FLOOR",
                "LOCATION_MISMATCH",
                "TIME_WINDOW",
                "SCOPE_NOT_MET",
                "SAFETY",
                "POLICY"
              ]
            }
          ]
        },
        "notes": {
          "type": [
            "string",
            "null"
          ]
        },
        "redoAllowed": {
          "type": "boolean"
        },
        "redoBy": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          ]
        },
        "payable": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "amountCents": {
                  "type": "integer",
                  "minimum": 0
                },
                "currency": {
                  "const": "USD"
                },
                "status": {
                  "const": "AWAITING_REQUESTER_PAYMENT"
                }
              },
              "required": [
                "amountCents",
                "currency",
                "status"
              ]
            }
          ]
        }
      },
      "required": [
        "assignmentId",
        "decision",
        "rejectionReason",
        "redoAllowed",
        "payable"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "decision": {
                "const": "ACCEPT"
              }
            }
          },
          "then": {
            "properties": {
              "payable": {
                "type": "object"
              },
              "rejectionReason": {
                "type": "null"
              }
            }
          },
          "else": {
            "properties": {
              "payable": {
                "type": "null"
              },
              "rejectionReason": {
                "enum": [
                  "EVIDENCE_INSUFFICIENT",
                  "ORIGIN_BELOW_FLOOR",
                  "LOCATION_MISMATCH",
                  "TIME_WINDOW",
                  "SCOPE_NOT_MET",
                  "SAFETY",
                  "POLICY"
                ]
              }
            }
          }
        }
      ]
    },
    "ReceiptIssued": {
      "type": "object",
      "properties": {
        "assignmentId": {
          "type": "string",
          "pattern": "^asg_[A-Za-z0-9]{8,40}$"
        },
        "claimId": {
          "type": "string",
          "pattern": "^claim_[A-Za-z0-9]{8,40}$"
        },
        "receiptLevel": {
          "enum": [
            "SIGNED_ONLY",
            "ANCHORED",
            "BONDED",
            "SANDBOX"
          ]
        },
        "assuranceTier": {
          "enum": [
            "STANDARD",
            "VERIFIED",
            "HIGH_ASSURANCE"
          ]
        },
        "evidenceOriginFloor": {
          "enum": [
            "TELEPORT_CAPTURE",
            "THIRD_PARTY_SUBMITTED",
            "ACTOR_TELEMETRY",
            "ATTESTED_DEVICE",
            "PLATFORM_FETCHED"
          ]
        },
        "status": {
          "enum": [
            "PENDING_BATCH",
            "BATCHED",
            "ANCHORED",
            "FINAL",
            "SANDBOX"
          ]
        },
        "proofUrl": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://"
        }
      },
      "required": [
        "assignmentId",
        "claimId",
        "receiptLevel",
        "assuranceTier",
        "evidenceOriginFloor",
        "status",
        "proofUrl"
      ]
    },
    "PaymentCleared": {
      "type": "object",
      "properties": {
        "assignmentId": {
          "type": "string",
          "pattern": "^asg_[A-Za-z0-9]{8,40}$"
        },
        "amountCents": {
          "type": "integer",
          "minimum": 0
        },
        "currency": {
          "const": "USD"
        },
        "clearedAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "Z$"
        },
        "payoutDueBy": {
          "type": "string",
          "format": "date"
        }
      },
      "required": [
        "assignmentId",
        "amountCents",
        "currency",
        "clearedAt",
        "payoutDueBy"
      ]
    },
    "PaymentSent": {
      "type": "object",
      "description": "Teleport sent the payout for a cleared job. STRIPE_CONNECT: a transfer to the provider's Stripe account (reference is the transfer id); MANUAL: a bank transfer ops recorded; SANDBOX: simulated.",
      "properties": {
        "assignmentId": {
          "type": "string",
          "pattern": "^asg_[A-Za-z0-9]{8,40}$"
        },
        "amountCents": {
          "type": "integer",
          "minimum": 0
        },
        "currency": {
          "const": "USD"
        },
        "sentAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "Z$"
        },
        "method": {
          "enum": [
            "STRIPE_CONNECT",
            "MANUAL",
            "SANDBOX"
          ]
        },
        "reference": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        }
      },
      "required": [
        "assignmentId",
        "amountCents",
        "currency",
        "sentAt",
        "method",
        "reference"
      ]
    },
    "Event": {
      "type": "object",
      "required": [
        "protocol",
        "type",
        "eventId",
        "occurredAt",
        "environment",
        "providerId",
        "data"
      ],
      "properties": {
        "protocol": {
          "const": "teleport.provider/0.1"
        },
        "type": {
          "enum": [
            "offer.created",
            "offer.cancelled",
            "assignment.details",
            "assignment.cancelled",
            "decision.made",
            "receipt.issued",
            "payment.cleared",
            "payment.sent"
          ]
        },
        "eventId": {
          "type": "string",
          "pattern": "^evt_[A-Za-z0-9]{8,40}$"
        },
        "occurredAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "Z$"
        },
        "environment": {
          "enum": [
            "live",
            "sandbox"
          ]
        },
        "providerId": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{2,39}$"
        },
        "data": {
          "type": "object"
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "const": "offer.created"
              }
            }
          },
          "then": {
            "properties": {
              "data": {
                "$ref": "#/$defs/OfferCreated"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "offer.cancelled"
              }
            }
          },
          "then": {
            "properties": {
              "data": {
                "$ref": "#/$defs/OfferCancelled"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "assignment.details"
              }
            }
          },
          "then": {
            "properties": {
              "data": {
                "$ref": "#/$defs/AssignmentDetails"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "assignment.cancelled"
              }
            }
          },
          "then": {
            "properties": {
              "data": {
                "$ref": "#/$defs/AssignmentCancelled"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "decision.made"
              }
            }
          },
          "then": {
            "properties": {
              "data": {
                "$ref": "#/$defs/DecisionMade"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "receipt.issued"
              }
            }
          },
          "then": {
            "properties": {
              "data": {
                "$ref": "#/$defs/ReceiptIssued"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "payment.cleared"
              }
            }
          },
          "then": {
            "properties": {
              "data": {
                "$ref": "#/$defs/PaymentCleared"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "payment.sent"
              }
            }
          },
          "then": {
            "properties": {
              "data": {
                "$ref": "#/$defs/PaymentSent"
              }
            }
          }
        }
      ]
    },
    "QuoteRequest": {
      "type": "object",
      "properties": {
        "protocol": {
          "const": "teleport.provider/0.1"
        },
        "quoteRequestId": {
          "type": "string",
          "pattern": "^qrq_[A-Za-z0-9]{8,40}$"
        },
        "environment": {
          "enum": [
            "live",
            "sandbox"
          ]
        },
        "task": {
          "$ref": "#/$defs/TaskProjection"
        }
      },
      "required": [
        "protocol",
        "quoteRequestId",
        "environment",
        "task"
      ]
    },
    "QuoteResponse": {
      "type": "object",
      "properties": {
        "priceCents": {
          "type": "integer",
          "minimum": 0
        },
        "currency": {
          "const": "USD"
        },
        "etaMinutes": {
          "type": "integer",
          "minimum": 0
        },
        "validUntil": {
          "type": "string",
          "format": "date-time",
          "pattern": "Z$"
        }
      },
      "required": [
        "priceCents",
        "currency",
        "etaMinutes",
        "validUntil"
      ]
    },
    "Quote": {
      "type": "object",
      "properties": {
        "priceCents": {
          "type": "integer",
          "minimum": 0
        },
        "currency": {
          "const": "USD"
        },
        "etaMinutes": {
          "type": "integer",
          "minimum": 0
        },
        "validUntil": {
          "type": "string",
          "format": "date-time",
          "pattern": "Z$"
        },
        "note": {
          "type": "string",
          "maxLength": 500
        }
      },
      "required": [
        "priceCents",
        "currency",
        "etaMinutes",
        "validUntil"
      ]
    },
    "Accept": {
      "type": "object",
      "properties": {
        "quoteId": {
          "type": "string",
          "pattern": "^qte_[A-Za-z0-9]{8,40}$"
        },
        "performerRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "performerRef"
      ]
    },
    "Decline": {
      "type": "object",
      "properties": {
        "reason": {
          "enum": [
            "NO_PERFORMER",
            "OUT_OF_COVERAGE",
            "TOO_SOON",
            "PRICE",
            "CAPABILITY",
            "OTHER"
          ]
        },
        "note": {
          "type": "string",
          "maxLength": 500
        }
      },
      "required": [
        "reason"
      ]
    },
    "StatusUpdate": {
      "type": "object",
      "properties": {
        "status": {
          "enum": [
            "EN_ROUTE",
            "ON_SITE",
            "FAILED",
            "CANCELLED"
          ]
        },
        "at": {
          "type": "string",
          "format": "date-time",
          "pattern": "Z$"
        },
        "note": {
          "type": "string",
          "maxLength": 500
        }
      },
      "required": [
        "status"
      ]
    },
    "UploadsRequest": {
      "type": "object",
      "properties": {
        "files": {
          "type": "array",
          "minItems": 1,
          "maxItems": 50,
          "items": {
            "type": "object",
            "properties": {
              "evidenceId": {
                "type": "string"
              },
              "contentType": {
                "type": "string"
              },
              "size": {
                "type": "integer",
                "minimum": 1,
                "maximum": 52428800
              }
            },
            "required": [
              "evidenceId",
              "contentType",
              "size"
            ]
          }
        }
      },
      "required": [
        "files"
      ]
    },
    "EvidenceSubmission": {
      "type": "object",
      "properties": {
        "performerRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "actor": {
          "type": "object",
          "properties": {
            "actorType": {
              "enum": [
                "HUMAN",
                "HUMANOID",
                "ROBOT",
                "AUTONOMOUS_VEHICLE",
                "DRONE",
                "DEVICE",
                "MULTI_ACTOR"
              ]
            }
          },
          "required": [
            "actorType"
          ]
        },
        "executedAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "Z$"
        },
        "attestation": {
          "type": "object",
          "properties": {
            "statement": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            },
            "attestedBy": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "required": [
            "statement",
            "attestedBy"
          ]
        },
        "assets": {
          "type": "array",
          "maxItems": 50,
          "items": {
            "type": "object",
            "required": [
              "evidenceId",
              "path",
              "origin"
            ],
            "properties": {
              "evidenceId": {
                "type": "string"
              },
              "path": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "origin": {
                "enum": [
                  "THIRD_PARTY_SUBMITTED",
                  "ACTOR_TELEMETRY",
                  "ATTESTED_DEVICE"
                ]
              },
              "contentType": {
                "type": "string"
              },
              "blobPathname": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri",
                "pattern": "^https://"
              },
              "contentBase64": {
                "type": "string",
                "maxLength": 1400000
              }
            },
            "oneOf": [
              {
                "required": [
                  "blobPathname"
                ]
              },
              {
                "required": [
                  "url"
                ]
              },
              {
                "required": [
                  "contentBase64"
                ]
              }
            ]
          }
        }
      },
      "required": [
        "performerRef",
        "actor",
        "executedAt",
        "assets"
      ]
    },
    "Dispute": {
      "type": "object",
      "properties": {
        "reason": {
          "enum": [
            "DECISION_WRONG",
            "EVIDENCE_MISREAD",
            "OTHER"
          ]
        },
        "note": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        }
      },
      "required": [
        "reason",
        "note"
      ]
    },
    "Error": {
      "type": "object",
      "properties": {
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "details": {}
          },
          "required": [
            "code",
            "message"
          ]
        }
      },
      "required": [
        "error"
      ]
    },
    "SignatureHeader": {
      "type": "object",
      "properties": {
        "alg": {
          "const": "ES256"
        },
        "kid": {
          "type": "string",
          "minLength": 43,
          "maxLength": 43
        },
        "typ": {
          "enum": [
            "teleport-provider+json",
            "provider-teleport+json"
          ]
        },
        "teleport-ts": {
          "type": "integer"
        }
      },
      "required": [
        "alg",
        "kid",
        "typ",
        "teleport-ts"
      ]
    }
  }
}
