{
  "openapi": "3.1.0",
  "info": {
    "title": "Autonym recipient API",
    "version": "1.0-draft-1",
    "description": "Draft wire version 1.0. No recipient runtime is claimed. Every access token is DPoP-bound: no Bearer token is issued or accepted (A6.3)."
  },
  "servers": [
    {
      "url": "https://autonym.example"
    }
  ],
  "x-implementation-status": "not-implemented",
  "paths": {
    "/.well-known/autonym": {
      "get": {
        "operationId": "discover",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. This is a specified contract, not an implemented endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/discovery"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 error; OAuth errors follow OAuth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/grant": {
      "get": {
        "operationId": "getGrant",
        "security": [
          {
            "OAuth": [],
            "DPoP": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. This is a specified contract, not an implemented endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/grant"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 error; OAuth errors follow OAuth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/domains": {
      "get": {
        "operationId": "listDomains",
        "security": [
          {
            "OAuth": [],
            "DPoP": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. This is a specified contract, not an implemented endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/domain-list"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 error; OAuth errors follow OAuth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/context": {
      "get": {
        "operationId": "getContext",
        "security": [
          {
            "OAuth": [],
            "DPoP": []
          }
        ],
        "parameters": [
          {
            "name": "domains",
            "in": "query",
            "required": true,
            "style": "form",
            "explode": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "minItems": 1,
              "maxItems": 32,
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
              }
            }
          },
          {
            "name": "max_level",
            "in": "query",
            "required": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "type": "string",
              "enum": [
                "L0",
                "L1",
                "L2",
                "L3"
              ]
            }
          },
          {
            "name": "keys",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "minItems": 1,
              "maxItems": 128,
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
              }
            }
          },
          {
            "name": "declared_only",
            "in": "query",
            "required": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "type": "boolean"
            }
          },
          {
            "name": "min_confidence",
            "in": "query",
            "required": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. This is a specified contract, not an implemented endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/disclosure"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 error; OAuth errors follow OAuth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/context/{domain}": {
      "get": {
        "operationId": "getDomainContext",
        "security": [
          {
            "OAuth": [],
            "DPoP": []
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_level",
            "in": "query",
            "required": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "type": "string",
              "enum": [
                "L0",
                "L1",
                "L2",
                "L3"
              ]
            }
          },
          {
            "name": "keys",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "minItems": 1,
              "maxItems": 128,
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
              }
            }
          },
          {
            "name": "declared_only",
            "in": "query",
            "required": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "type": "boolean"
            }
          },
          {
            "name": "min_confidence",
            "in": "query",
            "required": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. This is a specified contract, not an implemented endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/disclosure"
                }
              }
            }
          },
          "304": {
            "description": "Authorised, still-valid previous envelope; logged but not a new read."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/proposals": {
      "post": {
        "operationId": "proposeEntry",
        "security": [
          {
            "OAuth": [],
            "DPoP": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/contribution-event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. This is a specified contract, not an implemented endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/proposal-status"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 error; OAuth errors follow OAuth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/proposals/{id}": {
      "get": {
        "operationId": "getProposal",
        "security": [
          {
            "OAuth": [],
            "DPoP": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. This is a specified contract, not an implemented endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/proposal-status"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 error; OAuth errors follow OAuth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "withdrawProposal",
        "security": [
          {
            "OAuth": [],
            "DPoP": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. This is a specified contract, not an implemented endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/proposal-status"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 error; OAuth errors follow OAuth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/proposals/{id}/confirm": {
      "post": {
        "operationId": "confirmEntry",
        "security": [
          {
            "OAuth": [],
            "DPoP": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/confirmation"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. This is a specified contract, not an implemented endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/confirmation-result"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 error; OAuth errors follow OAuth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/purge-instructions": {
      "get": {
        "operationId": "listPurgeInstructions",
        "security": [
          {
            "LifecycleOAuth": [
              "autonym:lifecycle:purge"
            ],
            "DPoP": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. This is a specified contract, not an implemented endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "instructions": {
                      "maxItems": 100,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$"
                      }
                    }
                  },
                  "required": [
                    "instructions"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 error; OAuth errors follow OAuth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/purge-instructions/{jti}/ack": {
      "post": {
        "operationId": "acknowledgePurge",
        "security": [
          {
            "LifecycleOAuth": [
              "autonym:lifecycle:purge"
            ],
            "DPoP": []
          }
        ],
        "parameters": [
          {
            "name": "jti",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/purge-ack"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. This is a specified contract, not an implemented endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/purge-ack"
                }
              }
            }
          },
          "default": {
            "description": "RFC 9457 error; OAuth errors follow OAuth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "entry": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ent_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "profile_id": {
            "type": "string",
            "pattern": "^prf_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "domain": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
          },
          "value_type": {
            "type": "string",
            "enum": [
              "text",
              "number",
              "boolean",
              "enum",
              "list",
              "coded",
              "coded_list",
              "date",
              "date_range",
              "age_band",
              "person_ref",
              "structured",
              "credential"
            ]
          },
          "value": {
            "$ref": "#/$defs/__schema0"
          },
          "context_kind": {
            "type": "string",
            "enum": [
              "fact",
              "preference",
              "state"
            ]
          },
          "provenance": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "declared",
                  "observed",
                  "derived",
                  "attested"
                ]
              },
              "source_client_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "source_event_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "recorded_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "occurred_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "confidence": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "confirmed_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "evidence_refs": {
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "derived_from": {
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "entry_id": {
                      "type": "string",
                      "pattern": "^ent_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                    },
                    "version": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "level": {
                      "type": "string",
                      "enum": [
                        "L0",
                        "L1",
                        "L2",
                        "L3"
                      ]
                    },
                    "fields": {
                      "minItems": 1,
                      "maxItems": 64,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 256
                      }
                    }
                  },
                  "required": [
                    "entry_id",
                    "version",
                    "level",
                    "fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "kind",
              "source_client_id",
              "source_event_id",
              "recorded_at",
              "occurred_at",
              "confidence",
              "confirmed_at",
              "evidence_refs",
              "derived_from"
            ],
            "additionalProperties": false
          },
          "temporal": {
            "type": "object",
            "properties": {
              "valid_from": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "valid_until": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "valid_from",
              "valid_until"
            ],
            "additionalProperties": false
          },
          "overlay": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "target_entry_id": {
                    "type": "string",
                    "pattern": "^ent_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "selected": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "target_entry_id",
                  "enabled",
                  "selected"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "rendering_overrides": {
            "type": "object",
            "properties": {
              "L1": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              }
            },
            "additionalProperties": false
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "superseded",
              "archived"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "origin_host": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "id",
          "version",
          "profile_id",
          "domain",
          "key",
          "value_type",
          "value",
          "context_kind",
          "provenance",
          "temporal",
          "overlay",
          "rendering_overrides",
          "status",
          "created_at",
          "updated_at",
          "origin_host"
        ],
        "additionalProperties": false,
        "$defs": {
          "__schema0": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema0"
                }
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              }
            ]
          }
        },
        "$id": "urn:autonym:schema:entry:1.0:1.0-draft-1"
      },
      "temporal": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "valid_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "valid_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "valid_from",
          "valid_until"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:temporal:1.0:1.0-draft-1"
      },
      "grant": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^gr_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
              },
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "handle": {
                "type": "string",
                "maxLength": 294,
                "pattern": "^autonym:[a-z2-7]{32}@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$"
              },
              "client_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              },
              "purpose": {
                "type": "object",
                "properties": {
                  "category": {
                    "type": "string",
                    "enum": [
                      "booking",
                      "recommendation",
                      "safety",
                      "fulfilment",
                      "personalisation",
                      "research",
                      "care",
                      "medical",
                      "employment",
                      "advertising"
                    ]
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  }
                },
                "required": [
                  "category",
                  "text"
                ],
                "additionalProperties": false
              },
              "issued_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "revoked",
                  "expired"
                ]
              },
              "kind": {
                "type": "string",
                "const": "read"
              },
              "read": {
                "minItems": 1,
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "domain": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                        },
                        {
                          "type": "string",
                          "const": "*"
                        }
                      ]
                    },
                    "keys": {
                      "anyOf": [
                        {
                          "minItems": 1,
                          "maxItems": 128,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "max_level": {
                      "type": "string",
                      "enum": [
                        "L0",
                        "L1",
                        "L2",
                        "L3"
                      ]
                    }
                  },
                  "required": [
                    "domain",
                    "keys",
                    "max_level"
                  ],
                  "additionalProperties": false
                }
              },
              "declared_only": {
                "type": "boolean"
              },
              "min_confidence": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "max_reads": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 100000
              },
              "reads_used": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "persist_until": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "allow_delegation": {
                "type": "boolean"
              },
              "onward_share": {
                "type": "boolean",
                "const": false
              }
            },
            "required": [
              "id",
              "revision",
              "handle",
              "client_id",
              "purpose",
              "issued_at",
              "expires_at",
              "status",
              "kind",
              "read",
              "declared_only",
              "min_confidence",
              "max_reads",
              "reads_used",
              "persist_until",
              "allow_delegation",
              "onward_share"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^gr_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
              },
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "handle": {
                "type": "string",
                "maxLength": 294,
                "pattern": "^autonym:[a-z2-7]{32}@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$"
              },
              "client_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              },
              "purpose": {
                "type": "object",
                "properties": {
                  "category": {
                    "type": "string",
                    "enum": [
                      "booking",
                      "recommendation",
                      "safety",
                      "fulfilment",
                      "personalisation",
                      "research",
                      "care",
                      "medical",
                      "employment",
                      "advertising"
                    ]
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  }
                },
                "required": [
                  "category",
                  "text"
                ],
                "additionalProperties": false
              },
              "issued_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "revoked",
                  "expired"
                ]
              },
              "kind": {
                "type": "string",
                "const": "contribute"
              },
              "contribute": {
                "minItems": 1,
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "domain": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                    },
                    "keys": {
                      "minItems": 1,
                      "maxItems": 128,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                      }
                    }
                  },
                  "required": [
                    "domain",
                    "keys"
                  ],
                  "additionalProperties": false
                }
              },
              "max_events": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 100000
              },
              "events_used": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "allow_confirmation": {
                "type": "boolean"
              },
              "stream_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
              }
            },
            "required": [
              "id",
              "revision",
              "handle",
              "client_id",
              "purpose",
              "issued_at",
              "expires_at",
              "status",
              "kind",
              "contribute",
              "max_events",
              "events_used",
              "allow_confirmation",
              "stream_id"
            ],
            "additionalProperties": false
          }
        ],
        "$id": "urn:autonym:schema:grant:1.0:1.0-draft-1"
      },
      "context-request": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "domains": {
            "minItems": 1,
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
            }
          },
          "max_level": {
            "type": "string",
            "enum": [
              "L0",
              "L1",
              "L2",
              "L3"
            ]
          },
          "keys": {
            "minItems": 1,
            "maxItems": 128,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
            }
          },
          "declared_only": {
            "type": "boolean"
          },
          "min_confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "domains"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:context-request:1.0:1.0-draft-1"
      },
      "disclosure": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "autonym_version": {
            "type": "string",
            "const": "1.0"
          },
          "provider": {
            "type": "string",
            "format": "uri"
          },
          "audience": {
            "type": "string",
            "format": "uri"
          },
          "client_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          },
          "handle": {
            "type": "string",
            "maxLength": 294,
            "pattern": "^autonym:[a-z2-7]{32}@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$"
          },
          "grant_id": {
            "type": "string",
            "pattern": "^gr_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "grant_revision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "read_id": {
            "type": "string",
            "pattern": "^rd_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "booking",
              "recommendation",
              "safety",
              "fulfilment",
              "personalisation",
              "research",
              "care",
              "medical",
              "employment",
              "advertising"
            ]
          },
          "issued_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "valid_until": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "ttl_seconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300
          },
          "persist_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "entries": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^rent_[a-z2-7]{52}$"
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "domain": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                },
                "key": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                },
                "level": {
                  "type": "string",
                  "enum": [
                    "L0",
                    "L1",
                    "L2",
                    "L3"
                  ]
                },
                "value_type": {
                  "type": "string",
                  "enum": [
                    "text",
                    "number",
                    "boolean",
                    "enum",
                    "list",
                    "coded",
                    "coded_list",
                    "date",
                    "date_range",
                    "age_band",
                    "person_ref",
                    "structured",
                    "credential"
                  ]
                },
                "value": {
                  "$ref": "#/$defs/__schema0"
                },
                "context_kind": {
                  "type": "string",
                  "enum": [
                    "fact",
                    "preference",
                    "state"
                  ]
                },
                "safety_critical": {
                  "type": "boolean"
                },
                "provenance": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "declared",
                        "observed",
                        "derived",
                        "attested"
                      ]
                    },
                    "confirmed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "kind",
                    "confirmed"
                  ],
                  "additionalProperties": false
                },
                "stale": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "version",
                "domain",
                "key",
                "level",
                "value_type",
                "value",
                "context_kind",
                "safety_critical",
                "provenance",
                "stale"
              ],
              "additionalProperties": false
            }
          },
          "proof": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "jws"
              },
              "alg": {
                "type": "string",
                "const": "ES256"
              },
              "kid": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
              },
              "jws": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]+\\.\\.[A-Za-z0-9_-]+$"
              }
            },
            "required": [
              "type",
              "alg",
              "kid",
              "jws"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "autonym_version",
          "provider",
          "audience",
          "client_id",
          "handle",
          "grant_id",
          "grant_revision",
          "read_id",
          "purpose",
          "issued_at",
          "valid_until",
          "ttl_seconds",
          "persist_until",
          "entries",
          "proof"
        ],
        "additionalProperties": false,
        "$defs": {
          "__schema0": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema0"
                }
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              }
            ]
          }
        },
        "$id": "urn:autonym:schema:disclosure:1.0:1.0-draft-1"
      },
      "contribution-event": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "event_id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,128}$"
              },
              "occurred_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "stream_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
              },
              "domain": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
              },
              "key": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
              },
              "value_type": {
                "type": "string",
                "enum": [
                  "text",
                  "number",
                  "boolean",
                  "enum",
                  "list",
                  "coded",
                  "coded_list",
                  "date",
                  "date_range",
                  "age_band",
                  "person_ref",
                  "structured",
                  "credential"
                ]
              },
              "value": {
                "$ref": "#/$defs/__schema0"
              },
              "context_kind": {
                "type": "string",
                "enum": [
                  "fact",
                  "preference",
                  "state"
                ]
              },
              "temporal": {
                "type": "object",
                "properties": {
                  "valid_from": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "valid_until": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "valid_from",
                  "valid_until"
                ],
                "additionalProperties": false
              },
              "category": {
                "type": "string",
                "enum": [
                  "user_supplied",
                  "activity",
                  "observation",
                  "inference"
                ]
              },
              "evidence_refs": {
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "operation": {
                "type": "string",
                "const": "create"
              }
            },
            "required": [
              "event_id",
              "occurred_at",
              "stream_id",
              "domain",
              "key",
              "value_type",
              "value",
              "context_kind",
              "temporal",
              "category",
              "evidence_refs",
              "operation"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "event_id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,128}$"
              },
              "occurred_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "stream_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
              },
              "domain": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
              },
              "key": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
              },
              "value_type": {
                "type": "string",
                "enum": [
                  "text",
                  "number",
                  "boolean",
                  "enum",
                  "list",
                  "coded",
                  "coded_list",
                  "date",
                  "date_range",
                  "age_band",
                  "person_ref",
                  "structured",
                  "credential"
                ]
              },
              "value": {
                "$ref": "#/$defs/__schema0"
              },
              "context_kind": {
                "type": "string",
                "enum": [
                  "fact",
                  "preference",
                  "state"
                ]
              },
              "temporal": {
                "type": "object",
                "properties": {
                  "valid_from": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "valid_until": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "valid_from",
                  "valid_until"
                ],
                "additionalProperties": false
              },
              "category": {
                "type": "string",
                "enum": [
                  "user_supplied",
                  "activity",
                  "observation",
                  "inference"
                ]
              },
              "evidence_refs": {
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "operation": {
                "type": "string",
                "const": "correct"
              },
              "predecessor_event_id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,128}$"
              }
            },
            "required": [
              "event_id",
              "occurred_at",
              "stream_id",
              "domain",
              "key",
              "value_type",
              "value",
              "context_kind",
              "temporal",
              "category",
              "evidence_refs",
              "operation",
              "predecessor_event_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "event_id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,128}$"
              },
              "occurred_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "stream_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
              },
              "operation": {
                "type": "string",
                "const": "withdraw"
              },
              "predecessor_event_id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,128}$"
              }
            },
            "required": [
              "event_id",
              "occurred_at",
              "stream_id",
              "operation",
              "predecessor_event_id"
            ],
            "additionalProperties": false
          }
        ],
        "$defs": {
          "__schema0": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema0"
                }
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              }
            ]
          }
        },
        "$id": "urn:autonym:schema:contribution-event:1.0:1.0-draft-1"
      },
      "proposal-status": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "proposal_id": {
            "type": "string",
            "pattern": "^prp_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "event_id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "ingested_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "rejected",
              "withdrawn"
            ]
          }
        },
        "required": [
          "proposal_id",
          "event_id",
          "ingested_at",
          "status"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:proposal-status:1.0:1.0-draft-1"
      },
      "confirmation": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "proposal_id": {
            "type": "string",
            "pattern": "^prp_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          }
        },
        "required": [
          "proposal_id"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:confirmation:1.0:1.0-draft-1"
      },
      "confirmation-result": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "review_required"
          },
          "review_url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "status",
          "review_url"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:confirmation-result:1.0:1.0-draft-1"
      },
      "domain-list": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "domains": {
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "domain": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                },
                "max_level": {
                  "type": "string",
                  "enum": [
                    "L0",
                    "L1",
                    "L2",
                    "L3"
                  ]
                },
                "keys": {
                  "maxItems": 128,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                  }
                }
              },
              "required": [
                "domain",
                "max_level",
                "keys"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "domains"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:domain-list:1.0:1.0-draft-1"
      },
      "receipt": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "event_id": {
            "type": "string",
            "pattern": "^evt_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "provider": {
            "type": "string",
            "format": "uri"
          },
          "read_id": {
            "type": "string",
            "pattern": "^rd_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "grant_id": {
            "type": "string",
            "pattern": "^gr_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "client_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "booking",
              "recommendation",
              "safety",
              "fulfilment",
              "personalisation",
              "research",
              "care",
              "medical",
              "employment",
              "advertising"
            ]
          },
          "surface": {
            "type": "string",
            "enum": [
              "rest",
              "mcp_tool",
              "mcp_resource",
              "mcp_briefing"
            ]
          },
          "request": {
            "type": "object",
            "properties": {
              "domains": {
                "minItems": 1,
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                }
              },
              "max_level": {
                "type": "string",
                "enum": [
                  "L0",
                  "L1",
                  "L2",
                  "L3"
                ]
              },
              "keys": {
                "minItems": 1,
                "maxItems": 128,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                }
              },
              "declared_only": {
                "type": "boolean"
              },
              "min_confidence": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "since": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              }
            },
            "required": [
              "domains",
              "max_level",
              "declared_only",
              "min_confidence"
            ],
            "additionalProperties": false
          },
          "returned": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entry_id": {
                  "type": "string",
                  "pattern": "^ent_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "level": {
                  "type": "string",
                  "enum": [
                    "L0",
                    "L1",
                    "L2",
                    "L3"
                  ]
                }
              },
              "required": [
                "entry_id",
                "version",
                "level"
              ],
              "additionalProperties": false
            }
          },
          "response_hash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "prev_hash": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^sha256:[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "hash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "proof": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "jws"
              },
              "alg": {
                "type": "string",
                "const": "ES256"
              },
              "kid": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
              },
              "jws": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]+\\.\\.[A-Za-z0-9_-]+$"
              }
            },
            "required": [
              "type",
              "alg",
              "kid",
              "jws"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "event_id",
          "provider",
          "read_id",
          "grant_id",
          "client_id",
          "at",
          "purpose",
          "surface",
          "request",
          "returned",
          "response_hash",
          "prev_hash",
          "hash",
          "proof"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:receipt:1.0:1.0-draft-1"
      },
      "log-event": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "event_id": {
            "type": "string",
            "pattern": "^evt_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "grant_created",
              "grant_revoked",
              "grant_expired",
              "rule_applied",
              "delegation_redeemed",
              "proposal_decided",
              "overlay_enabled",
              "overlay_disabled",
              "overlay_selected",
              "read_not_modified",
              "purge_issued",
              "purge_acknowledged",
              "operator_action",
              "migration_imported"
            ]
          },
          "actor_client_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "subject_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "details": {
            "type": "object",
            "properties": {
              "decision": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "approved",
                      "rejected",
                      "enabled",
                      "disabled",
                      "selected",
                      "unchanged",
                      "completed",
                      "failed"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "ids": {
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "response_hash": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^sha256:[a-f0-9]{64}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "decision",
              "ids",
              "response_hash"
            ],
            "additionalProperties": false
          },
          "prev_hash": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^sha256:[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "hash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          }
        },
        "required": [
          "event_id",
          "at",
          "kind",
          "actor_client_id",
          "subject_id",
          "details",
          "prev_hash",
          "hash"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:log-event:1.0:1.0-draft-1"
      },
      "purge-instruction": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "iss": {
            "type": "string",
            "format": "uri"
          },
          "sub": {
            "type": "string",
            "maxLength": 294,
            "pattern": "^autonym:[a-z2-7]{32}@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$"
          },
          "aud": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          },
          "jti": {
            "type": "string",
            "pattern": "^pi_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "iat": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "exp": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "autonym_grant_id": {
            "type": "string",
            "pattern": "^gr_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "reason": {
            "type": "string",
            "const": "grant_ended"
          },
          "scope": {
            "type": "string",
            "const": "all"
          },
          "deadline": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "iss",
          "sub",
          "aud",
          "jti",
          "iat",
          "exp",
          "autonym_grant_id",
          "reason",
          "scope",
          "deadline"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:purge-instruction:1.0:1.0-draft-1"
      },
      "purge-ack": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "instruction_id": {
            "type": "string",
            "pattern": "^pi_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "attestation": {
            "type": "string",
            "enum": [
              "purged",
              "not_held",
              "legal_hold"
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "note": {
            "type": "string",
            "maxLength": 2048
          },
          "proof": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "jws"
                  },
                  "alg": {
                    "type": "string",
                    "const": "ES256"
                  },
                  "kid": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
                  },
                  "jws": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]+\\.\\.[A-Za-z0-9_-]+$"
                  }
                },
                "required": [
                  "type",
                  "alg",
                  "kid",
                  "jws"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "instruction_id",
          "attestation",
          "at",
          "note",
          "proof"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:purge-ack:1.0:1.0-draft-1"
      },
      "capability-claim": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "autonym_version": {
                "type": "string",
                "const": "1.0"
              },
              "document_version": {
                "type": "string",
                "const": "1.0-draft-1"
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "domain": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                    },
                    "keys": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                      }
                    },
                    "directions": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "read",
                          "contribute",
                          "export",
                          "import"
                        ]
                      }
                    }
                  },
                  "required": [
                    "domain",
                    "keys",
                    "directions"
                  ],
                  "additionalProperties": false
                }
              },
              "limitations": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                }
              },
              "assurance": {
                "type": "string",
                "const": "self-declared"
              },
              "evidence": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "check_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "tested_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    }
                  },
                  "required": [
                    "check_id",
                    "url",
                    "tested_at"
                  ],
                  "additionalProperties": false
                }
              },
              "role": {
                "type": "string",
                "const": "provider"
              },
              "capabilities": {
                "maxItems": 4,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "Core",
                    "Write",
                    "Portable",
                    "Delegated"
                  ]
                }
              }
            },
            "required": [
              "autonym_version",
              "document_version",
              "categories",
              "limitations",
              "assurance",
              "evidence",
              "role",
              "capabilities"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "autonym_version": {
                "type": "string",
                "const": "1.0"
              },
              "document_version": {
                "type": "string",
                "const": "1.0-draft-1"
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "domain": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                    },
                    "keys": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                      }
                    },
                    "directions": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "read",
                          "contribute",
                          "export",
                          "import"
                        ]
                      }
                    }
                  },
                  "required": [
                    "domain",
                    "keys",
                    "directions"
                  ],
                  "additionalProperties": false
                }
              },
              "limitations": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                }
              },
              "assurance": {
                "type": "string",
                "const": "self-declared"
              },
              "evidence": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "check_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "tested_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    }
                  },
                  "required": [
                    "check_id",
                    "url",
                    "tested_at"
                  ],
                  "additionalProperties": false
                }
              },
              "role": {
                "type": "string",
                "const": "recipient"
              },
              "capabilities": {
                "maxItems": 3,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "Read",
                    "Contribute",
                    "Reciprocal"
                  ]
                }
              }
            },
            "required": [
              "autonym_version",
              "document_version",
              "categories",
              "limitations",
              "assurance",
              "evidence",
              "role",
              "capabilities"
            ],
            "additionalProperties": false
          }
        ],
        "$id": "urn:autonym:schema:capability-claim:1.0:1.0-draft-1"
      },
      "discovery": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "autonym_version": {
            "type": "string",
            "const": "1.0"
          },
          "issuer": {
            "type": "string",
            "format": "uri"
          },
          "authorization_server": {
            "type": "string",
            "format": "uri"
          },
          "jwks_uri": {
            "type": "string",
            "format": "uri"
          },
          "rest_endpoint": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "mcp_endpoint": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "capabilities": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "autonym_version": {
                    "type": "string",
                    "const": "1.0"
                  },
                  "document_version": {
                    "type": "string",
                    "const": "1.0-draft-1"
                  },
                  "categories": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "domain": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                        },
                        "keys": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                          }
                        },
                        "directions": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "read",
                              "contribute",
                              "export",
                              "import"
                            ]
                          }
                        }
                      },
                      "required": [
                        "domain",
                        "keys",
                        "directions"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "limitations": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4096
                    }
                  },
                  "assurance": {
                    "type": "string",
                    "const": "self-declared"
                  },
                  "evidence": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "check_id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "tested_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        }
                      },
                      "required": [
                        "check_id",
                        "url",
                        "tested_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "role": {
                    "type": "string",
                    "const": "provider"
                  },
                  "capabilities": {
                    "maxItems": 4,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "Core",
                        "Write",
                        "Portable",
                        "Delegated"
                      ]
                    }
                  }
                },
                "required": [
                  "autonym_version",
                  "document_version",
                  "categories",
                  "limitations",
                  "assurance",
                  "evidence",
                  "role",
                  "capabilities"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "autonym_version": {
                    "type": "string",
                    "const": "1.0"
                  },
                  "document_version": {
                    "type": "string",
                    "const": "1.0-draft-1"
                  },
                  "categories": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "domain": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                        },
                        "keys": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                          }
                        },
                        "directions": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "read",
                              "contribute",
                              "export",
                              "import"
                            ]
                          }
                        }
                      },
                      "required": [
                        "domain",
                        "keys",
                        "directions"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "limitations": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4096
                    }
                  },
                  "assurance": {
                    "type": "string",
                    "const": "self-declared"
                  },
                  "evidence": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "check_id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "tested_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        }
                      },
                      "required": [
                        "check_id",
                        "url",
                        "tested_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "role": {
                    "type": "string",
                    "const": "recipient"
                  },
                  "capabilities": {
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "Read",
                        "Contribute",
                        "Reciprocal"
                      ]
                    }
                  }
                },
                "required": [
                  "autonym_version",
                  "document_version",
                  "categories",
                  "limitations",
                  "assurance",
                  "evidence",
                  "role",
                  "capabilities"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "autonym_version",
          "issuer",
          "authorization_server",
          "jwks_uri",
          "rest_endpoint",
          "mcp_endpoint",
          "capabilities"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:discovery:1.0:1.0-draft-1"
      },
      "export": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "format": {
            "type": "string",
            "const": "autonym-export/1.0"
          },
          "exported_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "origin_host": {
            "type": "string",
            "format": "uri"
          },
          "history_mode": {
            "type": "string",
            "enum": [
              "current",
              "all_retained"
            ]
          },
          "partitions": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^prf_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                }
              },
              "required": [
                "id",
                "label"
              ],
              "additionalProperties": false
            }
          },
          "entries": {
            "maxItems": 100000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^ent_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "profile_id": {
                  "type": "string",
                  "pattern": "^prf_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                },
                "domain": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                },
                "key": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                },
                "value_type": {
                  "type": "string",
                  "enum": [
                    "text",
                    "number",
                    "boolean",
                    "enum",
                    "list",
                    "coded",
                    "coded_list",
                    "date",
                    "date_range",
                    "age_band",
                    "person_ref",
                    "structured",
                    "credential"
                  ]
                },
                "value": {
                  "$ref": "#/$defs/__schema0"
                },
                "context_kind": {
                  "type": "string",
                  "enum": [
                    "fact",
                    "preference",
                    "state"
                  ]
                },
                "provenance": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "declared",
                        "observed",
                        "derived",
                        "attested"
                      ]
                    },
                    "source_client_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2048
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source_event_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "recorded_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    "occurred_at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "confirmed_at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "evidence_refs": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256
                      }
                    },
                    "derived_from": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entry_id": {
                            "type": "string",
                            "pattern": "^ent_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                          },
                          "version": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          },
                          "level": {
                            "type": "string",
                            "enum": [
                              "L0",
                              "L1",
                              "L2",
                              "L3"
                            ]
                          },
                          "fields": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "maxLength": 256
                            }
                          }
                        },
                        "required": [
                          "entry_id",
                          "version",
                          "level",
                          "fields"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "kind",
                    "source_client_id",
                    "source_event_id",
                    "recorded_at",
                    "occurred_at",
                    "confidence",
                    "confirmed_at",
                    "evidence_refs",
                    "derived_from"
                  ],
                  "additionalProperties": false
                },
                "temporal": {
                  "type": "object",
                  "properties": {
                    "valid_from": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "valid_until": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "valid_from",
                    "valid_until"
                  ],
                  "additionalProperties": false
                },
                "overlay": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "target_entry_id": {
                          "type": "string",
                          "pattern": "^ent_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "selected": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "target_entry_id",
                        "enabled",
                        "selected"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "rendering_overrides": {
                  "type": "object",
                  "properties": {
                    "L1": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4096
                    }
                  },
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "active",
                    "superseded",
                    "archived"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "origin_host": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "id",
                "version",
                "profile_id",
                "domain",
                "key",
                "value_type",
                "value",
                "context_kind",
                "provenance",
                "temporal",
                "overlay",
                "rendering_overrides",
                "status",
                "created_at",
                "updated_at",
                "origin_host"
              ],
              "additionalProperties": false
            }
          },
          "tombstones": {
            "maxItems": 100000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^ent_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "profile_id": {
                  "type": "string",
                  "pattern": "^prf_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                },
                "domain": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                },
                "key": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                },
                "deleted_at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                }
              },
              "required": [
                "id",
                "version",
                "profile_id",
                "domain",
                "key",
                "deleted_at"
              ],
              "additionalProperties": false
            }
          },
          "grants_history": {
            "maxItems": 100000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "profile_id": {
                  "type": "string",
                  "pattern": "^prf_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                },
                "grant": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^gr_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                        },
                        "revision": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "handle": {
                          "type": "string",
                          "maxLength": 294,
                          "pattern": "^autonym:[a-z2-7]{32}@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$"
                        },
                        "client_id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2048
                        },
                        "purpose": {
                          "type": "object",
                          "properties": {
                            "category": {
                              "type": "string",
                              "enum": [
                                "booking",
                                "recommendation",
                                "safety",
                                "fulfilment",
                                "personalisation",
                                "research",
                                "care",
                                "medical",
                                "employment",
                                "advertising"
                              ]
                            },
                            "text": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 4096
                            }
                          },
                          "required": [
                            "category",
                            "text"
                          ],
                          "additionalProperties": false
                        },
                        "issued_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        "expires_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "revoked",
                            "expired"
                          ]
                        },
                        "kind": {
                          "type": "string",
                          "const": "read"
                        },
                        "read": {
                          "minItems": 1,
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "domain": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                                  },
                                  {
                                    "type": "string",
                                    "const": "*"
                                  }
                                ]
                              },
                              "keys": {
                                "anyOf": [
                                  {
                                    "minItems": 1,
                                    "maxItems": 128,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                                    }
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "max_level": {
                                "type": "string",
                                "enum": [
                                  "L0",
                                  "L1",
                                  "L2",
                                  "L3"
                                ]
                              }
                            },
                            "required": [
                              "domain",
                              "keys",
                              "max_level"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "declared_only": {
                          "type": "boolean"
                        },
                        "min_confidence": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        "max_reads": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 100000
                        },
                        "reads_used": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "persist_until": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allow_delegation": {
                          "type": "boolean"
                        },
                        "onward_share": {
                          "type": "boolean",
                          "const": false
                        }
                      },
                      "required": [
                        "id",
                        "revision",
                        "handle",
                        "client_id",
                        "purpose",
                        "issued_at",
                        "expires_at",
                        "status",
                        "kind",
                        "read",
                        "declared_only",
                        "min_confidence",
                        "max_reads",
                        "reads_used",
                        "persist_until",
                        "allow_delegation",
                        "onward_share"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^gr_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                        },
                        "revision": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "handle": {
                          "type": "string",
                          "maxLength": 294,
                          "pattern": "^autonym:[a-z2-7]{32}@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$"
                        },
                        "client_id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2048
                        },
                        "purpose": {
                          "type": "object",
                          "properties": {
                            "category": {
                              "type": "string",
                              "enum": [
                                "booking",
                                "recommendation",
                                "safety",
                                "fulfilment",
                                "personalisation",
                                "research",
                                "care",
                                "medical",
                                "employment",
                                "advertising"
                              ]
                            },
                            "text": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 4096
                            }
                          },
                          "required": [
                            "category",
                            "text"
                          ],
                          "additionalProperties": false
                        },
                        "issued_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        "expires_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "revoked",
                            "expired"
                          ]
                        },
                        "kind": {
                          "type": "string",
                          "const": "contribute"
                        },
                        "contribute": {
                          "minItems": 1,
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "domain": {
                                "type": "string",
                                "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                              },
                              "keys": {
                                "minItems": 1,
                                "maxItems": 128,
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                                }
                              }
                            },
                            "required": [
                              "domain",
                              "keys"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "max_events": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 100000
                        },
                        "events_used": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "allow_confirmation": {
                          "type": "boolean"
                        },
                        "stream_id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
                        }
                      },
                      "required": [
                        "id",
                        "revision",
                        "handle",
                        "client_id",
                        "purpose",
                        "issued_at",
                        "expires_at",
                        "status",
                        "kind",
                        "contribute",
                        "max_events",
                        "events_used",
                        "allow_confirmation",
                        "stream_id"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "required": [
                "profile_id",
                "grant"
              ],
              "additionalProperties": false
            }
          },
          "receipts": {
            "maxItems": 100000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "profile_id": {
                  "type": "string",
                  "pattern": "^prf_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                },
                "receipt": {
                  "type": "object",
                  "properties": {
                    "event_id": {
                      "type": "string",
                      "pattern": "^evt_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                    },
                    "provider": {
                      "type": "string",
                      "format": "uri"
                    },
                    "read_id": {
                      "type": "string",
                      "pattern": "^rd_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                    },
                    "grant_id": {
                      "type": "string",
                      "pattern": "^gr_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                    },
                    "client_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2048
                    },
                    "at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    "purpose": {
                      "type": "string",
                      "enum": [
                        "booking",
                        "recommendation",
                        "safety",
                        "fulfilment",
                        "personalisation",
                        "research",
                        "care",
                        "medical",
                        "employment",
                        "advertising"
                      ]
                    },
                    "surface": {
                      "type": "string",
                      "enum": [
                        "rest",
                        "mcp_tool",
                        "mcp_resource",
                        "mcp_briefing"
                      ]
                    },
                    "request": {
                      "type": "object",
                      "properties": {
                        "domains": {
                          "minItems": 1,
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                          }
                        },
                        "max_level": {
                          "type": "string",
                          "enum": [
                            "L0",
                            "L1",
                            "L2",
                            "L3"
                          ]
                        },
                        "keys": {
                          "minItems": 1,
                          "maxItems": 128,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                          }
                        },
                        "declared_only": {
                          "type": "boolean"
                        },
                        "min_confidence": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        "since": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        }
                      },
                      "required": [
                        "domains",
                        "max_level",
                        "declared_only",
                        "min_confidence"
                      ],
                      "additionalProperties": false
                    },
                    "returned": {
                      "maxItems": 1000,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entry_id": {
                            "type": "string",
                            "pattern": "^ent_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                          },
                          "version": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          },
                          "level": {
                            "type": "string",
                            "enum": [
                              "L0",
                              "L1",
                              "L2",
                              "L3"
                            ]
                          }
                        },
                        "required": [
                          "entry_id",
                          "version",
                          "level"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "response_hash": {
                      "type": "string",
                      "pattern": "^sha256:[a-f0-9]{64}$"
                    },
                    "prev_hash": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^sha256:[a-f0-9]{64}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "hash": {
                      "type": "string",
                      "pattern": "^sha256:[a-f0-9]{64}$"
                    },
                    "proof": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "jws"
                        },
                        "alg": {
                          "type": "string",
                          "const": "ES256"
                        },
                        "kid": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
                        },
                        "jws": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]+\\.\\.[A-Za-z0-9_-]+$"
                        }
                      },
                      "required": [
                        "type",
                        "alg",
                        "kid",
                        "jws"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "event_id",
                    "provider",
                    "read_id",
                    "grant_id",
                    "client_id",
                    "at",
                    "purpose",
                    "surface",
                    "request",
                    "returned",
                    "response_hash",
                    "prev_hash",
                    "hash",
                    "proof"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "profile_id",
                "receipt"
              ],
              "additionalProperties": false
            }
          },
          "log_events": {
            "maxItems": 100000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "profile_id": {
                  "type": "string",
                  "pattern": "^prf_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                },
                "event": {
                  "type": "object",
                  "properties": {
                    "event_id": {
                      "type": "string",
                      "pattern": "^evt_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                    },
                    "at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "grant_created",
                        "grant_revoked",
                        "grant_expired",
                        "rule_applied",
                        "delegation_redeemed",
                        "proposal_decided",
                        "overlay_enabled",
                        "overlay_disabled",
                        "overlay_selected",
                        "read_not_modified",
                        "purge_issued",
                        "purge_acknowledged",
                        "operator_action",
                        "migration_imported"
                      ]
                    },
                    "actor_client_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2048
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subject_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "details": {
                      "type": "object",
                      "properties": {
                        "decision": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "approved",
                                "rejected",
                                "enabled",
                                "disabled",
                                "selected",
                                "unchanged",
                                "completed",
                                "failed"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "ids": {
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          }
                        },
                        "response_hash": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^sha256:[a-f0-9]{64}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "decision",
                        "ids",
                        "response_hash"
                      ],
                      "additionalProperties": false
                    },
                    "prev_hash": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^sha256:[a-f0-9]{64}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "hash": {
                      "type": "string",
                      "pattern": "^sha256:[a-f0-9]{64}$"
                    }
                  },
                  "required": [
                    "event_id",
                    "at",
                    "kind",
                    "actor_client_id",
                    "subject_id",
                    "details",
                    "prev_hash",
                    "hash"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "profile_id",
                "event"
              ],
              "additionalProperties": false
            }
          },
          "public_keys": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kty": {
                  "type": "string",
                  "const": "EC"
                },
                "crv": {
                  "type": "string",
                  "const": "P-256"
                },
                "x": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
                },
                "y": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
                },
                "kid": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
                },
                "alg": {
                  "type": "string",
                  "const": "ES256"
                },
                "use": {
                  "type": "string",
                  "const": "sig"
                },
                "exp": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 253402300799
                }
              },
              "required": [
                "kty",
                "crv",
                "x",
                "y",
                "kid",
                "alg",
                "use"
              ],
              "additionalProperties": false
            }
          },
          "policy_history": {
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "profile_id": {
                  "type": "string",
                  "pattern": "^prf_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                },
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "rule",
                    "delegation"
                  ]
                },
                "executable": {
                  "type": "boolean",
                  "const": false
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                },
                "related_grant_ids": {
                  "maxItems": 1000,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^gr_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                  }
                }
              },
              "required": [
                "profile_id",
                "id",
                "kind",
                "executable",
                "description",
                "related_grant_ids"
              ],
              "additionalProperties": false
            }
          },
          "proposals": {
            "maxItems": 100000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "profile_id": {
                  "type": "string",
                  "pattern": "^prf_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                },
                "source_client_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 2048
                },
                "event": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "event_id": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,128}$"
                        },
                        "occurred_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        "stream_id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
                        },
                        "domain": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                        },
                        "key": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                        },
                        "value_type": {
                          "type": "string",
                          "enum": [
                            "text",
                            "number",
                            "boolean",
                            "enum",
                            "list",
                            "coded",
                            "coded_list",
                            "date",
                            "date_range",
                            "age_band",
                            "person_ref",
                            "structured",
                            "credential"
                          ]
                        },
                        "value": {
                          "$ref": "#/$defs/__schema0"
                        },
                        "context_kind": {
                          "type": "string",
                          "enum": [
                            "fact",
                            "preference",
                            "state"
                          ]
                        },
                        "temporal": {
                          "type": "object",
                          "properties": {
                            "valid_from": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "valid_until": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "valid_from",
                            "valid_until"
                          ],
                          "additionalProperties": false
                        },
                        "category": {
                          "type": "string",
                          "enum": [
                            "user_supplied",
                            "activity",
                            "observation",
                            "inference"
                          ]
                        },
                        "evidence_refs": {
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          }
                        },
                        "operation": {
                          "type": "string",
                          "const": "create"
                        }
                      },
                      "required": [
                        "event_id",
                        "occurred_at",
                        "stream_id",
                        "domain",
                        "key",
                        "value_type",
                        "value",
                        "context_kind",
                        "temporal",
                        "category",
                        "evidence_refs",
                        "operation"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "event_id": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,128}$"
                        },
                        "occurred_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        "stream_id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
                        },
                        "domain": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                        },
                        "key": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                        },
                        "value_type": {
                          "type": "string",
                          "enum": [
                            "text",
                            "number",
                            "boolean",
                            "enum",
                            "list",
                            "coded",
                            "coded_list",
                            "date",
                            "date_range",
                            "age_band",
                            "person_ref",
                            "structured",
                            "credential"
                          ]
                        },
                        "value": {
                          "$ref": "#/$defs/__schema0"
                        },
                        "context_kind": {
                          "type": "string",
                          "enum": [
                            "fact",
                            "preference",
                            "state"
                          ]
                        },
                        "temporal": {
                          "type": "object",
                          "properties": {
                            "valid_from": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "valid_until": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "valid_from",
                            "valid_until"
                          ],
                          "additionalProperties": false
                        },
                        "category": {
                          "type": "string",
                          "enum": [
                            "user_supplied",
                            "activity",
                            "observation",
                            "inference"
                          ]
                        },
                        "evidence_refs": {
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          }
                        },
                        "operation": {
                          "type": "string",
                          "const": "correct"
                        },
                        "predecessor_event_id": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,128}$"
                        }
                      },
                      "required": [
                        "event_id",
                        "occurred_at",
                        "stream_id",
                        "domain",
                        "key",
                        "value_type",
                        "value",
                        "context_kind",
                        "temporal",
                        "category",
                        "evidence_refs",
                        "operation",
                        "predecessor_event_id"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "event_id": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,128}$"
                        },
                        "occurred_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        "stream_id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
                        },
                        "operation": {
                          "type": "string",
                          "const": "withdraw"
                        },
                        "predecessor_event_id": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,128}$"
                        }
                      },
                      "required": [
                        "event_id",
                        "occurred_at",
                        "stream_id",
                        "operation",
                        "predecessor_event_id"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "acknowledgement": {
                  "type": "object",
                  "properties": {
                    "proposal_id": {
                      "type": "string",
                      "pattern": "^prp_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
                    },
                    "event_id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,128}$"
                    },
                    "ingested_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "accepted",
                        "rejected",
                        "withdrawn"
                      ]
                    }
                  },
                  "required": [
                    "proposal_id",
                    "event_id",
                    "ingested_at",
                    "status"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "profile_id",
                "source_client_id",
                "event",
                "acknowledgement"
              ],
              "additionalProperties": false
            }
          },
          "unsupported": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
                },
                "reason": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                }
              },
              "required": [
                "category",
                "reason"
              ],
              "additionalProperties": false
            }
          },
          "proof": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "jws"
              },
              "alg": {
                "type": "string",
                "const": "ES256"
              },
              "kid": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
              },
              "jws": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]+\\.\\.[A-Za-z0-9_-]+$"
              }
            },
            "required": [
              "type",
              "alg",
              "kid",
              "jws"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "format",
          "exported_at",
          "origin_host",
          "history_mode",
          "partitions",
          "entries",
          "tombstones",
          "grants_history",
          "receipts",
          "log_events",
          "public_keys",
          "policy_history",
          "proposals",
          "unsupported",
          "proof"
        ],
        "additionalProperties": false,
        "$defs": {
          "__schema0": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema0"
                }
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              }
            ]
          }
        },
        "$id": "urn:autonym:schema:export:1.0:1.0-draft-1"
      },
      "tombstone": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ent_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "profile_id": {
            "type": "string",
            "pattern": "^prf_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          },
          "domain": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.-]{0,63}$"
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "id",
          "version",
          "profile_id",
          "domain",
          "key",
          "deleted_at"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:tombstone:1.0:1.0-draft-1"
      },
      "withdrawal": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "proposal_id": {
            "type": "string",
            "pattern": "^prp_[0-7][0-9A-HJKMNP-TV-Z]{25}(?![\\s\\S])"
          }
        },
        "required": [
          "proposal_id"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:withdrawal:1.0:1.0-draft-1"
      },
      "purge-list": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "instructions": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$"
            }
          }
        },
        "required": [
          "instructions"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:purge-list:1.0:1.0-draft-1"
      },
      "grant-offer-request": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "grant_type": {
            "type": "string",
            "const": "urn:ietf:params:oauth:grant-type:token-exchange"
          },
          "subject_token": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384
          },
          "subject_token_type": {
            "type": "string",
            "const": "urn:ietf:params:oauth:token-type:access_token"
          },
          "requested_token_type": {
            "type": "string",
            "const": "urn:autonym:params:oauth:token-type:grant-offer"
          },
          "scope": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8192
          },
          "resource": {
            "type": "string",
            "format": "uri"
          },
          "autonym_recipient": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          },
          "autonym_purpose_text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "autonym_expires_in": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "autonym_max_reads": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "grant_type",
          "subject_token",
          "subject_token_type",
          "requested_token_type",
          "scope",
          "resource",
          "autonym_recipient",
          "autonym_purpose_text",
          "autonym_expires_in",
          "autonym_max_reads"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:grant-offer-request:1.0:1.0-draft-1"
      },
      "grant-offer": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43,512}$"
          },
          "issued_token_type": {
            "type": "string",
            "const": "urn:autonym:params:oauth:token-type:grant-offer"
          },
          "token_type": {
            "type": "string",
            "const": "N_A"
          },
          "expires_in": {
            "type": "integer",
            "minimum": 1,
            "maximum": 300
          }
        },
        "required": [
          "access_token",
          "issued_token_type",
          "token_type",
          "expires_in"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:grant-offer:1.0:1.0-draft-1"
      },
      "grant-offer-redemption": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "grant_type": {
            "type": "string",
            "const": "urn:autonym:params:oauth:grant-type:grant-offer"
          },
          "grant_code": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43,512}$"
          },
          "resource": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "grant_type",
          "grant_code",
          "resource"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:grant-offer-redemption:1.0:1.0-draft-1"
      },
      "encrypted-export-header": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "alg": {
            "type": "string",
            "const": "dir"
          },
          "enc": {
            "type": "string",
            "const": "A256GCM"
          },
          "typ": {
            "type": "string",
            "const": "autonym-export+jwe"
          },
          "cty": {
            "type": "string",
            "const": "application/autonym-export+json"
          },
          "crit": {
            "type": "array",
            "prefixItems": [
              {
                "type": "string",
                "const": "autonym_kdf"
              }
            ],
            "items": false,
            "minItems": 1,
            "maxItems": 1
          },
          "autonym_kdf": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "const": "argon2id"
              },
              "v": {
                "type": "number",
                "const": 19
              },
              "m": {
                "type": "number",
                "const": 65536
              },
              "t": {
                "type": "number",
                "const": 3
              },
              "p": {
                "type": "number",
                "const": 4
              },
              "salt": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{22}$"
              }
            },
            "required": [
              "name",
              "v",
              "m",
              "t",
              "p",
              "salt"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "alg",
          "enc",
          "typ",
          "cty",
          "crit",
          "autonym_kdf"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:encrypted-export-header:1.0:1.0-draft-1"
      },
      "lifecycle-request": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "grant_type": {
            "type": "string",
            "const": "client_credentials"
          },
          "scope": {
            "type": "string",
            "const": "autonym:lifecycle:purge"
          },
          "resource": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "grant_type",
          "scope",
          "resource"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:lifecycle-request:1.0:1.0-draft-1"
      },
      "key-set": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "keys": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kty": {
                  "type": "string",
                  "const": "EC"
                },
                "crv": {
                  "type": "string",
                  "const": "P-256"
                },
                "x": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
                },
                "y": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
                },
                "kid": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
                },
                "alg": {
                  "type": "string",
                  "const": "ES256"
                },
                "use": {
                  "type": "string",
                  "const": "sig"
                },
                "exp": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 253402300799
                }
              },
              "required": [
                "kty",
                "crv",
                "x",
                "y",
                "kid",
                "alg",
                "use"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "keys"
        ],
        "additionalProperties": false,
        "$id": "urn:autonym:schema:key-set:1.0:1.0-draft-1"
      },
      "problem": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:invalid_scope"
              },
              "title": {
                "type": "string",
                "const": "Invalid scope"
              },
              "status": {
                "type": "number",
                "const": 400
              },
              "code": {
                "type": "string",
                "const": "invalid_scope"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:purpose_missing"
              },
              "title": {
                "type": "string",
                "const": "Purpose is required"
              },
              "status": {
                "type": "number",
                "const": 400
              },
              "code": {
                "type": "string",
                "const": "purpose_missing"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:invalid_request"
              },
              "title": {
                "type": "string",
                "const": "Invalid request"
              },
              "status": {
                "type": "number",
                "const": 400
              },
              "code": {
                "type": "string",
                "const": "invalid_request"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:not_found"
              },
              "title": {
                "type": "string",
                "const": "Not found"
              },
              "status": {
                "type": "number",
                "const": 404
              },
              "code": {
                "type": "string",
                "const": "not_found"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:idempotency_conflict"
              },
              "title": {
                "type": "string",
                "const": "Idempotency key already used"
              },
              "status": {
                "type": "number",
                "const": 409
              },
              "code": {
                "type": "string",
                "const": "idempotency_conflict"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:payload_too_large"
              },
              "title": {
                "type": "string",
                "const": "Request too large"
              },
              "status": {
                "type": "number",
                "const": 413
              },
              "code": {
                "type": "string",
                "const": "payload_too_large"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:rate_limited"
              },
              "title": {
                "type": "string",
                "const": "Try again later"
              },
              "status": {
                "type": "number",
                "const": 429
              },
              "code": {
                "type": "string",
                "const": "rate_limited"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:internal_error"
              },
              "title": {
                "type": "string",
                "const": "Request could not be completed"
              },
              "status": {
                "type": "number",
                "const": 500
              },
              "code": {
                "type": "string",
                "const": "internal_error"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:not_ready"
              },
              "title": {
                "type": "string",
                "const": "Service is not ready"
              },
              "status": {
                "type": "number",
                "const": 503
              },
              "code": {
                "type": "string",
                "const": "not_ready"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:domain_not_granted"
              },
              "title": {
                "type": "string",
                "const": "Domain is not granted"
              },
              "status": {
                "type": "number",
                "const": 403
              },
              "code": {
                "type": "string",
                "const": "domain_not_granted"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:grant_revoked"
              },
              "title": {
                "type": "string",
                "const": "Grant is no longer active"
              },
              "status": {
                "type": "number",
                "const": 403
              },
              "code": {
                "type": "string",
                "const": "grant_revoked"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:grant_expired"
              },
              "title": {
                "type": "string",
                "const": "Grant has expired"
              },
              "status": {
                "type": "number",
                "const": 403
              },
              "code": {
                "type": "string",
                "const": "grant_expired"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:grant_exhausted"
              },
              "title": {
                "type": "string",
                "const": "Grant limit reached"
              },
              "status": {
                "type": "number",
                "const": 403
              },
              "code": {
                "type": "string",
                "const": "grant_exhausted"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:dpop_required"
              },
              "title": {
                "type": "string",
                "const": "Sender proof is required"
              },
              "status": {
                "type": "number",
                "const": 401
              },
              "code": {
                "type": "string",
                "const": "dpop_required"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:dpop_invalid"
              },
              "title": {
                "type": "string",
                "const": "Sender proof is invalid"
              },
              "status": {
                "type": "number",
                "const": 401
              },
              "code": {
                "type": "string",
                "const": "dpop_invalid"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:safety_write_forbidden"
              },
              "title": {
                "type": "string",
                "const": "First-party confirmation is required"
              },
              "status": {
                "type": "number",
                "const": 403
              },
              "code": {
                "type": "string",
                "const": "safety_write_forbidden"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:inference_forbidden"
              },
              "title": {
                "type": "string",
                "const": "Inference is not permitted"
              },
              "status": {
                "type": "number",
                "const": 403
              },
              "code": {
                "type": "string",
                "const": "inference_forbidden"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:proposal_not_found"
              },
              "title": {
                "type": "string",
                "const": "Proposal was not found"
              },
              "status": {
                "type": "number",
                "const": 404
              },
              "code": {
                "type": "string",
                "const": "proposal_not_found"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:proposal_decided"
              },
              "title": {
                "type": "string",
                "const": "Proposal has already been decided"
              },
              "status": {
                "type": "number",
                "const": 409
              },
              "code": {
                "type": "string",
                "const": "proposal_decided"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:value_rejected"
              },
              "title": {
                "type": "string",
                "const": "Value does not match the vocabulary"
              },
              "status": {
                "type": "number",
                "const": 422
              },
              "code": {
                "type": "string",
                "const": "value_rejected"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:capability_not_granted"
              },
              "title": {
                "type": "string",
                "const": "Capability is not granted"
              },
              "status": {
                "type": "number",
                "const": 403
              },
              "code": {
                "type": "string",
                "const": "capability_not_granted"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:advertising_ineligible"
              },
              "title": {
                "type": "string",
                "const": "Advertising permission is unavailable"
              },
              "status": {
                "type": "number",
                "const": 403
              },
              "code": {
                "type": "string",
                "const": "advertising_ineligible"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:client_suspended"
              },
              "title": {
                "type": "string",
                "const": "Client is suspended"
              },
              "status": {
                "type": "number",
                "const": 403
              },
              "code": {
                "type": "string",
                "const": "client_suspended"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:entry_limit_reached"
              },
              "title": {
                "type": "string",
                "const": "Entry limit reached"
              },
              "status": {
                "type": "number",
                "const": 409
              },
              "code": {
                "type": "string",
                "const": "entry_limit_reached"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:session_required"
              },
              "title": {
                "type": "string",
                "const": "Sign-in is required"
              },
              "status": {
                "type": "number",
                "const": 401
              },
              "code": {
                "type": "string",
                "const": "session_required"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:csrf_invalid"
              },
              "title": {
                "type": "string",
                "const": "Request could not be verified"
              },
              "status": {
                "type": "number",
                "const": 403
              },
              "code": {
                "type": "string",
                "const": "csrf_invalid"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:reauthentication_required"
              },
              "title": {
                "type": "string",
                "const": "Recent sign-in is required"
              },
              "status": {
                "type": "number",
                "const": 403
              },
              "code": {
                "type": "string",
                "const": "reauthentication_required"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:signup_unavailable"
              },
              "title": {
                "type": "string",
                "const": "Sign-up is not available"
              },
              "status": {
                "type": "number",
                "const": 403
              },
              "code": {
                "type": "string",
                "const": "signup_unavailable"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "urn:autonym:error:sign_in_failed"
              },
              "title": {
                "type": "string",
                "const": "Sign-in failed"
              },
              "status": {
                "type": "number",
                "const": 400
              },
              "code": {
                "type": "string",
                "const": "sign_in_failed"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "type",
              "title",
              "status",
              "code",
              "request_id"
            ],
            "additionalProperties": false
          }
        ],
        "$id": "urn:autonym:schema:problem:1.0:1.0-draft-1"
      }
    },
    "securitySchemes": {
      "LifecycleOAuth": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://autonym.example/oauth/token",
            "scopes": {
              "autonym:lifecycle:purge": "Only this registered client’s outstanding purge lifecycle"
            }
          }
        }
      },
      "OAuth": {
        "type": "http",
        "scheme": "DPoP",
        "bearerFormat": "JWT"
      },
      "DPoP": {
        "type": "apiKey",
        "in": "header",
        "name": "DPoP"
      }
    }
  }
}
