{
  "openapi": "3.1.0",
  "info": {
    "title": "Handproof API",
    "version": "0.1.0",
    "description": "Generated from Zod schemas. Do not edit by hand — see packages/contracts/src/openapi.ts."
  },
  "servers": [
    {
      "url": "https://api.handproof.me"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key minted by an Admin in Settings, `hp_live_` (or `hp_test_`, for the sandbox) then the key's id and secret. Checked on every call, so a revoked or expired key is refused from its next request."
      }
    },
    "schemas": {
      "WebhookEventPayload": {
        "type": "object",
        "properties": {
          "event_id": {
            "type": "string",
            "pattern": "^evt_[0-9a-z]{26}$",
            "description": "The same for every attempt and every endpoint. Deliveries are at least once: dedupe on it"
          },
          "event_type": {
            "type": "string",
            "enum": [
              "verification_request.created",
              "verification_request.approved",
              "verification_request.declined",
              "verification_request.issue_reported",
              "verification_request.cancelled",
              "verification_request.expired",
              "certificate.issued",
              "data.purged"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the event happened, not when this attempt was made"
          },
          "api_version": {
            "type": "string",
            "enum": [
              "2026-10-22"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "verification_request_id": {
                "type": "string",
                "pattern": "^req_[0-9a-z]{26}$",
                "description": "Verification request identifier"
              },
              "organization_id": {
                "type": "string",
                "pattern": "^org_[0-9a-z]{26}$",
                "description": "Organization identifier"
              }
            },
            "required": [
              "verification_request_id",
              "organization_id"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "event_id",
          "event_type",
          "created_at",
          "api_version",
          "data"
        ],
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "URI identifying the problem type"
          },
          "title": {
            "type": "string",
            "description": "Short, human-readable summary"
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable code, safe to branch on"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "code"
        ]
      },
      "HealthResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "version": {
            "type": "string"
          },
          "time": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          }
        },
        "required": [
          "status",
          "version",
          "time"
        ]
      },
      "NotificationDelivery": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "not_attempted",
              "sent",
              "failed",
              "bounced"
            ],
            "description": "`sent` is the provider accepting it, which is not the same as arrival. `bounced` is the provider telling us afterwards that it did not arrive — the only one of the four that can change after the request was created."
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms"
            ],
            "description": "Absent when nothing was attempted"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the attempt was made"
          },
          "failure_class": {
            "type": "string",
            "maxLength": 64,
            "description": "The provider's category, never its message. Present only on `failed` or `bounced`."
          }
        },
        "required": [
          "state"
        ]
      },
      "RequestSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^req_[0-9a-z]{26}$",
            "description": "Verification request identifier"
          },
          "reference": {
            "type": "string",
            "pattern": "^HP-[A-Z0-9]{4}-[A-Z0-9]{4}$",
            "description": "Human-quotable verification reference, shown on certificates"
          },
          "owner_email": {
            "type": "string",
            "maxLength": 320,
            "format": "email"
          },
          "owner_phone": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{6,14}$"
          },
          "document_types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "passport",
                "permanent_resident_card",
                "driving_licence",
                "national_id",
                "proof_of_address"
              ]
            },
            "minItems": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "pending",
              "in_progress",
              "approved",
              "rejected",
              "declined",
              "expired",
              "issue_reported",
              "not_completed",
              "archived"
            ]
          },
          "data_status": {
            "type": "string",
            "enum": [
              "not_started",
              "capture_started",
              "text_available",
              "in_review",
              "capture_incomplete",
              "nothing_captured",
              "archived"
            ]
          },
          "expiry_date": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          },
          "delivery": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NotificationDelivery"
              },
              {
                "description": "What happened to the link. The collector has to see that one did not arrive, because nobody else will: the person it was sent to cannot report a message they never got."
              }
            ]
          },
          "certificate_reference": {
            "type": "string",
            "pattern": "^HP-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{2}$",
            "description": "The signed record's reference, which `GET /verify` resolves; `reference` is the request's and never will. The latest record where one was rectified. Absent until a record is signed."
          }
        },
        "required": [
          "id",
          "reference",
          "document_types",
          "status",
          "data_status",
          "expiry_date",
          "created_at",
          "delivery"
        ]
      },
      "RequestSearchView": {
        "type": "object",
        "properties": {
          "requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestSummary"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "offset": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "requests",
          "total",
          "limit",
          "offset"
        ]
      },
      "CreateRequestResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^req_[0-9a-z]{26}$",
            "description": "Verification request identifier"
          },
          "reference": {
            "type": "string",
            "pattern": "^HP-[A-Z0-9]{4}-[A-Z0-9]{4}$",
            "description": "Human-quotable verification reference, shown on certificates"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "pending",
              "in_progress",
              "approved",
              "rejected",
              "declined",
              "expired",
              "issue_reported",
              "not_completed",
              "archived"
            ]
          },
          "expiry_date": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          },
          "secure_link": {
            "type": "string",
            "format": "uri",
            "description": "Shown once; only its hash is stored"
          }
        },
        "required": [
          "id",
          "reference",
          "status"
        ]
      },
      "ResendLinkView": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^req_[0-9a-z]{26}$",
            "description": "Verification request identifier"
          },
          "reference": {
            "type": "string",
            "pattern": "^HP-[A-Z0-9]{4}-[A-Z0-9]{4}$",
            "description": "Human-quotable verification reference, shown on certificates"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "pending",
              "in_progress",
              "approved",
              "rejected",
              "declined",
              "expired",
              "issue_reported",
              "not_completed",
              "archived"
            ]
          },
          "expiry_date": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          },
          "secure_link": {
            "type": "string",
            "format": "uri",
            "description": "Shown once; only its hash is stored"
          },
          "delivery": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NotificationDelivery"
              },
              {
                "description": "What happened to the message carrying it. `not_attempted` where the request has no contact or the deployment has no sender — neither is a failed resend, and the link above still works."
              }
            ]
          }
        },
        "required": [
          "id",
          "reference",
          "status",
          "expiry_date",
          "secure_link",
          "delivery"
        ]
      },
      "CancelRequestView": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^req_[0-9a-z]{26}$",
            "description": "Verification request identifier"
          },
          "reference": {
            "type": "string",
            "pattern": "^HP-[A-Z0-9]{4}-[A-Z0-9]{4}$",
            "description": "Human-quotable verification reference, shown on certificates"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "pending",
              "in_progress",
              "approved",
              "rejected",
              "declined",
              "expired",
              "issue_reported",
              "not_completed",
              "archived"
            ]
          },
          "captured_images": {
            "type": "string",
            "enum": [
              "none",
              "deleted",
              "retained"
            ],
            "description": "What happened to the photographs. `none` where the person never got as far as taking one. `deleted` is a crypto-shred performed now rather than at the seven-day ceiling. `retained` means the shred did not complete and the ceiling is still the backstop — reported rather than rounded up to `deleted`, because a deletion claimed and not made is the one answer this field must never give."
          }
        },
        "required": [
          "id",
          "reference",
          "status",
          "captured_images"
        ]
      },
      "CollectorRetentionExtension": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "none"
                ]
              }
            },
            "required": [
              "state"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "awaiting_decision"
                ]
              },
              "asked_at": {
                "type": "string",
                "format": "date-time",
                "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
              },
              "asked_days": {
                "type": "integer",
                "minimum": 1,
                "maximum": 14
              }
            },
            "required": [
              "state",
              "asked_at",
              "asked_days"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "not_granted"
                ]
              }
            },
            "required": [
              "state"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "granted"
                ]
              },
              "extension_until": {
                "type": "string",
                "format": "date-time",
                "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
              }
            },
            "required": [
              "state",
              "extension_until"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "withdrawn"
                ]
              },
              "withdrawn_at": {
                "type": "string",
                "format": "date-time",
                "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
              }
            },
            "required": [
              "state",
              "withdrawn_at"
            ]
          }
        ]
      },
      "VerificationRequestView": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^req_[0-9a-z]{26}$",
            "description": "Verification request identifier"
          },
          "reference": {
            "type": "string",
            "pattern": "^HP-[A-Z0-9]{4}-[A-Z0-9]{4}$",
            "description": "Human-quotable verification reference, shown on certificates"
          },
          "creator_id": {
            "type": "string",
            "pattern": "^usr_[0-9a-z]{26}$",
            "description": "User identifier"
          },
          "organization_id": {
            "type": "string",
            "pattern": "^org_[0-9a-z]{26}$",
            "description": "Organization identifier"
          },
          "owner_email": {
            "type": "string",
            "maxLength": 320,
            "format": "email"
          },
          "owner_phone": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{6,14}$"
          },
          "document_types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "passport",
                "permanent_resident_card",
                "driving_licence",
                "national_id",
                "proof_of_address"
              ]
            },
            "minItems": 1
          },
          "requested_fields": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "surname",
                "given_names",
                "date_of_birth",
                "document_number",
                "expiration_date",
                "nationality",
                "issuing_authority",
                "address"
              ]
            },
            "minItems": 1
          },
          "purpose": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "purpose_category": {
            "type": "string",
            "enum": [
              "tenant_referencing",
              "right_to_rent",
              "employment_or_right_to_work",
              "client_onboarding",
              "witnessing_a_signature",
              "age_check",
              "marketplace_seller_check",
              "something_else"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "pending",
              "in_progress",
              "approved",
              "rejected",
              "declined",
              "expired",
              "issue_reported",
              "not_completed",
              "archived"
            ]
          },
          "expiry_date": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          },
          "retention_extension": {
            "$ref": "#/components/schemas/CollectorRetentionExtension"
          }
        },
        "required": [
          "id",
          "reference",
          "creator_id",
          "organization_id",
          "document_types",
          "requested_fields",
          "purpose",
          "status",
          "expiry_date",
          "created_at"
        ]
      },
      "SignedPartyEvidence": {
        "type": "object",
        "properties": {
          "evidence_package": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "enum": [
                  "handproof-evidence-package/1"
                ]
              },
              "tier": {
                "type": "string",
                "enum": [
                  "party"
                ]
              },
              "reference": {
                "type": "string",
                "pattern": "^HP-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{2}$",
                "description": "Public certificate reference: 60 bits of entropy and a local check block"
              },
              "request_id": {
                "type": "string",
                "pattern": "^req_[0-9a-z]{26}$",
                "description": "Verification request identifier"
              },
              "organization_id": {
                "type": "string",
                "pattern": "^org_[0-9a-z]{26}$",
                "description": "Organization identifier"
              },
              "completed_at": {
                "type": "string",
                "format": "date-time",
                "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
              },
              "parties": {
                "type": "object",
                "properties": {
                  "collector": {
                    "type": "object",
                    "properties": {
                      "organization_name": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "business_identifier": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "registry": {
                            "type": "string",
                            "enum": [
                              "uk_companies_house",
                              "us_state_registration",
                              "us_ein",
                              "other"
                            ]
                          },
                          "identifier": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64
                          },
                          "jurisdiction": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 64
                          }
                        },
                        "required": [
                          "registry",
                          "identifier",
                          "jurisdiction"
                        ],
                        "additionalProperties": false
                      },
                      "requested_by": {
                        "type": "string",
                        "maxLength": 200
                      }
                    },
                    "required": [
                      "organization_name",
                      "business_identifier",
                      "requested_by"
                    ],
                    "additionalProperties": false
                  },
                  "data_giver": {
                    "type": "object",
                    "properties": {
                      "display_name": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "contact_channel": {
                        "type": "string",
                        "enum": [
                          "email",
                          "sms"
                        ]
                      },
                      "contact_hint": {
                        "type": "string",
                        "maxLength": 64
                      }
                    },
                    "required": [
                      "display_name",
                      "contact_channel",
                      "contact_hint"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "collector",
                  "data_giver"
                ],
                "additionalProperties": false
              },
              "purpose": {
                "type": "object",
                "properties": {
                  "category": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "detail": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "category",
                  "detail"
                ],
                "additionalProperties": false
              },
              "retention": {
                "type": "object",
                "properties": {
                  "fields_visible_until": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                  },
                  "image_purge_after": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                  }
                },
                "required": [
                  "fields_visible_until",
                  "image_purge_after"
                ],
                "additionalProperties": false
              },
              "requested_fields": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "surname",
                    "given_names",
                    "date_of_birth",
                    "document_number",
                    "expiration_date",
                    "nationality",
                    "issuing_authority",
                    "address"
                  ]
                }
              },
              "shared_fields": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string",
                      "enum": [
                        "surname",
                        "given_names",
                        "date_of_birth",
                        "document_number",
                        "expiration_date",
                        "nationality",
                        "issuing_authority",
                        "address"
                      ]
                    },
                    "value": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "read_from": {
                      "type": "string",
                      "enum": [
                        "passport",
                        "permanent_resident_card",
                        "driving_licence",
                        "national_id",
                        "proof_of_address"
                      ]
                    },
                    "image_hash": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$",
                      "description": "SHA-256 digest, lowercase hex"
                    },
                    "extraction_source": {
                      "type": "string",
                      "enum": [
                        "visual",
                        "mrz",
                        "visual_ordered_by_mrz",
                        "visual_ordered_by_barcode"
                      ]
                    },
                    "confidence": {
                      "type": "string",
                      "pattern": "^\\d\\.\\d{2}$"
                    },
                    "was_corrected": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "field",
                    "value",
                    "read_from",
                    "image_hash",
                    "extraction_source",
                    "confidence",
                    "was_corrected"
                  ],
                  "additionalProperties": false
                }
              },
              "corrections": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string",
                      "enum": [
                        "surname",
                        "given_names",
                        "date_of_birth",
                        "document_number",
                        "expiration_date",
                        "nationality",
                        "issuing_authority",
                        "address"
                      ]
                    },
                    "ai_value": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "final_value": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "accepted"
                      ]
                    },
                    "decided_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                    },
                    "validator": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "model": {
                          "type": "string"
                        },
                        "prompt_version": {
                          "type": "string"
                        },
                        "confidence": {
                          "type": "string",
                          "pattern": "^\\d\\.\\d{2}$"
                        }
                      },
                      "required": [
                        "model",
                        "prompt_version",
                        "confidence"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "field",
                    "ai_value",
                    "final_value",
                    "verdict",
                    "decided_at",
                    "validator"
                  ],
                  "additionalProperties": false
                }
              },
              "extraction": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "image_hash": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$",
                      "description": "SHA-256 digest, lowercase hex"
                    },
                    "document_type": {
                      "type": "string",
                      "enum": [
                        "passport",
                        "permanent_resident_card",
                        "driving_licence",
                        "national_id",
                        "proof_of_address"
                      ]
                    },
                    "document_type_match": {
                      "type": "boolean"
                    },
                    "model": {
                      "type": "string"
                    },
                    "prompt_version": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9-]*@\\d+\\.\\d+\\.\\d+$"
                    },
                    "cross_check": {
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "string",
                          "enum": [
                            "mrz",
                            "barcode",
                            "none"
                          ]
                        },
                        "outcome": {
                          "type": "string",
                          "enum": [
                            "agreed",
                            "disagreed",
                            "absent",
                            "not_verifiable"
                          ]
                        }
                      },
                      "required": [
                        "source",
                        "outcome"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "image_hash",
                    "document_type",
                    "document_type_match",
                    "model",
                    "prompt_version",
                    "cross_check"
                  ],
                  "additionalProperties": false
                }
              },
              "images": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "document_type": {
                      "type": "string",
                      "enum": [
                        "passport",
                        "permanent_resident_card",
                        "driving_licence",
                        "national_id",
                        "proof_of_address"
                      ]
                    },
                    "sha256": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$",
                      "description": "SHA-256 digest, lowercase hex"
                    },
                    "captured_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                    },
                    "purge_after": {
                      "type": "string",
                      "format": "date-time",
                      "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                    },
                    "purged_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                    }
                  },
                  "required": [
                    "document_type",
                    "sha256",
                    "captured_at",
                    "purge_after",
                    "purged_at"
                  ],
                  "additionalProperties": false
                }
              },
              "consents": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^cns_[0-9a-z]{26}$",
                      "description": "Consent record identifier"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "field_sharing",
                        "image_viewing",
                        "retention_extension",
                        "age_attestation"
                      ]
                    },
                    "granted": {
                      "type": "boolean"
                    },
                    "privacy_notice_version": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "recorded_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                    },
                    "withdrawn_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "granted",
                    "privacy_notice_version",
                    "recorded_at",
                    "withdrawn_at"
                  ],
                  "additionalProperties": false
                }
              },
              "timeline": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "occurred_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                    },
                    "event": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "summary": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "ip": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 64
                    },
                    "device": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 200
                    },
                    "approximate_location": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 200
                    },
                    "timezone": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 64
                    },
                    "privacy_notice_version": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 32
                    }
                  },
                  "required": [
                    "occurred_at",
                    "event",
                    "summary",
                    "ip",
                    "device",
                    "approximate_location",
                    "timezone",
                    "privacy_notice_version"
                  ],
                  "additionalProperties": false
                }
              },
              "fingerprints": {
                "type": "object",
                "properties": {
                  "consent": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "shared_fields": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "timeline": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  }
                },
                "required": [
                  "consent",
                  "shared_fields",
                  "timeline"
                ],
                "additionalProperties": false
              },
              "commitment_key": {
                "type": "string",
                "pattern": "^[0-9a-f]{32}$"
              },
              "withheld": {
                "type": "object",
                "properties": {
                  "source_data_commitment": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "correction_chain_commitment": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "abandoned_correction_count": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "unshared_field_count": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "policy": {
                    "type": "string"
                  }
                },
                "required": [
                  "source_data_commitment",
                  "correction_chain_commitment",
                  "abandoned_correction_count",
                  "unshared_field_count",
                  "policy"
                ],
                "additionalProperties": false
              },
              "supersedes": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "reference": {
                    "type": "string",
                    "pattern": "^HP-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{2}$",
                    "description": "Public certificate reference: 60 bits of entropy and a local check block"
                  },
                  "package_hash": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "fields_changed": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "surname",
                        "given_names",
                        "date_of_birth",
                        "document_number",
                        "expiration_date",
                        "nationality",
                        "issuing_authority",
                        "address"
                      ]
                    },
                    "minItems": 1
                  },
                  "ground": {
                    "type": "string",
                    "enum": [
                      "inaccurate_at_confirmation",
                      "changed_since_confirmation",
                      "incomplete_at_confirmation"
                    ]
                  },
                  "rectified_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                  },
                  "policy": {
                    "type": "string"
                  }
                },
                "required": [
                  "reference",
                  "package_hash",
                  "fields_changed",
                  "ground",
                  "rectified_at",
                  "policy"
                ],
                "additionalProperties": false
              },
              "audit_chain": {
                "type": "object",
                "properties": {
                  "last_event_hash": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "last_sequence": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "last_event_hash",
                  "last_sequence"
                ],
                "additionalProperties": false
              },
              "chain": {
                "type": "object",
                "properties": {
                  "package_sequence": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "previous_package_hash": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "link_scope": {
                    "type": "string"
                  }
                },
                "required": [
                  "package_sequence",
                  "previous_package_hash",
                  "link_scope"
                ],
                "additionalProperties": false
              },
              "verification_guide": {
                "type": "object",
                "properties": {
                  "canonicalisation": {
                    "type": "string"
                  },
                  "signature_algorithm": {
                    "type": "string"
                  },
                  "published_key_set": {
                    "type": "string",
                    "format": "uri"
                  },
                  "package_hash": {
                    "type": "string"
                  },
                  "fingerprints": {
                    "type": "string"
                  }
                },
                "required": [
                  "canonicalisation",
                  "signature_algorithm",
                  "published_key_set",
                  "package_hash",
                  "fingerprints"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "version",
              "tier",
              "reference",
              "request_id",
              "organization_id",
              "completed_at",
              "parties",
              "purpose",
              "retention",
              "requested_fields",
              "shared_fields",
              "corrections",
              "extraction",
              "images",
              "consents",
              "timeline",
              "fingerprints",
              "commitment_key",
              "withheld",
              "supersedes",
              "audit_chain",
              "chain",
              "verification_guide"
            ],
            "additionalProperties": false
          },
          "signature": {
            "type": "object",
            "properties": {
              "algorithm": {
                "type": "string",
                "maxLength": 32,
                "description": "Ed25519 (RFC 8032), raw 64-byte encoding"
              },
              "canonicalisation": {
                "type": "string",
                "maxLength": 32
              },
              "key_id": {
                "type": "string",
                "pattern": "^hp-sig-\\d{4}-\\d{2}$"
              },
              "package_hash": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$",
                "description": "SHA-256 digest, lowercase hex"
              },
              "previous_package_hash": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[0-9a-f]{64}$",
                "description": "SHA-256 digest, lowercase hex"
              },
              "signed_at": {
                "type": "string",
                "format": "date-time",
                "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
              },
              "signature_b64": {
                "type": "string",
                "maxLength": 128,
                "description": "Base64 of the raw 64-byte Ed25519 signature"
              }
            },
            "required": [
              "algorithm",
              "canonicalisation",
              "key_id",
              "package_hash",
              "previous_package_hash",
              "signed_at",
              "signature_b64"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "evidence_package",
          "signature"
        ],
        "additionalProperties": false
      },
      "SignedPublicEvidence": {
        "type": "object",
        "properties": {
          "evidence_package": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "enum": [
                  "handproof-evidence-package/1"
                ]
              },
              "tier": {
                "type": "string",
                "enum": [
                  "public"
                ]
              },
              "reference": {
                "type": "string",
                "pattern": "^HP-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{2}$",
                "description": "Public certificate reference: 60 bits of entropy and a local check block"
              },
              "completed_at": {
                "type": "string",
                "format": "date-time",
                "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
              },
              "party_package_hash": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$",
                "description": "SHA-256 digest, lowercase hex"
              },
              "collector": {
                "type": "object",
                "properties": {
                  "organization_name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "business_identifier": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "registry": {
                        "type": "string",
                        "enum": [
                          "uk_companies_house",
                          "us_state_registration",
                          "us_ein",
                          "other"
                        ]
                      },
                      "identifier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 1,
                        "maxLength": 64
                      },
                      "jurisdiction": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 64
                      }
                    },
                    "required": [
                      "registry",
                      "identifier",
                      "jurisdiction"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "organization_name",
                  "business_identifier"
                ],
                "additionalProperties": false
              },
              "data_giver": {
                "type": "object",
                "properties": {
                  "initials": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "contact_channel": {
                    "type": "string",
                    "enum": [
                      "email",
                      "sms"
                    ]
                  }
                },
                "required": [
                  "initials",
                  "contact_channel"
                ],
                "additionalProperties": false
              },
              "purpose": {
                "type": "object",
                "properties": {
                  "category": {
                    "type": "string",
                    "maxLength": 64
                  }
                },
                "required": [
                  "category"
                ],
                "additionalProperties": false
              },
              "shared_field_commitments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string",
                      "enum": [
                        "surname",
                        "given_names",
                        "date_of_birth",
                        "document_number",
                        "expiration_date",
                        "nationality",
                        "issuing_authority",
                        "address"
                      ]
                    },
                    "read_from": {
                      "type": "string",
                      "enum": [
                        "passport",
                        "permanent_resident_card",
                        "driving_licence",
                        "national_id",
                        "proof_of_address"
                      ]
                    },
                    "was_corrected": {
                      "type": "boolean"
                    },
                    "commitment": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$",
                      "description": "SHA-256 digest, lowercase hex"
                    }
                  },
                  "required": [
                    "field",
                    "read_from",
                    "was_corrected",
                    "commitment"
                  ],
                  "additionalProperties": false
                }
              },
              "extraction": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "image_hash": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$",
                      "description": "SHA-256 digest, lowercase hex"
                    },
                    "document_type": {
                      "type": "string",
                      "enum": [
                        "passport",
                        "permanent_resident_card",
                        "driving_licence",
                        "national_id",
                        "proof_of_address"
                      ]
                    },
                    "document_type_match": {
                      "type": "boolean"
                    },
                    "model": {
                      "type": "string"
                    },
                    "prompt_version": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9-]*@\\d+\\.\\d+\\.\\d+$"
                    },
                    "cross_check": {
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "string",
                          "enum": [
                            "mrz",
                            "barcode",
                            "none"
                          ]
                        },
                        "outcome": {
                          "type": "string",
                          "enum": [
                            "agreed",
                            "disagreed",
                            "absent",
                            "not_verifiable"
                          ]
                        }
                      },
                      "required": [
                        "source",
                        "outcome"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "image_hash",
                    "document_type",
                    "document_type_match",
                    "model",
                    "prompt_version",
                    "cross_check"
                  ],
                  "additionalProperties": false
                }
              },
              "images": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "document_type": {
                      "type": "string",
                      "enum": [
                        "passport",
                        "permanent_resident_card",
                        "driving_licence",
                        "national_id",
                        "proof_of_address"
                      ]
                    },
                    "sha256": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$",
                      "description": "SHA-256 digest, lowercase hex"
                    },
                    "purged_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                    }
                  },
                  "required": [
                    "document_type",
                    "sha256",
                    "purged_at"
                  ],
                  "additionalProperties": false
                }
              },
              "consents": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^cns_[0-9a-z]{26}$",
                      "description": "Consent record identifier"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "field_sharing",
                        "image_viewing",
                        "retention_extension",
                        "age_attestation"
                      ]
                    },
                    "granted": {
                      "type": "boolean"
                    },
                    "privacy_notice_version": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "recorded_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                    },
                    "withdrawn_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "granted",
                    "privacy_notice_version",
                    "recorded_at",
                    "withdrawn_at"
                  ],
                  "additionalProperties": false
                }
              },
              "timeline": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "occurred_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                    },
                    "event": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "summary": {
                      "type": "string",
                      "maxLength": 500
                    }
                  },
                  "required": [
                    "occurred_at",
                    "event",
                    "summary"
                  ],
                  "additionalProperties": false
                }
              },
              "fingerprints": {
                "type": "object",
                "properties": {
                  "consent": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "shared_fields": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "timeline": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  }
                },
                "required": [
                  "consent",
                  "shared_fields",
                  "timeline"
                ],
                "additionalProperties": false
              },
              "withheld": {
                "type": "object",
                "properties": {
                  "source_data_commitment": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "correction_chain_commitment": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "abandoned_correction_count": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "unshared_field_count": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "policy": {
                    "type": "string"
                  }
                },
                "required": [
                  "source_data_commitment",
                  "correction_chain_commitment",
                  "abandoned_correction_count",
                  "unshared_field_count",
                  "policy"
                ],
                "additionalProperties": false
              },
              "supersedes": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "reference": {
                    "type": "string",
                    "pattern": "^HP-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{2}$",
                    "description": "Public certificate reference: 60 bits of entropy and a local check block"
                  },
                  "package_hash": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "fields_changed": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "surname",
                        "given_names",
                        "date_of_birth",
                        "document_number",
                        "expiration_date",
                        "nationality",
                        "issuing_authority",
                        "address"
                      ]
                    },
                    "minItems": 1
                  },
                  "ground": {
                    "type": "string",
                    "enum": [
                      "inaccurate_at_confirmation",
                      "changed_since_confirmation",
                      "incomplete_at_confirmation"
                    ]
                  },
                  "rectified_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                  },
                  "policy": {
                    "type": "string"
                  }
                },
                "required": [
                  "reference",
                  "package_hash",
                  "fields_changed",
                  "ground",
                  "rectified_at",
                  "policy"
                ],
                "additionalProperties": false
              },
              "audit_chain": {
                "type": "object",
                "properties": {
                  "last_event_hash": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  }
                },
                "required": [
                  "last_event_hash"
                ],
                "additionalProperties": false
              },
              "verification_guide": {
                "type": "object",
                "properties": {
                  "canonicalisation": {
                    "type": "string"
                  },
                  "signature_algorithm": {
                    "type": "string"
                  },
                  "published_key_set": {
                    "type": "string",
                    "format": "uri"
                  },
                  "package_hash": {
                    "type": "string"
                  },
                  "fingerprints": {
                    "type": "string"
                  }
                },
                "required": [
                  "canonicalisation",
                  "signature_algorithm",
                  "published_key_set",
                  "package_hash",
                  "fingerprints"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "version",
              "tier",
              "reference",
              "completed_at",
              "party_package_hash",
              "collector",
              "data_giver",
              "purpose",
              "shared_field_commitments",
              "extraction",
              "images",
              "consents",
              "timeline",
              "fingerprints",
              "withheld",
              "supersedes",
              "audit_chain",
              "verification_guide"
            ],
            "additionalProperties": false
          },
          "signature": {
            "type": "object",
            "properties": {
              "algorithm": {
                "type": "string",
                "maxLength": 32,
                "description": "Ed25519 (RFC 8032), raw 64-byte encoding"
              },
              "canonicalisation": {
                "type": "string",
                "maxLength": 32
              },
              "key_id": {
                "type": "string",
                "pattern": "^hp-sig-\\d{4}-\\d{2}$"
              },
              "package_hash": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$",
                "description": "SHA-256 digest, lowercase hex"
              },
              "previous_package_hash": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[0-9a-f]{64}$",
                "description": "SHA-256 digest, lowercase hex"
              },
              "signed_at": {
                "type": "string",
                "format": "date-time",
                "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
              },
              "signature_b64": {
                "type": "string",
                "maxLength": 128,
                "description": "Base64 of the raw 64-byte Ed25519 signature"
              }
            },
            "required": [
              "algorithm",
              "canonicalisation",
              "key_id",
              "package_hash",
              "previous_package_hash",
              "signed_at",
              "signature_b64"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "evidence_package",
          "signature"
        ],
        "additionalProperties": false
      },
      "PublicVerificationResult": {
        "type": "object",
        "properties": {
          "outcome": {
            "type": "string",
            "enum": [
              "valid",
              "superseded",
              "invalid",
              "signed_by_compromised_key",
              "unknown",
              "throttled"
            ]
          },
          "reason": {
            "type": "string",
            "maxLength": 64,
            "description": "Stable machine-readable code, safe to branch on"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^HP-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{2}$",
            "description": "Public certificate reference: 60 bits of entropy and a local check block"
          },
          "checked_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          },
          "cache": {
            "type": "object",
            "properties": {
              "verdict_computed_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
              },
              "max_age_seconds": {
                "type": "integer",
                "minimum": 0
              },
              "cache_control": {
                "type": "string",
                "maxLength": 120
              }
            },
            "required": [
              "verdict_computed_at",
              "max_age_seconds",
              "cache_control"
            ],
            "additionalProperties": false
          },
          "retry_after_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "supersedes": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "reference": {
                "type": "string",
                "pattern": "^HP-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{2}$",
                "description": "Public certificate reference: 60 bits of entropy and a local check block"
              },
              "package_hash": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$",
                "description": "SHA-256 digest, lowercase hex"
              },
              "fields_changed": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "surname",
                    "given_names",
                    "date_of_birth",
                    "document_number",
                    "expiration_date",
                    "nationality",
                    "issuing_authority",
                    "address"
                  ]
                },
                "minItems": 1
              },
              "ground": {
                "type": "string",
                "enum": [
                  "inaccurate_at_confirmation",
                  "changed_since_confirmation",
                  "incomplete_at_confirmation"
                ]
              },
              "rectified_at": {
                "type": "string",
                "format": "date-time",
                "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
              },
              "policy": {
                "type": "string"
              }
            },
            "required": [
              "reference",
              "package_hash",
              "fields_changed",
              "ground",
              "rectified_at",
              "policy"
            ],
            "additionalProperties": false
          },
          "superseded_by": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "reference": {
                "type": "string",
                "pattern": "^HP-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{2}$",
                "description": "Public certificate reference: 60 bits of entropy and a local check block"
              },
              "superseded_at": {
                "type": "string",
                "format": "date-time",
                "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
              }
            },
            "required": [
              "reference",
              "superseded_at"
            ],
            "additionalProperties": false
          },
          "record": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "completed_at": {
                "type": "string",
                "format": "date-time",
                "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
              },
              "collector": {
                "type": "object",
                "properties": {
                  "organization_name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "business_identifier": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "registry": {
                        "type": "string",
                        "enum": [
                          "uk_companies_house",
                          "us_state_registration",
                          "us_ein",
                          "other"
                        ]
                      },
                      "identifier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 1,
                        "maxLength": 64
                      },
                      "jurisdiction": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 64
                      }
                    },
                    "required": [
                      "registry",
                      "identifier",
                      "jurisdiction"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "organization_name",
                  "business_identifier"
                ],
                "additionalProperties": false
              },
              "data_giver": {
                "type": "object",
                "properties": {
                  "initials": {
                    "type": "string",
                    "maxLength": 40
                  }
                },
                "required": [
                  "initials"
                ],
                "additionalProperties": false
              },
              "purpose_category": {
                "type": "string",
                "maxLength": 64
              },
              "fields": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string",
                      "enum": [
                        "surname",
                        "given_names",
                        "date_of_birth",
                        "document_number",
                        "expiration_date",
                        "nationality",
                        "issuing_authority",
                        "address"
                      ]
                    },
                    "disclosure": {
                      "type": "string",
                      "enum": [
                        "clear",
                        "masked",
                        "withheld"
                      ]
                    },
                    "display": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 500
                    },
                    "commitment": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$",
                      "description": "SHA-256 digest, lowercase hex"
                    }
                  },
                  "required": [
                    "field",
                    "disclosure",
                    "display",
                    "commitment"
                  ],
                  "additionalProperties": false
                }
              },
              "images": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "document_type": {
                      "type": "string",
                      "enum": [
                        "passport",
                        "permanent_resident_card",
                        "driving_licence",
                        "national_id",
                        "proof_of_address"
                      ]
                    },
                    "sha256": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$",
                      "description": "SHA-256 digest, lowercase hex"
                    },
                    "purged_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                    }
                  },
                  "required": [
                    "document_type",
                    "sha256",
                    "purged_at"
                  ],
                  "additionalProperties": false
                }
              },
              "timeline": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "occurred_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
                    },
                    "event": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "summary": {
                      "type": "string",
                      "maxLength": 500
                    }
                  },
                  "required": [
                    "occurred_at",
                    "event",
                    "summary"
                  ],
                  "additionalProperties": false
                }
              },
              "fingerprints": {
                "type": "object",
                "properties": {
                  "consent": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "shared_fields": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  },
                  "timeline": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "SHA-256 digest, lowercase hex"
                  }
                },
                "required": [
                  "consent",
                  "shared_fields",
                  "timeline"
                ],
                "additionalProperties": false
              },
              "attests": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "does_not_attest": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "masking_note": {
                "type": "string"
              }
            },
            "required": [
              "completed_at",
              "collector",
              "data_giver",
              "purpose_category",
              "fields",
              "images",
              "timeline",
              "fingerprints",
              "attests",
              "does_not_attest",
              "masking_note"
            ],
            "additionalProperties": false
          },
          "signature": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "algorithm": {
                "type": "string",
                "maxLength": 32
              },
              "key_id": {
                "type": "string",
                "maxLength": 32
              },
              "key_status": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "active",
                  "retired",
                  "compromised",
                  null
                ]
              },
              "signed_at": {
                "type": "string",
                "format": "date-time",
                "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
              },
              "signature_b64": {
                "type": "string",
                "maxLength": 128
              },
              "published_key_set": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "algorithm",
              "key_id",
              "key_status",
              "signed_at",
              "signature_b64",
              "published_key_set"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "outcome",
          "reason",
          "reference",
          "checked_at",
          "cache",
          "retry_after_seconds",
          "supersedes",
          "superseded_by",
          "record",
          "signature"
        ],
        "additionalProperties": false
      },
      "PublicCreateRequestBody": {
        "type": "object",
        "properties": {
          "owner_email": {
            "type": "string",
            "format": "email"
          },
          "owner_phone": {
            "type": "string"
          },
          "document_types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "passport",
                "permanent_resident_card",
                "driving_licence",
                "national_id",
                "proof_of_address"
              ]
            },
            "minItems": 1
          },
          "requested_fields": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "surname",
                "given_names",
                "date_of_birth",
                "document_number",
                "expiration_date",
                "nationality",
                "issuing_authority",
                "address"
              ]
            },
            "minItems": 1
          },
          "purpose": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "purpose_category": {
            "type": "string",
            "enum": [
              "tenant_referencing",
              "right_to_rent",
              "employment_or_right_to_work",
              "client_onboarding",
              "witnessing_a_signature",
              "age_check",
              "marketplace_seller_check",
              "something_else"
            ]
          }
        },
        "required": [
          "document_types",
          "requested_fields",
          "purpose",
          "purpose_category"
        ],
        "additionalProperties": false
      },
      "SharedValuesView": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "pattern": "^req_[0-9a-z]{26}$",
            "description": "Verification request identifier"
          },
          "certificate_reference": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^HP-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{2}$",
            "description": "The signed record's reference. Null in the sandbox, whose records are never signed"
          },
          "test": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Present on a sandbox's request: the values are a specimen, invented, and belong to nobody"
          },
          "completed_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "enum": [
                    "surname",
                    "given_names",
                    "date_of_birth",
                    "document_number",
                    "expiration_date",
                    "nationality",
                    "issuing_authority",
                    "address"
                  ]
                },
                "value": {
                  "type": "string",
                  "maxLength": 500
                },
                "read_from": {
                  "type": "string",
                  "enum": [
                    "passport",
                    "permanent_resident_card",
                    "driving_licence",
                    "national_id",
                    "proof_of_address"
                  ]
                },
                "was_corrected": {
                  "type": "boolean"
                }
              },
              "required": [
                "field",
                "value",
                "read_from",
                "was_corrected"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "request_id",
          "certificate_reference",
          "completed_at",
          "fields"
        ],
        "additionalProperties": false
      },
      "PublicOrganizationView": {
        "type": "object",
        "properties": {
          "organization_id": {
            "type": "string",
            "pattern": "^org_[0-9a-z]{26}$",
            "description": "Organization identifier"
          },
          "organization_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "verification_status": {
            "type": "string",
            "enum": [
              "pending",
              "verified",
              "rejected",
              "suspended"
            ]
          },
          "can_send_requests": {
            "type": "boolean",
            "description": "False until the organisation is approved, and while it is suspended"
          }
        },
        "required": [
          "organization_id",
          "organization_name",
          "verification_status",
          "can_send_requests"
        ],
        "additionalProperties": false
      },
      "PlanTerms": {
        "type": "object",
        "properties": {
          "price": {
            "type": "string"
          },
          "included": {
            "type": "string"
          },
          "overage": {
            "type": "string"
          },
          "cadence": {
            "type": "string"
          }
        },
        "required": [
          "price",
          "included",
          "overage",
          "cadence"
        ],
        "description": "Doc 22 §5's own wording, shown before the first charge"
      },
      "BillingAccountView": {
        "type": "object",
        "properties": {
          "organization_id": {
            "type": "string",
            "pattern": "^org_[0-9a-z]{26}$",
            "description": "Organization identifier"
          },
          "plan_id": {
            "type": "string",
            "enum": [
              "free",
              "payg",
              "starter"
            ]
          },
          "period": {
            "type": "string",
            "enum": [
              "lifetime",
              "monthly",
              "metered"
            ]
          },
          "included": {
            "type": "integer",
            "minimum": 0
          },
          "used": {
            "type": "integer",
            "minimum": 0,
            "description": "Verifications completed, counted over the window this plan's own period names: the whole account for a lifetime allowance, the current month for a monthly one"
          },
          "reserved": {
            "type": "integer",
            "minimum": 0,
            "description": "Credits claimed by requests not yet settled"
          },
          "remaining": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Null on a metered plan, which has no allowance to count down"
          },
          "low_balance": {
            "type": "boolean",
            "description": "Whether this allowance is near enough its end to warn about. Always false where the allowance cannot block creation"
          },
          "payment_method_state": {
            "type": "string",
            "enum": [
              "absent",
              "authorizing",
              "authorized",
              "failed"
            ],
            "description": "`failed` is a card the provider declined on its own page (#141)"
          },
          "billing_allows_creation": {
            "type": "boolean",
            "description": "The billing half of the create gate; standing is the other half (C2)"
          },
          "blocked_reason": {
            "type": "string",
            "enum": [
              "free_tier_exhausted",
              "plan_allowance_exhausted",
              "payment_required",
              "billing_restricted"
            ]
          },
          "billing_standing": {
            "type": "string",
            "enum": [
              "good",
              "past_due",
              "restricted"
            ]
          },
          "grace_ends_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the grace period a failed payment opened ends, or null in good standing"
          },
          "terms": {
            "$ref": "#/components/schemas/PlanTerms"
          }
        },
        "required": [
          "organization_id",
          "plan_id",
          "period",
          "included",
          "used",
          "reserved",
          "remaining",
          "low_balance",
          "payment_method_state",
          "billing_allows_creation",
          "billing_standing",
          "grace_ends_at",
          "terms"
        ]
      },
      "WebhookEndpointBody": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048,
            "description": "HTTPS, the standard port, a host name rather than an address, and no credentials"
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "WebhookEndpointView": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^whe_[0-9a-z]{26}$",
            "description": "Webhook endpoint identifier"
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "verified"
            ]
          },
          "last_failure": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "scheme_not_https",
              "port_not_standard",
              "credentials_in_url",
              "host_not_a_name_or_address",
              "timed_out",
              "connection_failed",
              "rejected_by_endpoint",
              "redirect_not_followed",
              "address_changed_since_registration",
              "address_not_public",
              "address_form_not_understood",
              "egress_unavailable",
              null
            ]
          },
          "secret_version": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          }
        },
        "required": [
          "id",
          "url",
          "status",
          "last_failure",
          "secret_version",
          "created_at",
          "verified_at"
        ],
        "additionalProperties": false
      },
      "WebhookEndpointList": {
        "type": "object",
        "properties": {
          "endpoints": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEndpointView"
            }
          },
          "maximum": {
            "type": "integer",
            "minimum": 1,
            "description": "How many endpoints an organisation may register"
          }
        },
        "required": [
          "endpoints",
          "maximum"
        ],
        "additionalProperties": false
      },
      "WebhookEndpointWithSecret": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WebhookEndpointView"
          },
          {
            "type": "object",
            "properties": {
              "secret": {
                "type": "string",
                "pattern": "^whsec_hp_[a-z2-7]{52}$",
                "description": "The signing secret, in this response and nowhere else. It is derived, not stored; rotate to get a new one"
              }
            },
            "required": [
              "secret"
            ],
            "additionalProperties": false
          }
        ]
      },
      "WebhookDeliveryView": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^whd_[0-9a-z]{26}$",
            "description": "Webhook delivery identifier"
          },
          "event_id": {
            "type": "string",
            "pattern": "^evt_[0-9a-z]{26}$",
            "description": "Audit event identifier"
          },
          "event_type": {
            "type": "string",
            "enum": [
              "verification_request.created",
              "verification_request.approved",
              "verification_request.declined",
              "verification_request.issue_reported",
              "verification_request.cancelled",
              "verification_request.expired",
              "certificate.issued",
              "data.purged"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivered",
              "failed"
            ],
            "description": "`pending` is waiting for its next attempt; `failed` will not be tried again unless it is redelivered"
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "last_status": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The HTTP status the endpoint last answered with. No response body is ever kept"
          },
          "last_failure": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "scheme_not_https",
              "port_not_standard",
              "credentials_in_url",
              "host_not_a_name_or_address",
              "timed_out",
              "connection_failed",
              "rejected_by_endpoint",
              "redirect_not_followed",
              "address_changed_since_registration",
              "address_not_public",
              "address_form_not_understood",
              "egress_unavailable",
              null
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          },
          "last_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          },
          "next_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          }
        },
        "required": [
          "id",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "last_status",
          "last_failure",
          "created_at",
          "last_attempt_at",
          "next_attempt_at",
          "delivered_at"
        ],
        "additionalProperties": false
      },
      "WebhookDeliveryList": {
        "type": "object",
        "properties": {
          "deliveries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryView"
            },
            "description": "The most recent fifty, newest first"
          }
        },
        "required": [
          "deliveries"
        ],
        "additionalProperties": false
      },
      "SandboxMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms"
            ]
          },
          "recipient": {
            "type": "string",
            "minLength": 1
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 UTC instant, e.g. 2026-10-12T14:32:11Z"
          }
        },
        "required": [
          "id",
          "channel",
          "recipient",
          "subject",
          "body",
          "created_at"
        ],
        "additionalProperties": false
      },
      "SandboxMessageList": {
        "type": "object",
        "properties": {
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SandboxMessage"
            },
            "description": "The most recent fifty, newest first"
          }
        },
        "required": [
          "messages"
        ],
        "additionalProperties": false
      },
      "SimulationBody": {
        "type": "object",
        "properties": {
          "scenario": {
            "type": "string",
            "enum": [
              "approved",
              "declined",
              "issue_reported",
              "expired"
            ]
          }
        },
        "required": [
          "scenario"
        ],
        "additionalProperties": false
      },
      "SimulationView": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "pattern": "^req_[0-9a-z]{26}$",
            "description": "Verification request identifier"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "pending",
              "in_progress",
              "approved",
              "rejected",
              "declined",
              "expired",
              "issue_reported",
              "not_completed",
              "archived"
            ]
          }
        },
        "required": [
          "request_id",
          "status"
        ],
        "additionalProperties": false
      }
    },
    "parameters": {}
  },
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Liveness probe",
        "responses": {
          "200": {
            "description": "Service is up",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/verify": {
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Check a verification record against Handproof's published public key",
        "description": "Unauthenticated and world-readable by reference. Every answer has the same shape — a known record, an unknown reference and a mistyped one differ only in values — so the response is not an existence oracle (docs/29 S6). The record view is minimised: initials rather than a name, a purpose category rather than free text, no nationality, no IP or device, and BR-06's four fields masked. A verdict is memoised server-side for a short window; a known record's response is never cached at the edge, while a not-found answer is (docs/31 E-06, docs/29 S8).",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The certificate reference, e.g. HP-1CR5-AYMZ-RKMG-FM. Anything else — malformed or absent — is answered as an unknown reference rather than refused."
            },
            "required": false,
            "description": "The certificate reference, e.g. HP-1CR5-AYMZ-RKMG-FM. Anything else — malformed or absent — is answered as an unknown reference rather than refused.",
            "name": "id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "The verdict, whatever it is — including unknown and invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicVerificationResult"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Same body, with outcome `throttled` and a retry-after.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicVerificationResult"
                }
              }
            }
          }
        }
      }
    },
    "/verify/{reference}/evidence-package": {
      "get": {
        "tags": [
          "public"
        ],
        "summary": "Download the public evidence package for a record",
        "description": "The redacted tier: hashes, the timeline, the parties, per-field commitments and its own signature. It carries no field value, so this download cannot become a disclosure, and independent verification works entirely on what is here.",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "reference",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The signed public package, in its RFC 8785 canonical form",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignedPublicEvidence"
                }
              }
            }
          },
          "404": {
            "description": "No record with that reference, or the reference failed its own check block",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/verification-requests": {
      "get": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "List the organisation's verification requests, newest first",
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "description": "Up to 100; 25 where absent"
            },
            "required": false,
            "description": "Up to 100; 25 where absent",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0,
              "description": "How many to skip; 0 where absent"
            },
            "required": false,
            "description": "How many to skip; 0 where absent",
            "name": "offset",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestSearchView"
                }
              }
            }
          },
          "400": {
            "description": "A limit or offset that is not a number in range",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Create a verification request",
        "description": "Sends the request to the person at once and answers with the secure link, once. Refused unless the organisation is verified, not suspended and has quota or a payment method, exactly as from the dashboard. A retry with the same `Idempotency-Key` answers the first creation rather than charging twice.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "description": "Required: a retry must not double-charge"
            },
            "required": true,
            "description": "Required: a retry must not double-charge",
            "name": "idempotency-key",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCreateRequestBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateRequestResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body does not match the schema, or the idempotency key is missing",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "402": {
            "description": "`payment_required` or `billing_restricted`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited; or `key_monthly_cap_reached`, the key's own monthly cap; or `organization_daily_api_limit_reached`, the organisation's keys together past 1,000 requests today. Each carries `Retry-After`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/verification-requests/{id}/data": {
      "get": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Read the values the person confirmed and shared",
        "description": "From the signed record, so only for a verification that completed; the evidence package carries the same values with their signature. Values come only from what the person confirmed and are never editable.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^req_[0-9a-z]{26}$",
              "description": "Verification request identifier"
            },
            "required": true,
            "description": "Verification request identifier",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The shared values",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedValuesView"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "No such request in this organisation, or it has not completed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organization": {
      "get": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "The key's organisation and whether it can send requests",
        "responses": {
          "200": {
            "description": "The organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicOrganizationView"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "The organisation has no row yet",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/verification-requests/{id}": {
      "get": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Read one verification request",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^req_[0-9a-z]{26}$",
              "description": "Verification request identifier"
            },
            "required": true,
            "description": "Verification request identifier",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationRequestView"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "No such verification request in this organisation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/verification-requests/{id}/resend": {
      "post": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Send the person a new link",
        "description": "The previous link stops working. The new link goes to the contact the request already carries.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^req_[0-9a-z]{26}$",
              "description": "Verification request identifier"
            },
            "required": true,
            "description": "Verification request identifier",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResendLinkView"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "No such verification request in this organisation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "The request is not one a link can be resent for",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/verification-requests/{id}/cancel": {
      "post": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Cancel a request the person has not completed",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^req_[0-9a-z]{26}$",
              "description": "Verification request identifier"
            },
            "required": true,
            "description": "Verification request identifier",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelRequestView"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "No such verification request in this organisation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "The request has already ended",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/verification-requests/{id}/certificate": {
      "get": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Download the certificate for a completed verification",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^req_[0-9a-z]{26}$",
              "description": "Verification request identifier"
            },
            "required": true,
            "description": "Verification request identifier",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The certificate, identical for both parties",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "The signed certificate"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "No such request in this organisation, or it has not completed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "`sandbox_record_unsigned`: a test key's request has no signed record, by design",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/verification-requests/{id}/evidence-package": {
      "get": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Download the signed evidence package for a completed verification",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^req_[0-9a-z]{26}$",
              "description": "Verification request identifier"
            },
            "required": true,
            "description": "Verification request identifier",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The signed package, in its RFC 8785 canonical form",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignedPartyEvidence"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "No such request in this organisation, or it has not completed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "`sandbox_record_unsigned`: a test key's request has no signed record, by design",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/usage": {
      "get": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "The organisation's plan and how much of it is used",
        "description": "The same account the dashboard's billing screen reads (story I3b, `docs/26` §2.5). Read-only.",
        "responses": {
          "200": {
            "description": "The plan and its usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingAccountView"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhook-endpoints": {
      "get": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "This organisation's webhook endpoints, newest first",
        "responses": {
          "200": {
            "description": "The endpoints",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointList"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Register an endpoint and prove it is yours",
        "description": "Refused outright for a URL that is not HTTPS on the standard port, carries credentials, or names an address rather than a host. Otherwise recorded as `pending` and sent a signed `endpoint.test` at once; a 2xx within ten seconds marks it `verified`. The signing secret is in this response and nowhere else. From the dashboard this needs a sign-in from the last few minutes.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Registered, with its secret, once",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                }
              }
            }
          },
          "400": {
            "description": "A body that does not match the schema",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Five endpoints are already registered",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "`webhook_url_refused`: the URL is not one Handproof will send to",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "`webhooks_unconfigured`: this deployment cannot sign or send webhooks",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhook-endpoints/{id}/verification": {
      "post": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Send the signed test delivery again",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^whe_[0-9a-z]{26}$",
              "description": "Webhook endpoint identifier"
            },
            "required": true,
            "description": "Webhook endpoint identifier",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The endpoint after the attempt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointView"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "No such endpoint in this organisation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "`webhooks_unconfigured`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhook-endpoints/{id}/secret-rotation": {
      "post": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Replace the signing secret, at once",
        "description": "The new secret signs every delivery from now on and the old one validates nothing, so a receiver must be given the new secret before it can accept another delivery.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^whe_[0-9a-z]{26}$",
              "description": "Webhook endpoint identifier"
            },
            "required": true,
            "description": "Webhook endpoint identifier",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The endpoint with its new secret, once",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "No such endpoint in this organisation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "`webhooks_unconfigured`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhook-endpoints/{id}/removal": {
      "post": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Stop sending to an endpoint",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^whe_[0-9a-z]{26}$",
              "description": "Webhook endpoint identifier"
            },
            "required": true,
            "description": "Webhook endpoint identifier",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The endpoints that remain",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointList"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "No such endpoint in this organisation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhook-endpoints/{id}/deliveries": {
      "get": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "What was sent to an endpoint, and how it answered",
        "description": "The status code the endpoint answered with and why an attempt failed, never a response body. Kept for thirty days.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^whe_[0-9a-z]{26}$",
              "description": "Webhook endpoint identifier"
            },
            "required": true,
            "description": "Webhook endpoint identifier",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The deliveries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryList"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "No such endpoint in this organisation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhook-endpoints/{id}/deliveries/{deliveryId}/redelivery": {
      "post": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Send a failed delivery again, once",
        "description": "One attempt, made now, with a fresh signature over the same body. The delivery stays `failed` if this attempt fails too.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^whe_[0-9a-z]{26}$",
              "description": "Webhook endpoint identifier"
            },
            "required": true,
            "description": "Webhook endpoint identifier",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^whd_[0-9a-z]{26}$",
              "description": "Webhook delivery identifier"
            },
            "required": true,
            "description": "Webhook delivery identifier",
            "name": "deliveryId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery after the attempt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryView"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "No such endpoint or delivery in this organisation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "`webhook_delivery_not_failed`: only a failed delivery can be sent again",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "`webhooks_unconfigured`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/test/messages": {
      "get": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "What the sandbox held instead of sending",
        "description": "For a `hp_test_` key only. A test request's notification is never emailed or texted: it is held here instead, without its link — a sandbox's links cannot be opened, so no capture can begin in test mode.",
        "responses": {
          "200": {
            "description": "The held messages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxMessageList"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "A live key: this path exists only for a test key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/test/verification-requests/{id}/simulate": {
      "post": {
        "tags": [
          "public"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "End a sandbox request as a person's answer would",
        "description": "For a `hp_test_` key only. `approved` makes the request's data readable as an invented specimen, marked `test`; no record is ever signed, so `/verify` never accepts a sandbox's reference. Each outcome writes the event the real one writes, so a registered endpoint is sent the same webhook.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^req_[0-9a-z]{26}$",
              "description": "Verification request identifier"
            },
            "required": true,
            "description": "Verification request identifier",
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimulationBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The request, ended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulationView"
                }
              }
            }
          },
          "400": {
            "description": "A body that does not match the schema",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_invalid`: a key that is malformed, unknown, revoked or expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks this endpoint's bundle; `api_key_owner_changed`: the Admin who created it is no longer an Admin here",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "A live key, or no such request in this sandbox",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "`simulation_not_possible`: the request has already ended",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "verification_request.created": {
      "post": {
        "tags": [
          "public"
        ],
        "summary": "A request was sent to the person",
        "description": "Signed with the endpoint's secret: `Handproof-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<body>\">`, re-signed on every attempt. Retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours until a 2xx arrives within ten seconds.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEventPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx acknowledges the delivery. Anything else, or no answer, is retried"
          }
        }
      }
    },
    "verification_request.approved": {
      "post": {
        "tags": [
          "public"
        ],
        "summary": "The person confirmed and shared what was asked",
        "description": "Signed with the endpoint's secret: `Handproof-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<body>\">`, re-signed on every attempt. Retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours until a 2xx arrives within ten seconds.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEventPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx acknowledges the delivery. Anything else, or no answer, is retried"
          }
        }
      }
    },
    "verification_request.declined": {
      "post": {
        "tags": [
          "public"
        ],
        "summary": "The person declined to share",
        "description": "Signed with the endpoint's secret: `Handproof-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<body>\">`, re-signed on every attempt. Retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours until a 2xx arrives within ten seconds.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEventPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx acknowledges the delivery. Anything else, or no answer, is retried"
          }
        }
      }
    },
    "verification_request.issue_reported": {
      "post": {
        "tags": [
          "public"
        ],
        "summary": "The person shared nothing and reported an issue",
        "description": "Signed with the endpoint's secret: `Handproof-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<body>\">`, re-signed on every attempt. Retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours until a 2xx arrives within ten seconds.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEventPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx acknowledges the delivery. Anything else, or no answer, is retried"
          }
        }
      }
    },
    "verification_request.cancelled": {
      "post": {
        "tags": [
          "public"
        ],
        "summary": "The request was cancelled",
        "description": "Signed with the endpoint's secret: `Handproof-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<body>\">`, re-signed on every attempt. Retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours until a 2xx arrives within ten seconds.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEventPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx acknowledges the delivery. Anything else, or no answer, is retried"
          }
        }
      }
    },
    "verification_request.expired": {
      "post": {
        "tags": [
          "public"
        ],
        "summary": "The link expired unopened",
        "description": "Signed with the endpoint's secret: `Handproof-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<body>\">`, re-signed on every attempt. Retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours until a 2xx arrives within ten seconds.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEventPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx acknowledges the delivery. Anything else, or no answer, is retried"
          }
        }
      }
    },
    "certificate.issued": {
      "post": {
        "tags": [
          "public"
        ],
        "summary": "The cryptographically signed verification record is ready",
        "description": "Signed with the endpoint's secret: `Handproof-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<body>\">`, re-signed on every attempt. Retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours until a 2xx arrives within ten seconds.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEventPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx acknowledges the delivery. Anything else, or no answer, is retried"
          }
        }
      }
    },
    "data.purged": {
      "post": {
        "tags": [
          "public"
        ],
        "summary": "The extracted fields were deleted. Discard anything cached from them",
        "description": "Signed with the endpoint's secret: `Handproof-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<body>\">`, re-signed on every attempt. Retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours until a 2xx arrives within ten seconds.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEventPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx acknowledges the delivery. Anything else, or no answer, is retried"
          }
        }
      }
    }
  }
}
