{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://odexa.io/schemas/1.2.0-draft.3/paid-agreement.schema.json",
  "title": "Odexa draft-3 fixed-quote paid agreement contracts",
  "$comment": "Unpublished candidate. Explicit draft-3 envelopes; draft-1 policy and unversioned HTTP/asset semantics reused. Schema is structural only: exact-byte digests, lexical integers, signature/authentication, authority/currentness, scope, time, obligations and request/receipt correlations require semantic checks.",
  "oneOf": [
    {
      "$ref": "#/$defs/offer_request"
    },
    {
      "$ref": "#/$defs/offer"
    },
    {
      "$ref": "#/$defs/acceptance"
    },
    {
      "$ref": "#/$defs/receipt"
    },
    {
      "$ref": "#/$defs/status"
    },
    {
      "$ref": "#/$defs/revoke_request"
    },
    {
      "$ref": "#/$defs/token_request"
    },
    {
      "$ref": "#/$defs/token_response"
    },
    {
      "$ref": "#/$defs/introspection_request"
    },
    {
      "$ref": "#/$defs/introspection_response"
    },
    {
      "$ref": "#/$defs/report"
    },
    {
      "$ref": "#/$defs/intake"
    }
  ],
  "$defs": {
    "authority": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "url": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        }
      },
      "required": [
        "origin",
        "service_id",
        "revision",
        "url",
        "digest"
      ]
    },
    "asset_ref": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "asset_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "version_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "manifest_digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "representation_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "asset_id",
        "version_id",
        "manifest_digest",
        "representation_id"
      ]
    },
    "representation_metadata": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "media_type": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9!#$&^_.+-]*/[a-z0-9][a-z0-9!#$&^_.+-]*$"
        },
        "media_parameters": {
          "type": "object",
          "maxProperties": 16,
          "propertyNames": {
            "pattern": "^[a-z0-9][a-z0-9!#$&^_.+-]*$"
          },
          "additionalProperties": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "languages": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z]{1,8}(?:-[a-z0-9]{1,8})*$"
          },
          "minItems": 0,
          "maxItems": 16,
          "uniqueItems": true
        }
      },
      "required": [
        "media_type",
        "media_parameters",
        "languages"
      ]
    },
    "range": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "first": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "last": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "complete_length": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "first",
        "last",
        "complete_length"
      ]
    },
    "http": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "method": {
          "enum": [
            "GET",
            "HEAD"
          ]
        },
        "status": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 100,
              "maximum": 599
            },
            {
              "type": "null"
            }
          ]
        },
        "kind": {
          "enum": [
            "full",
            "partial",
            "head",
            "no_content",
            "not_modified",
            "redirect",
            "error",
            "unsupported_partial",
            "unsupported_status",
            "unknown",
            "protocol_error"
          ]
        },
        "delivery_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "hop_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "ingress_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "hop_role": {
          "enum": [
            "end_client",
            "upstream"
          ]
        },
        "boundary_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "cache_status": {
          "enum": [
            "bypass",
            "miss",
            "hit",
            "revalidated",
            "stale",
            "unknown"
          ]
        },
        "content_codings": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^(?!identity$)[a-z0-9][a-z0-9-]{0,31}$"
          },
          "minItems": 0,
          "maxItems": 8
        },
        "content_bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "content_digest": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^sha256:[0-9a-f]{64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "decoded_bytes": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "decoded_digest": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^sha256:[0-9a-f]{64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "range": {
          "anyOf": [
            {
              "$ref": "#/$defs/range"
            },
            {
              "type": "null"
            }
          ]
        },
        "representation_metadata": {
          "anyOf": [
            {
              "$ref": "#/$defs/representation_metadata"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "method",
        "status",
        "kind",
        "delivery_id",
        "hop_id",
        "ingress_id",
        "hop_role",
        "boundary_id",
        "cache_status",
        "content_codings",
        "content_bytes",
        "content_digest",
        "decoded_bytes",
        "decoded_digest",
        "range",
        "representation_metadata"
      ]
    },
    "operation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "started_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "ended_at": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
            },
            {
              "type": "null"
            }
          ]
        },
        "state": {
          "enum": [
            "completed",
            "failed",
            "in_progress"
          ]
        }
      },
      "required": [
        "id",
        "started_at",
        "ended_at",
        "state"
      ]
    },
    "related_event": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "reporter_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "event_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "payload_digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        }
      },
      "required": [
        "reporter_id",
        "event_id",
        "payload_digest"
      ]
    },
    "obligation": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "attribution"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "url": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^#]+$"
            }
          },
          "required": [
            "type",
            "name",
            "url"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "retention"
            },
            "max_seconds": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "type",
            "max_seconds"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "report_usage"
            },
            "endpoint": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^#]+$"
            },
            "deadline_seconds": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "type",
            "endpoint",
            "deadline_seconds"
          ]
        }
      ]
    },
    "context": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "role": {
          "enum": [
            "policy",
            "human_terms",
            "origin_authority"
          ]
        },
        "url": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "media_type": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        }
      },
      "required": [
        "role",
        "url",
        "digest",
        "media_type"
      ]
    },
    "binding": {
      "type": "object",
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id"
      ],
      "additionalProperties": false
    },
    "request": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "url": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^#]+$"
        },
        "actions": {
          "type": "array",
          "items": {
            "enum": [
              "retrieve",
              "store",
              "transform",
              "redistribute"
            ]
          },
          "minItems": 1,
          "maxItems": 4,
          "uniqueItems": true
        },
        "purposes": {
          "type": "array",
          "items": {
            "enum": [
              "search_indexing",
              "public_retrieval",
              "internal_knowledge",
              "model_training",
              "model_fine_tuning",
              "redistribution"
            ]
          },
          "minItems": 1,
          "maxItems": 6,
          "uniqueItems": true
        },
        "supported_obligations": {
          "type": "array",
          "items": {
            "enum": [
              "attribution",
              "retention",
              "report_usage"
            ]
          },
          "minItems": 0,
          "maxItems": 3,
          "uniqueItems": true
        }
      },
      "required": [
        "url",
        "actions",
        "purposes",
        "supported_obligations"
      ]
    },
    "offer_request": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "principal_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^#]+$"
        },
        "request": {
          "$ref": "#/$defs/request"
        },
        "access_seconds": {
          "type": "integer",
          "minimum": 1,
          "maximum": 31536000
        },
        "use_seconds": {
          "type": "integer",
          "minimum": 1,
          "maximum": 31536000
        },
        "payer_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^#]+$"
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id",
        "principal_id",
        "request",
        "access_seconds",
        "use_seconds",
        "payer_id"
      ]
    },
    "offer": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "offer_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "client_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_-]+$"
        },
        "principal_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^#]+$"
        },
        "policy_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "policy_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "policy_digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "request": {
          "$ref": "#/$defs/request"
        },
        "obligations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/obligation"
          },
          "minItems": 0,
          "maxItems": 64
        },
        "context": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/context"
          },
          "minItems": 3,
          "maxItems": 3
        },
        "nonce": {
          "type": "string",
          "minLength": 43,
          "pattern": "^[A-Za-z0-9_-]+$",
          "maxLength": 43
        },
        "issued_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "expires_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "access_seconds": {
          "type": "integer",
          "minimum": 1,
          "maximum": 31536000
        },
        "use_seconds": {
          "type": "integer",
          "minimum": 1,
          "maximum": 31536000
        },
        "revocation": {
          "const": "future_access_only"
        },
        "payment": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "required": {
              "const": true
            },
            "quote_digest": {
              "type": "string",
              "pattern": "^sha256:[0-9a-f]{64}$"
            },
            "quote_url": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^#]+$"
            }
          },
          "required": [
            "required",
            "quote_digest",
            "quote_url"
          ]
        },
        "authority_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "authority_digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "terms_digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id",
        "offer_id",
        "client_id",
        "principal_id",
        "policy_id",
        "policy_revision",
        "policy_digest",
        "request",
        "obligations",
        "context",
        "nonce",
        "issued_at",
        "expires_at",
        "access_seconds",
        "use_seconds",
        "revocation",
        "payment",
        "authority_revision",
        "authority_digest",
        "terms_digest"
      ]
    },
    "acceptance": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "offer_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "offer_digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "client_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_-]+$"
        },
        "principal_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^#]+$"
        },
        "intent": {
          "const": "accept"
        },
        "nonce": {
          "type": "string",
          "minLength": 43,
          "pattern": "^[A-Za-z0-9_-]+$",
          "maxLength": 43
        },
        "accepted_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "idempotency_key": {
          "type": "string",
          "minLength": 16,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_-]+$"
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id",
        "offer_id",
        "offer_digest",
        "client_id",
        "principal_id",
        "intent",
        "nonce",
        "accepted_at",
        "idempotency_key"
      ]
    },
    "receipt": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "record_type": {
          "const": "agreement.accepted"
        },
        "agreement_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "client_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_-]+$"
        },
        "principal_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^#]+$"
        },
        "offer_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "offer_digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "acceptance_digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "recorded_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "access_expires_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "use_expires_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "state_at_issue": {
          "const": "pending_payment"
        },
        "payment_required": {
          "const": true
        },
        "access_credential": {
          "const": false
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id",
        "record_type",
        "agreement_id",
        "client_id",
        "principal_id",
        "offer_id",
        "offer_digest",
        "acceptance_digest",
        "recorded_at",
        "access_expires_at",
        "use_expires_at",
        "state_at_issue",
        "payment_required",
        "access_credential"
      ]
    },
    "status": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "record_type": {
          "const": "agreement.status"
        },
        "agreement_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "state": {
          "enum": [
            "active",
            "revoked",
            "expired",
            "pending_payment"
          ]
        },
        "effective_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "reason": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "status_version": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "issued_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "authority_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "authority_digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "authority_checked_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id",
        "record_type",
        "agreement_id",
        "state",
        "effective_at",
        "reason",
        "status_version",
        "issued_at",
        "authority_revision",
        "authority_digest",
        "authority_checked_at"
      ]
    },
    "revoke_request": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "reason": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "idempotency_key": {
          "type": "string",
          "minLength": 16,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_-]+$"
        },
        "agreement_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id",
        "reason",
        "idempotency_key",
        "agreement_id"
      ]
    },
    "token_request": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "agreement_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id",
        "agreement_id"
      ]
    },
    "token_response": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "token_type": {
          "const": "Bearer"
        },
        "access_token": {
          "type": "string",
          "minLength": 43,
          "pattern": "^[A-Za-z0-9_-]+$",
          "maxLength": 43
        },
        "expires_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "agreement_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id",
        "token_type",
        "access_token",
        "expires_at",
        "agreement_id"
      ]
    },
    "introspection_request": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "token": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_-]+$"
        },
        "resource_url": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^#]+$"
        },
        "method": {
          "enum": [
            "GET",
            "HEAD"
          ]
        },
        "actions": {
          "type": "array",
          "items": {
            "enum": [
              "retrieve",
              "store",
              "transform",
              "redistribute"
            ]
          },
          "minItems": 1,
          "maxItems": 4,
          "uniqueItems": true
        },
        "purposes": {
          "type": "array",
          "items": {
            "enum": [
              "search_indexing",
              "public_retrieval",
              "internal_knowledge",
              "model_training",
              "model_fine_tuning",
              "redistribution"
            ]
          },
          "minItems": 1,
          "maxItems": 6,
          "uniqueItems": true
        },
        "request_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id",
        "token",
        "resource_url",
        "method",
        "actions",
        "purposes",
        "request_id"
      ]
    },
    "admission": {
      "type": "object",
      "properties": {
        "decision_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "agreement_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "resource_url": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^#]+$"
        },
        "method": {
          "enum": [
            "GET",
            "HEAD"
          ]
        },
        "actions": {
          "type": "array",
          "items": {
            "enum": [
              "retrieve",
              "store",
              "transform",
              "redistribute"
            ]
          },
          "minItems": 1,
          "maxItems": 4,
          "uniqueItems": true
        },
        "purposes": {
          "type": "array",
          "items": {
            "enum": [
              "search_indexing",
              "public_retrieval",
              "internal_knowledge",
              "model_training",
              "model_fine_tuning",
              "redistribution"
            ]
          },
          "minItems": 1,
          "maxItems": 6,
          "uniqueItems": true
        },
        "expires_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "checked_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "status_version": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "authority_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "authority_digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "authority_checked_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "policy_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "policy_revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "client_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_-]+$"
        },
        "principal_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "policy_digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        }
      },
      "required": [
        "decision_id",
        "agreement_id",
        "resource_url",
        "method",
        "actions",
        "purposes",
        "expires_at",
        "checked_at",
        "status_version",
        "authority_revision",
        "authority_digest",
        "authority_checked_at",
        "policy_id",
        "policy_revision",
        "client_id",
        "principal_id",
        "policy_digest"
      ],
      "additionalProperties": false
    },
    "introspection_response": {
      "type": "object",
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "request_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "active": {
          "type": "boolean"
        },
        "permitted": {
          "type": "boolean"
        },
        "reason": {
          "anyOf": [
            {
              "enum": [
                "invalid_token",
                "inactive_agreement",
                "scope_mismatch"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "admission": {
          "anyOf": [
            {
              "$ref": "#/$defs/admission"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id",
        "request_id",
        "active",
        "permitted",
        "reason",
        "admission"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "permitted": {
                "const": true
              }
            },
            "required": [
              "permitted"
            ]
          },
          "then": {
            "properties": {
              "active": {
                "const": true
              },
              "reason": {
                "const": null
              },
              "admission": {
                "$ref": "#/$defs/admission"
              }
            }
          },
          "else": {
            "properties": {
              "admission": {
                "const": null
              }
            },
            "allOf": [
              {
                "if": {
                  "properties": {
                    "active": {
                      "const": true
                    }
                  },
                  "required": [
                    "active"
                  ]
                },
                "then": {
                  "properties": {
                    "reason": {
                      "const": "scope_mismatch"
                    }
                  }
                },
                "else": {
                  "properties": {
                    "reason": {
                      "enum": [
                        "invalid_token",
                        "inactive_agreement"
                      ]
                    }
                  }
                }
              }
            ]
          }
        }
      ]
    },
    "report": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "event_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "event_type": {
          "enum": [
            "use.reported",
            "access.authorized",
            "access.denied",
            "delivery.completed",
            "delivery.failed",
            "response.completed",
            "response.failed",
            "policy.observed",
            "offer.issued",
            "acceptance.recorded",
            "agreement.active",
            "agreement.revoked"
          ]
        },
        "occurred_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "reporter_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "source": {
          "enum": [
            "client_reported",
            "origin_observed",
            "service_recorded"
          ]
        },
        "resource_url": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^#]+$"
        },
        "policy_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "policy_revision": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "actions": {
          "type": "array",
          "items": {
            "enum": [
              "retrieve",
              "store",
              "transform",
              "redistribute"
            ]
          },
          "minItems": 0,
          "maxItems": 4,
          "uniqueItems": true
        },
        "purposes": {
          "type": "array",
          "items": {
            "enum": [
              "search_indexing",
              "public_retrieval",
              "internal_knowledge",
              "model_training",
              "model_fine_tuning",
              "redistribution"
            ]
          },
          "minItems": 0,
          "maxItems": 6,
          "uniqueItems": true
        },
        "agreement_id": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "asset_ref": {
          "anyOf": [
            {
              "$ref": "#/$defs/asset_ref"
            },
            {
              "type": "null"
            }
          ]
        },
        "operation": {
          "anyOf": [
            {
              "$ref": "#/$defs/operation"
            },
            {
              "type": "null"
            }
          ]
        },
        "http": {
          "anyOf": [
            {
              "$ref": "#/$defs/http"
            },
            {
              "type": "null"
            }
          ]
        },
        "quantity": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "unit": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[A-Za-z][A-Za-z0-9._:-]{0,63}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "related_events": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/related_event"
          },
          "minItems": 0,
          "maxItems": 64,
          "uniqueItems": true
        },
        "derived_from": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/asset_ref"
          },
          "minItems": 0,
          "maxItems": 64,
          "uniqueItems": true
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id",
        "event_id",
        "event_type",
        "occurred_at",
        "reporter_id",
        "source",
        "resource_url",
        "policy_id",
        "policy_revision",
        "actions",
        "purposes",
        "agreement_id",
        "asset_ref",
        "operation",
        "http",
        "quantity",
        "unit",
        "related_events",
        "derived_from"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "source": {
                "const": "client_reported"
              }
            }
          },
          "then": {
            "properties": {
              "event_type": {
                "enum": [
                  "use.reported"
                ]
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "source": {
                "const": "origin_observed"
              }
            }
          },
          "then": {
            "properties": {
              "event_type": {
                "enum": [
                  "access.authorized",
                  "access.denied",
                  "delivery.completed",
                  "delivery.failed",
                  "response.completed",
                  "response.failed"
                ]
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "source": {
                "const": "service_recorded"
              }
            }
          },
          "then": {
            "properties": {
              "event_type": {
                "enum": [
                  "policy.observed",
                  "offer.issued",
                  "acceptance.recorded",
                  "agreement.active",
                  "agreement.revoked"
                ]
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "event_type": {
                "enum": [
                  "delivery.completed",
                  "delivery.failed",
                  "response.completed",
                  "response.failed"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "http": {
                "$ref": "#/$defs/http"
              }
            }
          },
          "else": {
            "properties": {
              "http": {
                "type": "null"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "event_type": {
                "const": "use.reported"
              }
            }
          },
          "then": {
            "properties": {
              "operation": {
                "$ref": "#/$defs/operation"
              },
              "actions": {
                "type": "array",
                "items": {
                  "enum": [
                    "retrieve",
                    "store",
                    "transform",
                    "redistribute"
                  ]
                },
                "minItems": 1,
                "maxItems": 1,
                "uniqueItems": true
              },
              "purposes": {
                "type": "array",
                "items": {
                  "enum": [
                    "search_indexing",
                    "public_retrieval",
                    "internal_knowledge",
                    "model_training",
                    "model_fine_tuning",
                    "redistribution"
                  ]
                },
                "minItems": 1,
                "maxItems": 6,
                "uniqueItems": true
              }
            }
          }
        }
      ]
    },
    "intake": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "record_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "collector_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "received_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
        },
        "assurance": {
          "enum": [
            "unverified",
            "client_key_verified",
            "origin_key_verified",
            "service_key_verified"
          ]
        },
        "authenticated_reporter_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "payload_digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "payload_b64url": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[A-Za-z0-9_-]+$",
          "maxLength": 174764
        },
        "reporter_jws": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 1048576,
              "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "authority": {
          "$ref": "#/$defs/authority"
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id",
        "record_id",
        "collector_id",
        "received_at",
        "assurance",
        "authenticated_reporter_id",
        "payload_digest",
        "payload_b64url",
        "reporter_jws",
        "authority"
      ]
    },
    "payment_check_request": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "protocol_version": {
          "const": "1.2.0-draft.3"
        },
        "origin": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "service_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^https://[^?#]+$"
        },
        "delegation_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^https://[^?#]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "agreement_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "check_id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "protocol_version",
        "origin",
        "service_id",
        "issuer",
        "delegation_id",
        "agreement_id",
        "check_id"
      ]
    }
  },
  "$ref": "#/$defs/offer"
}
