{
  "openapi": "3.1.0",
  "info": {
    "title": "eSign API",
    "version": "1.7.0",
    "summary": "Hosted e-signature service for server-side applications.",
    "description": "Server-to-server API for preparing plain-text or template documents, collecting one or more required signatures through hosted signing pages, and retrieving verifiable evidence.\n\n**Read first:** the integration requirements, `docs/api/INTEGRATION_REQUIREMENTS.md` in the service repository.\n\n## Authentication and tenancy\nEvery call sends `Authorization: Bearer <app key>` and `X-Tenant-ID: <tenant uuid>`. Keys are issued per app and environment, scoped (see `x-required-scopes` on each operation) and expire. Keys are server-side secrets: never send them to a browser or mobile client.\n\n## Idempotency\nEvery POST requires `Idempotency-Key` (1-128 characters). Save the key in your own database **before** sending. Retrying with the same key and the same body returns the original result; the same key with a different body returns 409. After a timeout or 5xx, recover with the matching GET (most take the original key in an `X-Original-*-Key` header) or retry with the same key. Never invent a new key to retry an operation whose outcome is unknown.\n\n## Concurrency\nCancel and withdraw require `If-Match: \"<resource_version>\"` from the latest read (428 without it, 412 when stale: re-read and decide again). Requests also return the version as `ETag`; envelopes return it only in the body as `resource_version`.\n\n## Errors\nErrors use the `Error` schema: `code` (`http_<status>`, `invalid_request` or `service_unavailable`), a human-readable `message` that may change, and `request_id` (also in `X-Request-ID`). Branch on the HTTP status, not on `message`. 409 means the resource is not in a state that allows the action yet or any more (for example a signing link is requested before the document has finished preparing): re-read, and retry only if the state can still change. 429 and 503 carry `Retry-After`.\n\n## Limits\n- Signing-link issuance: 5 per signing request in any rolling hour (the 6th returns 429). A request has one signer.\n- Active preparations: 100 unexpired document preparations and 100 unexpired envelope preparations per app and tenant; a preparation expires 10 minutes after it is created.\n- Signing links live 72 hours and never beyond the request.\n- Requests and envelopes: `expires_in` 60 s to 30 days.\n- Page size: `limit` 1-100 on `/requests` and `/events`.\n- Request bodies: at most 1 MiB (413); 2 MiB for text and envelope preparations. JSON bodies must be sent as `application/json` (415).\n- Plain-text documents: title up to 200 characters; the whole document (title, two newlines, body) up to 200,000 UTF-8 bytes (413 above that: send a PDF).\n\n## Versioning\nPaths under `/api/v1` change only additively: new operations, new optional request fields, new response fields and new event types. Clients must ignore unknown response fields and event types. Removing or changing the meaning of anything requires `/api/v2`; v1 then stays available for at least 6 months after v2 is published, and the change is announced in the service changelog. The `info.version` of this document follows semantic versioning for the documentation itself.\n\n## Webhooks\nOptional, configured by the service operator per app and tenant (a destination URL and a signing key). See `webhooks.signingEvent`. The event feed (`GET /api/v1/events`) carries the same events and is always available.\n\n## Notices and compatibility\nWhen something changes that affects your app, the service publishes a notice. While your app has an unacknowledged notice, every successful API response carries `eDocInk-Notices: <count>; latest=\"<id>\"`. `GET /api/v1/notices` lists the notices that apply to your app, `POST /api/v1/notices/{notice_id}/acknowledge` records that you have dealt with one, and `GET /api/v1/compatibility` says whether your SDK is current. SDK 0.32 and later send `User-Agent: edocink-sdk/<version>`, so notices about older SDKs stop applying once you upgrade. While an operation you call, or the SDK version you report, is being retired, responses also carry `Deprecation` (RFC 9745, the date it was announced), `Sunset` (RFC 8594, the date it stops working) and `Link` to the changelog, until that date. Acknowledging the notice does not remove them."
  },
  "servers": [
    {
      "url": "https://esign-sandbox.runmast.com",
      "description": "Sandbox"
    },
    {
      "url": "https://esign.runmast.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "AppKey": []
    }
  ],
  "paths": {
    "/api/v1/requests": {
      "post": {
        "operationId": "createRequest",
        "summary": "Freeze a request and queue original preparation",
        "x-required-scopes": [
          "requests:create"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "202": {
            "description": "New request accepted, or same-key replay returning the existing current resource, possibly already terminal. No additional render job is queued on replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigningRequest"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted resource_version."
              },
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Request resource URI."
              },
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "Request body larger than 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRequest"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listRequests",
        "summary": "Rebuild scope-local state using a paginated scan and replay watermark",
        "x-required-scopes": [
          "requests:read"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque scope-bound pagination token including a fixed scan-start event watermark."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            },
            "description": "Fixed for a reconciliation scan; changing it with a scan cursor is invalid."
          }
        ],
        "responses": {
          "200": {
            "description": "Request page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestPage"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "410": {
            "description": "Scan token expired, recovery epoch changed, or watermark outside history; restart reconciliation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/requests/{request_id}": {
      "get": {
        "operationId": "getRequest",
        "summary": "Read current request state",
        "x-required-scopes": [
          "requests:read"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigningRequest"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted resource_version."
              },
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/requests/{request_id}/invitations": {
      "post": {
        "operationId": "sendInvitation",
        "summary": "Issue invitation idempotently; delivery channel configured by service, ACK is not email delivery",
        "x-required-scopes": [
          "invitations:create"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invitation"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "Request body larger than 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "maxProperties": 0
              }
            }
          }
        }
      },
      "get": {
        "operationId": "observeInvitation",
        "summary": "Read-only snapshot of original invitation queue receipt; absence is inconclusive",
        "x-required-scopes": [
          "requests:read"
        ],
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Original-Invite-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            },
            "description": "Exact original invitation key for correlation only, never authorization or a query parameter."
          }
        ],
        "responses": {
          "200": {
            "description": "Original queued ACK or inconclusive absence; no provider delivery status or resend authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationObservation"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "410": {
            "description": "Scan token expired, recovery epoch changed, or watermark outside history; restart reconciliation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/requests/{request_id}/cancel": {
      "post": {
        "operationId": "cancelRequest",
        "summary": "Cancel an unsigned request",
        "x-required-scopes": [
          "requests:cancel"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$",
              "description": "Quoted resource_version, e.g. \"3\"."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigningRequest"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Quoted resulting resource_version.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[1-9][0-9]*\"$"
                }
              },
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "412": {
            "description": "Version mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "Request body larger than 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "428": {
            "description": "If-Match required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/requests/{request_id}/evidence": {
      "get": {
        "operationId": "getEvidence",
        "summary": "Retrieve completed evidence; 409 while unavailable",
        "x-required-scopes": [
          "evidence:read"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Evidence"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/requests/{request_id}/evidence/timestamp": {
      "get": {
        "operationId": "getEvidenceTimestamp",
        "summary": "Retrieve the independent RFC 3161 timestamp over the evidence; 409 until one exists",
        "x-required-scopes": [
          "evidence:read"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceTimestamp"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "description": "An outside Time Stamp Authority signs the SHA-256 of the exact evidence bytes returned by `getEvidence`, proving those bytes existed no later than `gen_time`. It is obtained after completion and never delays it: expect 409 for a short time after evidence is ready, or longer if the authority is unavailable. Only the hash is sent to the authority. Verify `response` (base64 DER TimeStampResp) against the evidence bytes and the authority's root certificate, pinned in your configuration (never taken from the response): for example base64-decode `response` to `timestamp.tsr` and run `openssl ts -verify -data evidence.json -in timestamp.tsr -CAfile tsa-root.pem`."
      }
    },
    "/api/v1/events": {
      "get": {
        "operationId": "listEvents",
        "summary": "Recover events in committed stream order",
        "x-required-scopes": [
          "events:read"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Opaque authenticated scope-bound cursor; omit for retained stream start."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            },
            "description": "Maximum events in this page."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventPage"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "410": {
            "description": "Cursor recovery epoch changed or position outside event history; reconcile from requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/document-preparations": {
      "post": {
        "operationId": "prepareDocument",
        "summary": "Prepare exact template text and full immutable intent without creating or inviting",
        "x-required-scopes": [
          "documents:prepare"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Immutable ten-minute snapshot, or identical original prepare-key replay, possibly expired. Active limit 100 per app/tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentPreparation"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "Request body larger than 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/document-preparations/{preparation_id}/requests": {
      "post": {
        "operationId": "createPreparedRequest",
        "summary": "Atomically create one request from a previously reviewed preparation",
        "x-required-scopes": [
          "requests:create"
        ],
        "parameters": [
          {
            "name": "preparation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Single request created from exact prepared intent; original-key replay recovers committed request even after preparation expiry. Another key conflicts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigningRequest"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted resource_version."
              },
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Request resource URI."
              },
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "Request body larger than 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        }
      },
      "get": {
        "operationId": "observePreparedRequest",
        "summary": "Read-only snapshot lookup of original prepared-create binding; absence is inconclusive",
        "x-required-scopes": [
          "requests:read"
        ],
        "parameters": [
          {
            "name": "preparation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Original-Create-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            },
            "description": "Exact original create key for correlation only, not authorization. Never regenerated or placed in query parameters."
          }
        ],
        "responses": {
          "200": {
            "description": "Bound current resource or no binding visible in this statement snapshot. Neither renews authority nor permits resend.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreparedRequestObservation"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "410": {
            "description": "Scan token expired, recovery epoch changed, or watermark outside history; restart reconciliation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/text-document-preparations": {
      "post": {
        "operationId": "prepareTextDocument",
        "summary": "Prepare first-class plain text under explicit tenant policy",
        "x-required-scopes": [
          "documents:prepare",
          "documents:submit"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Immutable ten-minute snapshot, or identical original prepare-key replay, possibly expired. Active limit 100 per app/tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentPreparation"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "Request body larger than 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlainTextSubmission"
              }
            }
          }
        }
      }
    },
    "/api/v1/signing-envelopes": {
      "post": {
        "operationId": "createSigningEnvelope",
        "summary": "Freeze N required ready unsigned requests into an immutable signing envelope; never invites",
        "x-required-scopes": [
          "requests:create"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Immutable N-required-signer envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigningEnvelope"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "Request body larger than 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnvelopeCreate"
              }
            }
          }
        }
      }
    },
    "/api/v1/signing-envelopes/{envelope_id}": {
      "get": {
        "operationId": "getSigningEnvelope",
        "summary": "Read immutable roster and aggregate all-required signing/completion status",
        "x-required-scopes": [
          "requests:read"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "envelope_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigningEnvelope"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/signing-envelopes/{envelope_id}/withdraw": {
      "post": {
        "operationId": "withdrawSigningEnvelope",
        "summary": "Irreversibly stop new invitations/reviews/signatures for a partially accepted envelope; retain signatures",
        "x-required-scopes": [
          "requests:cancel"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "envelope_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$",
              "description": "Quoted resource_version, e.g. \"3\"."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigningEnvelope"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "412": {
            "description": "Version mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "Request body larger than 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "428": {
            "description": "If-Match required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/envelope-preparations": {
      "post": {
        "operationId": "prepareEnvelope",
        "summary": "Prepare one exact common document and immutable N-member plan; never creates or sends",
        "x-required-scopes": [
          "documents:prepare",
          "documents:submit"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopePreparation"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "Request body larger than 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnvelopeSubmission"
              }
            }
          }
        }
      }
    },
    "/api/v1/envelope-preparations/{preparation_id}": {
      "get": {
        "operationId": "getEnvelopePreparation",
        "summary": "Recover original immutable preview/plan without new preparation",
        "x-required-scopes": [
          "documents:prepare",
          "documents:submit"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "preparation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Original-Prepare-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopePreparation"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/envelope-preparations/{preparation_id}/envelope": {
      "post": {
        "operationId": "createPreparedEnvelope",
        "summary": "Atomically enroll all original planned members from an immutable reviewed preparation",
        "x-required-scopes": [
          "requests:create",
          "documents:submit"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "preparation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigningEnvelope"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "Request body larger than 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "maxProperties": 0
              }
            }
          }
        }
      }
    },
    "/api/v1/signing-envelopes/{envelope_id}/invitations": {
      "post": {
        "operationId": "inviteEnvelope",
        "summary": "Explicitly queue the original N roster atomically; never implicit resend",
        "x-required-scopes": [
          "invitations:create"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "envelope_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeInvitationBatch"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "Request body larger than 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "maxProperties": 0
              }
            }
          }
        }
      },
      "get": {
        "operationId": "observeEnvelopeInvitations",
        "summary": "Read original batch ACK or inconclusive absence; never POST",
        "x-required-scopes": [
          "requests:read"
        ],
        "parameters": [
          {
            "name": "envelope_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Original-Invite-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            },
            "description": "Exact original invitation key for correlation only, never authorization or a query parameter."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeInvitationObservation"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "410": {
            "description": "Scan token expired, recovery epoch changed, or watermark outside history; restart reconciliation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/requests/{request_id}/invitation-handoff": {
      "get": {
        "operationId": "getAppInvitationHandoff",
        "summary": "Recover original live signing capabilities for app-owned delivery; never mint, renew or send",
        "x-required-scopes": [
          "invitations:create"
        ],
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Original-Invite-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            },
            "description": "Exact original invitation key for correlation only, never authorization or a query parameter."
          }
        ],
        "responses": {
          "200": {
            "description": "The app's own handoff for the current signing link created with this original invitation key: `signing_url`, recipient and expiry. Never stored by the service in readable form; re-derived on each call.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppInvitationHandoff"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "410": {
            "description": "Scan token expired, recovery epoch changed, or watermark outside history; restart reconciliation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/signing-envelopes/{envelope_id}/invitation-handoff": {
      "get": {
        "operationId": "getAppEnvelopeInvitationHandoff",
        "summary": "Recover original live signing capabilities for app-owned delivery; never mint, renew or send",
        "x-required-scopes": [
          "invitations:create"
        ],
        "parameters": [
          {
            "name": "envelope_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Original-Invite-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            },
            "description": "Exact original invitation key for correlation only, never authorization or a query parameter."
          }
        ],
        "responses": {
          "200": {
            "description": "The app's own handoff for the current envelope signing link created with this original invitation key: `signing_url`, recipient and expiry. Re-derived on each call.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppEnvelopeInvitationHandoff"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "410": {
            "description": "Scan token expired, recovery epoch changed, or watermark outside history; restart reconciliation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/signer-authentication-context": {
      "get": {
        "operationId": "getAppAuthenticationContext",
        "summary": "Authenticated app-server lookup of original pending browser authentication context",
        "x-required-scopes": [
          "requests:read"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Signer-Auth-State",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{43}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The authentication context for the account sign-in started with `X-Signer-Auth-State`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppAuthenticationContext"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "410": {
            "description": "Scan token expired, recovery epoch changed, or watermark outside history; restart reconciliation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/signing-policies": {
      "get": {
        "operationId": "listSigningPolicies",
        "summary": "Creator-selectable published immutable authentication policies",
        "x-required-scopes": [
          "documents:submit"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tenant's published signing policies (name, version, signing method and consent version).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigningPolicyCatalog"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "410": {
            "description": "Scan token expired, recovery epoch changed, or watermark outside history; restart reconciliation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/document-uploads": {
      "post": {
        "operationId": "uploadDocument",
        "summary": "Upload a PDF to sign; returns its SHA-256",
        "description": "Send the raw PDF bytes (at most 10 MiB) with `Content-Type: application/pdf`. The engine checks only the `%PDF-` header and `%%EOF` trailer; it never parses or changes the file, and the signer reviews exactly these bytes. Uploading the same bytes again returns the same `sha256`, so no idempotency key is needed. An upload expires after 24 hours; at most 200 live uploads per app and tenant.",
        "x-required-scopes": [
          "documents:submit"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/pdf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stored, or the same bytes already stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUpload"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "PDF larger than 10 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body is not application/pdf",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/pdf-document-preparations": {
      "post": {
        "operationId": "preparePdfDocument",
        "summary": "Prepare an uploaded PDF under explicit tenant policy",
        "x-required-scopes": [
          "documents:prepare",
          "documents:submit"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Immutable ten-minute snapshot, or identical original prepare-key replay, possibly expired. Active limit 100 per app/tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfDocumentPreparation"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "Request body larger than 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfSubmission"
              }
            }
          }
        },
        "description": "Same rules as `prepareTextDocument`: an immutable ten-minute snapshot consumed by `createPreparedRequest`. The same signing policy governs text and PDF documents. The document is bound by `original_sha256`, the upload's hash."
      }
    },
    "/api/v1/requests/{request_id}/original": {
      "get": {
        "operationId": "getOriginal",
        "summary": "Download the exact original the signer reviewed",
        "x-required-scopes": [
          "requests:read"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The original bytes",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "text/plain; charset=utf-8": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "description": "Returns the original's bytes (`application/pdf` or `text/plain; charset=utf-8`), whose SHA-256 is `original_sha256` in the request and the evidence. 409 until the original is prepared. A PDF original is not embedded in the evidence; use this to re-check its hash."
      }
    },
    "/api/v1/document-conversions": {
      "post": {
        "operationId": "convertDocument",
        "summary": "Convert a Word, OpenDocument, RTF, HTML, text or image file to PDF",
        "description": "Send the raw file (at most 10 MiB) with its `Content-Type`. The service converts it in a sandbox, with no network and no access to other files, and stores the PDF as an ordinary upload. Poll `getDocumentConversion`; when `ready`, download the PDF with `getConvertedPdf` and **check how it looks before sending it**, because layout can differ from the program that made the file. Then prepare it with `preparePdfDocument` using `pdf.sha256`. Sending the same bytes and type again returns the same conversion, so no idempotency key is needed. At most 50 conversions per app and tenant per hour. Answers 503 when the operator has not enabled conversion.",
        "x-required-scopes": [
          "documents:submit"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "application/msword": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "application/vnd.oasis.opendocument.text": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "application/rtf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "text/html": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "text/plain": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued, or the same file already converting or converted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentConversion"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "413": {
            "description": "Request body larger than 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "415": {
            "description": "Body must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/document-conversions/{conversion_id}": {
      "get": {
        "operationId": "getDocumentConversion",
        "summary": "Read a conversion's status",
        "x-required-scopes": [
          "documents:submit"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "conversion_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentConversion"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/document-conversions/{conversion_id}/pdf": {
      "get": {
        "operationId": "getConvertedPdf",
        "summary": "Download the converted PDF to check it before sending",
        "x-required-scopes": [
          "documents:submit"
        ],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "conversion_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The PDF bytes",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      }
    },
    "/api/v1/notices": {
      "get": {
        "operationId": "listNotices",
        "summary": "Notices that apply to this app",
        "x-required-scopes": [],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "User-Agent",
            "in": "header",
            "required": false,
            "description": "SDK 0.32 and later send `edocink-sdk/<version>`; the service records it per key and uses it to choose which notices apply.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The notices that apply to this app (published, and for an SDK older than the one reported), acknowledged or not, oldest first, with the reported SDK's status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoticeList"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "eDocInk-Notices": {
                "$ref": "#/components/headers/Notices"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Key not granted this tenant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "410": {
            "description": "Scan token expired, recovery epoch changed, or watermark outside history; restart reconciliation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "description": "Any live key granted this tenant may call this, whatever its scopes."
      }
    },
    "/api/v1/notices/{notice_id}/acknowledge": {
      "post": {
        "operationId": "acknowledgeNotice",
        "summary": "Record that this app has dealt with a notice",
        "x-required-scopes": [],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "notice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{2,79}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The notice, acknowledged. Acknowledging again changes nothing. An acknowledged notice no longer counts in eDocInk-Notices.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notice"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "eDocInk-Notices": {
                "$ref": "#/components/headers/Notices"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Key not granted this tenant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "No such notice",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "410": {
            "description": "Scan token expired, recovery epoch changed, or watermark outside history; restart reconciliation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "description": "Any live key granted this tenant may call this, whatever its scopes."
      }
    },
    "/api/v1/compatibility": {
      "get": {
        "operationId": "getCompatibility",
        "summary": "Whether this app's SDK is current, and its open notices",
        "x-required-scopes": [],
        "parameters": [
          {
            "name": "X-Tenant-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "User-Agent",
            "in": "header",
            "required": false,
            "description": "SDK 0.32 and later send `edocink-sdk/<version>`; the service records it per key and uses it to choose which notices apply.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The API version, the reported SDK's status against the latest and minimum supported SDK, and the unacknowledged notices.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Compatibility"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "eDocInk-Notices": {
                "$ref": "#/components/headers/Notices"
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "401": {
            "description": "Invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "403": {
            "description": "Key not granted this tenant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "404": {
            "description": "Resource not visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "409": {
            "description": "State or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "410": {
            "description": "Scan token expired, recovery epoch changed, or watermark outside history; restart reconciliation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit reached; retry after Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        },
        "description": "Any live key granted this tenant may call this, whatever its scopes."
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Server-to-server app key with explicit tenant grants."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "description": "`http_<status>` for API errors, `invalid_request` for undecodable input, `service_unavailable` for temporary failures."
          },
          "message": {
            "type": "string"
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "code",
          "message",
          "request_id"
        ],
        "description": "Problem document for every 4xx/5xx. Branch on the HTTP status; `message` is for people and may change."
      },
      "Definition": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "name",
          "version"
        ]
      },
      "Recipient": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "display_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "email",
          "display_name"
        ]
      },
      "CreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "definition": {
            "$ref": "#/components/schemas/Definition"
          },
          "recipient": {
            "$ref": "#/components/schemas/Recipient"
          },
          "data": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "maxLength": 10000
            },
            "maxProperties": 100,
            "description": "Must match the selected published definition exactly; typed validation is definition-specific."
          },
          "expires_in": {
            "type": "integer",
            "minimum": 60,
            "maximum": 2592000
          },
          "business_reference": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "definition",
          "recipient",
          "data",
          "expires_in"
        ]
      },
      "SigningRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "definition": {
            "$ref": "#/components/schemas/Definition"
          },
          "status": {
            "type": "string",
            "enum": [
              "preparing",
              "pending",
              "signed",
              "cancelled",
              "expired",
              "failed"
            ]
          },
          "completion_status": {
            "type": "string",
            "enum": [
              "not_started",
              "building",
              "ready",
              "failed"
            ]
          },
          "resource_version": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "signed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "original_sha256": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "self": {
                "type": "string"
              },
              "evidence": {
                "type": "string"
              }
            },
            "required": [
              "self",
              "evidence"
            ]
          }
        },
        "required": [
          "id",
          "tenant_id",
          "definition",
          "status",
          "completion_status",
          "resource_version",
          "created_at",
          "expires_at",
          "signed_at",
          "original_sha256",
          "links"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "signed"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "completion_status": {
                  "enum": [
                    "building",
                    "ready",
                    "failed"
                  ]
                }
              }
            },
            "else": {
              "properties": {
                "completion_status": {
                  "const": "not_started"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "const": "signed"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "signed_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "original_sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                }
              }
            },
            "else": {
              "properties": {
                "signed_at": {
                  "type": "null"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "enum": [
                    "pending",
                    "signed"
                  ]
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "original_sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                }
              }
            }
          }
        ]
      },
      "Invitation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "delivery_id": {
            "type": "string",
            "format": "uuid"
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued"
            ]
          }
        },
        "required": [
          "delivery_id",
          "request_id",
          "status"
        ]
      },
      "Event": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "request.created",
              "request.ready",
              "request.signed",
              "request.cancelled",
              "request.expired",
              "request.failed",
              "request.completed",
              "completion.failed",
              "completion.retried"
            ]
          },
          "stream_version": {
            "type": "integer",
            "minimum": 1
          },
          "resource_version": {
            "type": "integer",
            "minimum": 1
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "preparing",
              "pending",
              "signed",
              "cancelled",
              "expired",
              "failed"
            ]
          },
          "completion_status": {
            "type": "string",
            "enum": [
              "not_started",
              "building",
              "ready",
              "failed"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "stream_version",
          "resource_version",
          "request_id",
          "tenant_id",
          "occurred_at",
          "status",
          "completion_status"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "signed"
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "completion_status": {
                  "enum": [
                    "building",
                    "ready",
                    "failed"
                  ]
                }
              }
            },
            "else": {
              "properties": {
                "completion_status": {
                  "const": "not_started"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "request.created"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "status": {
                  "const": "preparing"
                },
                "completion_status": {
                  "const": "not_started"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "request.ready"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "status": {
                  "const": "pending"
                },
                "completion_status": {
                  "const": "not_started"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "request.signed"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "status": {
                  "const": "signed"
                },
                "completion_status": {
                  "const": "building"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "request.cancelled"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "status": {
                  "const": "cancelled"
                },
                "completion_status": {
                  "const": "not_started"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "request.expired"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "status": {
                  "const": "expired"
                },
                "completion_status": {
                  "const": "not_started"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "request.failed"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "status": {
                  "const": "failed"
                },
                "completion_status": {
                  "const": "not_started"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "request.completed"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "status": {
                  "const": "signed"
                },
                "completion_status": {
                  "const": "ready"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "completion.failed"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "status": {
                  "const": "signed"
                },
                "completion_status": {
                  "const": "failed"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "completion.retried"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "status": {
                  "const": "signed"
                },
                "completion_status": {
                  "const": "building"
                }
              }
            }
          }
        ]
      },
      "EventPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "events": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          },
          "next_cursor": {
            "type": "string",
            "minLength": 1,
            "description": "Position after the last returned event; unchanged on an empty page. Keep polling with it even when has_more=false."
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "events",
          "next_cursor",
          "has_more"
        ]
      },
      "Evidence": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": "esign-evidence-v1"
              },
              "request_id": {
                "type": "string",
                "format": "uuid"
              },
              "manifest_sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "manifest": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "format": {
                    "const": "esign-evidence-v1"
                  },
                  "canonicalization": {
                    "const": "RFC8785"
                  },
                  "attestation_key_id": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "app_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "tenant_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "request_id": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "required": [
                      "app_id",
                      "tenant_id",
                      "request_id"
                    ]
                  },
                  "request": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "definition_name": {
                        "type": "string"
                      },
                      "definition_version": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,18}$"
                      },
                      "input_digest": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "frozen_input": {
                        "type": "object",
                        "maxProperties": 100,
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200000
                            },
                            {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 10485760
                            }
                          ]
                        }
                      },
                      "frozen_policy": {
                        "type": "object"
                      },
                      "recipient_claim": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "email": {
                            "type": "string",
                            "format": "email"
                          },
                          "display_name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "email",
                          "display_name"
                        ]
                      },
                      "business_reference": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "created_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "expires_at": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "id",
                      "definition_name",
                      "definition_version",
                      "input_digest",
                      "frozen_input",
                      "frozen_policy",
                      "recipient_claim",
                      "business_reference",
                      "created_at",
                      "expires_at"
                    ]
                  },
                  "signature": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "session_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "review_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "original_artifact_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "binding_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "original_sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "declared_name": {
                        "type": "string"
                      },
                      "issuer": {
                        "type": "string"
                      },
                      "subject": {
                        "type": "string"
                      },
                      "auth_time": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "mapping_provenance": {
                        "type": "string"
                      },
                      "consent_version": {
                        "type": "string"
                      },
                      "consent_text": {
                        "type": "string"
                      },
                      "signed_at": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "id",
                      "session_id",
                      "review_id",
                      "original_artifact_id",
                      "binding_id",
                      "original_sha256",
                      "declared_name",
                      "issuer",
                      "subject",
                      "auth_time",
                      "mapping_provenance",
                      "consent_version",
                      "consent_text",
                      "signed_at"
                    ]
                  },
                  "authentication": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "issuer": {
                        "type": "string"
                      },
                      "subject": {
                        "type": "string"
                      },
                      "auth_time": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "accepted_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "method": {
                        "const": "oidc-code-pkce"
                      },
                      "id_token_digest": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      }
                    },
                    "required": [
                      "issuer",
                      "subject",
                      "auth_time",
                      "accepted_at",
                      "method",
                      "id_token_digest"
                    ]
                  },
                  "session": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "invitation_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "created_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "expires_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "consumed_at": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "id",
                      "invitation_id",
                      "created_at",
                      "expires_at",
                      "consumed_at"
                    ]
                  },
                  "review": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "original_artifact_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "original_sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "resource_version": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,18}$"
                      },
                      "consent_version": {
                        "type": "string"
                      },
                      "consent_text": {
                        "type": "string"
                      },
                      "created_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "expires_at": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "id",
                      "original_artifact_id",
                      "original_sha256",
                      "resource_version",
                      "consent_version",
                      "consent_text",
                      "created_at",
                      "expires_at"
                    ]
                  },
                  "definition": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "version": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,18}$"
                      },
                      "source_digest": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "input_schema": {
                        "type": "object"
                      },
                      "renderer_version": {
                        "enum": [
                          "text-v1",
                          "pdf-v1"
                        ]
                      },
                      "policy": {
                        "type": "object"
                      },
                      "published_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "source_text": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "name",
                      "version",
                      "source_digest",
                      "input_schema",
                      "renderer_version",
                      "policy",
                      "published_at",
                      "source_text"
                    ]
                  },
                  "acceptance": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "tenant_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "definition": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "version": {
                            "type": "string",
                            "pattern": "^[1-9][0-9]{0,18}$"
                          }
                        },
                        "required": [
                          "name",
                          "version"
                        ]
                      },
                      "status": {
                        "const": "signed"
                      },
                      "completion_status": {
                        "const": "building"
                      },
                      "resource_version": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,18}$"
                      },
                      "created_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "expires_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "signed_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "original_sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "links": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "self": {
                            "type": "string"
                          },
                          "evidence": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "self",
                          "evidence"
                        ]
                      },
                      "signature_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "consent_version": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "tenant_id",
                      "definition",
                      "status",
                      "completion_status",
                      "resource_version",
                      "created_at",
                      "expires_at",
                      "signed_at",
                      "original_sha256",
                      "links",
                      "signature_id",
                      "consent_version"
                    ]
                  },
                  "original": {
                    "oneOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "renderer_version": {
                            "const": "text-v1"
                          },
                          "verified_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "media_type": {
                            "const": "text/plain; charset=utf-8"
                          },
                          "sha256": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{64}$"
                          },
                          "byte_length": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200000
                          },
                          "content": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "renderer_version",
                          "verified_at",
                          "media_type",
                          "sha256",
                          "byte_length",
                          "content"
                        ]
                      },
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "renderer_version": {
                            "const": "pdf-v1"
                          },
                          "verified_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "media_type": {
                            "const": "application/pdf"
                          },
                          "sha256": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{64}$"
                          },
                          "byte_length": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 10485760
                          }
                        },
                        "required": [
                          "id",
                          "renderer_version",
                          "verified_at",
                          "media_type",
                          "sha256",
                          "byte_length"
                        ],
                        "description": "A PDF original is bound by sha256 and byte_length; its bytes are not embedded (GET /api/v1/requests/{id}/original returns them)."
                      }
                    ]
                  },
                  "completion": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "media_type": {
                        "const": "application/json"
                      },
                      "sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "byte_length": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 4194304
                      },
                      "content": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "schema_version": {
                            "const": "esign-completion-v1"
                          },
                          "scope": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "app_id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "tenant_id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "request_id": {
                                "type": "string",
                                "format": "uuid"
                              }
                            },
                            "required": [
                              "app_id",
                              "tenant_id",
                              "request_id"
                            ]
                          },
                          "signature_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "signed_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "original_sha256": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{64}$"
                          },
                          "consent_version": {
                            "type": "string"
                          },
                          "declared_name": {
                            "type": "string"
                          },
                          "issuer": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "accepted_version": {
                            "type": "string",
                            "pattern": "^[1-9][0-9]{0,18}$"
                          }
                        },
                        "required": [
                          "schema_version",
                          "scope",
                          "signature_id",
                          "signed_at",
                          "original_sha256",
                          "consent_version",
                          "declared_name",
                          "issuer",
                          "subject",
                          "accepted_version"
                        ]
                      }
                    },
                    "required": [
                      "media_type",
                      "sha256",
                      "byte_length",
                      "content"
                    ]
                  },
                  "audit_prefix": {
                    "type": "array",
                    "minItems": 3,
                    "maxItems": 3,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "body_base64": {
                          "type": "string",
                          "maxLength": 16384
                        },
                        "previous_hash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "event_hash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "actor_kind": {
                          "enum": [
                            "app_key",
                            "worker",
                            "signer_session"
                          ]
                        },
                        "actor_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "body_base64",
                        "previous_hash",
                        "event_hash",
                        "actor_kind",
                        "actor_id"
                      ]
                    }
                  },
                  "assurance": {
                    "const": "engine-attestation; no independent timestamp; not a PDF signature"
                  },
                  "attestation_key_sha256": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  }
                },
                "required": [
                  "format",
                  "canonicalization",
                  "attestation_key_id",
                  "scope",
                  "request",
                  "signature",
                  "authentication",
                  "session",
                  "review",
                  "definition",
                  "acceptance",
                  "original",
                  "completion",
                  "audit_prefix",
                  "assurance",
                  "attestation_key_sha256"
                ]
              },
              "verification": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "algorithm": {
                    "const": "Ed25519"
                  },
                  "key_id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.-]{1,80}$"
                  },
                  "signature": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{86}$"
                  }
                },
                "required": [
                  "algorithm",
                  "key_id",
                  "signature"
                ]
              }
            },
            "required": [
              "schema_version",
              "request_id",
              "manifest_sha256",
              "manifest",
              "verification"
            ]
          },
          {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": "esign-evidence-v2"
              },
              "request_id": {
                "type": "string",
                "format": "uuid"
              },
              "manifest_sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "manifest": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "format": {
                    "const": "esign-evidence-v2"
                  },
                  "canonicalization": {
                    "const": "RFC8785"
                  },
                  "attestation_key_id": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "app_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "tenant_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "request_id": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "required": [
                      "app_id",
                      "tenant_id",
                      "request_id"
                    ]
                  },
                  "request": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "definition_name": {
                        "type": "string"
                      },
                      "definition_version": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,18}$"
                      },
                      "input_digest": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "frozen_input": {
                        "type": "object",
                        "maxProperties": 100,
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200000
                            },
                            {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 10485760
                            }
                          ]
                        }
                      },
                      "frozen_policy": {
                        "type": "object"
                      },
                      "recipient_claim": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "email": {
                            "type": "string",
                            "format": "email"
                          },
                          "display_name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "email",
                          "display_name"
                        ]
                      },
                      "business_reference": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "created_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "expires_at": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "id",
                      "definition_name",
                      "definition_version",
                      "input_digest",
                      "frozen_input",
                      "frozen_policy",
                      "recipient_claim",
                      "business_reference",
                      "created_at",
                      "expires_at"
                    ]
                  },
                  "signature": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "session_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "review_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "original_artifact_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "binding_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "original_sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "declared_name": {
                        "type": "string"
                      },
                      "issuer": {
                        "type": "string"
                      },
                      "subject": {
                        "type": "string"
                      },
                      "auth_time": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "mapping_provenance": {
                        "type": "string"
                      },
                      "consent_version": {
                        "type": "string"
                      },
                      "consent_text": {
                        "type": "string"
                      },
                      "signed_at": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "id",
                      "session_id",
                      "review_id",
                      "original_artifact_id",
                      "binding_id",
                      "original_sha256",
                      "declared_name",
                      "issuer",
                      "subject",
                      "auth_time",
                      "mapping_provenance",
                      "consent_version",
                      "consent_text",
                      "signed_at"
                    ]
                  },
                  "authentication": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "issuer": {
                        "type": "string"
                      },
                      "subject": {
                        "type": "string"
                      },
                      "auth_time": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "accepted_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "method": {
                        "const": "email-link"
                      },
                      "credential_digest": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      }
                    },
                    "required": [
                      "issuer",
                      "subject",
                      "auth_time",
                      "accepted_at",
                      "method",
                      "credential_digest"
                    ]
                  },
                  "session": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "invitation_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "created_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "expires_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "consumed_at": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "id",
                      "invitation_id",
                      "created_at",
                      "expires_at",
                      "consumed_at"
                    ]
                  },
                  "review": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "original_artifact_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "original_sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "resource_version": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,18}$"
                      },
                      "consent_version": {
                        "type": "string"
                      },
                      "consent_text": {
                        "type": "string"
                      },
                      "created_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "expires_at": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "id",
                      "original_artifact_id",
                      "original_sha256",
                      "resource_version",
                      "consent_version",
                      "consent_text",
                      "created_at",
                      "expires_at"
                    ]
                  },
                  "definition": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "version": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,18}$"
                      },
                      "source_digest": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "input_schema": {
                        "type": "object"
                      },
                      "renderer_version": {
                        "enum": [
                          "text-v1",
                          "pdf-v1"
                        ]
                      },
                      "policy": {
                        "type": "object"
                      },
                      "published_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "source_text": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "name",
                      "version",
                      "source_digest",
                      "input_schema",
                      "renderer_version",
                      "policy",
                      "published_at",
                      "source_text"
                    ]
                  },
                  "acceptance": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "tenant_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "definition": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "version": {
                            "type": "string",
                            "pattern": "^[1-9][0-9]{0,18}$"
                          }
                        },
                        "required": [
                          "name",
                          "version"
                        ]
                      },
                      "status": {
                        "const": "signed"
                      },
                      "completion_status": {
                        "const": "building"
                      },
                      "resource_version": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,18}$"
                      },
                      "created_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "expires_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "signed_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "original_sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "links": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "self": {
                            "type": "string"
                          },
                          "evidence": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "self",
                          "evidence"
                        ]
                      },
                      "signature_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "consent_version": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "tenant_id",
                      "definition",
                      "status",
                      "completion_status",
                      "resource_version",
                      "created_at",
                      "expires_at",
                      "signed_at",
                      "original_sha256",
                      "links",
                      "signature_id",
                      "consent_version"
                    ]
                  },
                  "original": {
                    "oneOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "renderer_version": {
                            "const": "text-v1"
                          },
                          "verified_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "media_type": {
                            "const": "text/plain; charset=utf-8"
                          },
                          "sha256": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{64}$"
                          },
                          "byte_length": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200000
                          },
                          "content": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "renderer_version",
                          "verified_at",
                          "media_type",
                          "sha256",
                          "byte_length",
                          "content"
                        ]
                      },
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "renderer_version": {
                            "const": "pdf-v1"
                          },
                          "verified_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "media_type": {
                            "const": "application/pdf"
                          },
                          "sha256": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{64}$"
                          },
                          "byte_length": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 10485760
                          }
                        },
                        "required": [
                          "id",
                          "renderer_version",
                          "verified_at",
                          "media_type",
                          "sha256",
                          "byte_length"
                        ],
                        "description": "A PDF original is bound by sha256 and byte_length; its bytes are not embedded (GET /api/v1/requests/{id}/original returns them)."
                      }
                    ]
                  },
                  "completion": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "media_type": {
                        "const": "application/json"
                      },
                      "sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "byte_length": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 4194304
                      },
                      "content": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "schema_version": {
                            "const": "esign-completion-v2"
                          },
                          "scope": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "app_id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "tenant_id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "request_id": {
                                "type": "string",
                                "format": "uuid"
                              }
                            },
                            "required": [
                              "app_id",
                              "tenant_id",
                              "request_id"
                            ]
                          },
                          "signature_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "signed_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "original_sha256": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{64}$"
                          },
                          "consent_version": {
                            "type": "string"
                          },
                          "declared_name": {
                            "type": "string"
                          },
                          "issuer": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "accepted_version": {
                            "type": "string",
                            "pattern": "^[1-9][0-9]{0,18}$"
                          },
                          "authentication_method": {
                            "const": "email-link"
                          }
                        },
                        "required": [
                          "schema_version",
                          "scope",
                          "signature_id",
                          "signed_at",
                          "original_sha256",
                          "consent_version",
                          "declared_name",
                          "issuer",
                          "subject",
                          "accepted_version",
                          "authentication_method"
                        ]
                      }
                    },
                    "required": [
                      "media_type",
                      "sha256",
                      "byte_length",
                      "content"
                    ]
                  },
                  "audit_prefix": {
                    "type": "array",
                    "minItems": 3,
                    "maxItems": 3,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "body_base64": {
                          "type": "string",
                          "maxLength": 16384
                        },
                        "previous_hash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "event_hash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "actor_kind": {
                          "enum": [
                            "app_key",
                            "worker",
                            "signer_session"
                          ]
                        },
                        "actor_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "body_base64",
                        "previous_hash",
                        "event_hash",
                        "actor_kind",
                        "actor_id"
                      ]
                    }
                  },
                  "assurance": {
                    "const": "email-link capability; no account identity proof; engine-attestation; no independent timestamp; not a PDF signature"
                  },
                  "attestation_key_sha256": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  }
                },
                "required": [
                  "format",
                  "canonicalization",
                  "attestation_key_id",
                  "scope",
                  "request",
                  "signature",
                  "authentication",
                  "session",
                  "review",
                  "definition",
                  "acceptance",
                  "original",
                  "completion",
                  "audit_prefix",
                  "assurance",
                  "attestation_key_sha256"
                ]
              },
              "verification": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "algorithm": {
                    "const": "Ed25519"
                  },
                  "key_id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.-]{1,80}$"
                  },
                  "signature": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{86}$"
                  }
                },
                "required": [
                  "algorithm",
                  "key_id",
                  "signature"
                ]
              }
            },
            "required": [
              "schema_version",
              "request_id",
              "manifest_sha256",
              "manifest",
              "verification"
            ]
          }
        ]
      },
      "RequestPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requests",
          "next_cursor",
          "reconciliation_cursor"
        ],
        "properties": {
          "requests": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/SigningRequest"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null only when the full scan is finished. An empty page alone does not end a scan."
          },
          "reconciliation_cursor": {
            "type": "string",
            "description": "Scope-bound event watermark captured at the start of this paginated scan. Replay events after this cursor after rebuilding local state.",
            "minLength": 1
          }
        }
      },
      "DocumentPreparation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "enum": [
              "template",
              "plain_text"
            ]
          },
          "request": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CreateRequest"
              },
              {
                "$ref": "#/components/schemas/PlainTextSubmission"
              }
            ]
          },
          "renderer_version": {
            "const": "text-v1"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200000
          },
          "byte_length": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200000
          },
          "original_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "intent_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "source_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "schema_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "policy_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "kind",
          "request",
          "renderer_version",
          "text",
          "byte_length",
          "original_sha256",
          "intent_sha256",
          "source_sha256",
          "schema_sha256",
          "policy_sha256",
          "created_at",
          "expires_at"
        ],
        "oneOf": [
          {
            "properties": {
              "kind": {
                "const": "template"
              },
              "request": {
                "$ref": "#/components/schemas/CreateRequest"
              }
            }
          },
          {
            "properties": {
              "kind": {
                "const": "plain_text"
              },
              "request": {
                "$ref": "#/components/schemas/PlainTextSubmission"
              }
            }
          }
        ]
      },
      "PlainTextSubmission": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "recipient": {
            "$ref": "#/components/schemas/Recipient"
          },
          "expires_in": {
            "type": "integer",
            "minimum": 60,
            "maximum": 2592000
          },
          "business_reference": {
            "type": "string",
            "maxLength": 200
          },
          "policy": {
            "$ref": "#/components/schemas/Definition"
          },
          "document": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "body": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200000
              }
            },
            "required": [
              "title",
              "body"
            ]
          }
        },
        "required": [
          "policy",
          "document",
          "recipient",
          "expires_in"
        ]
      },
      "PreparedRequestObservation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": {
            "const": "esign-prepared-request-observation-v1"
          },
          "preparation_id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "enum": [
              "template",
              "plain_text"
            ]
          },
          "recovery_epoch": {
            "type": "string",
            "format": "uuid"
          },
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "state": {
            "enum": [
              "bound",
              "not_bound_in_snapshot"
            ]
          },
          "request": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SigningRequest"
              },
              {
                "type": "null"
              }
            ]
          },
          "missing_binding_is_inconclusive": {
            "const": true
          },
          "no_release_authority": {
            "const": true
          },
          "intent_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "original_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "create_key_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "profile",
          "preparation_id",
          "tenant_id",
          "kind",
          "recovery_epoch",
          "observed_at",
          "state",
          "request",
          "missing_binding_is_inconclusive",
          "no_release_authority",
          "intent_sha256",
          "original_sha256",
          "create_key_sha256"
        ],
        "oneOf": [
          {
            "properties": {
              "state": {
                "const": "bound"
              },
              "request": {
                "$ref": "#/components/schemas/SigningRequest"
              }
            }
          },
          {
            "properties": {
              "state": {
                "const": "not_bound_in_snapshot"
              },
              "request": {
                "type": "null"
              }
            }
          }
        ]
      },
      "InvitationObservation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": {
            "const": "esign-invitation-observation-v1"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "invite_key_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "recovery_epoch": {
            "type": "string",
            "format": "uuid"
          },
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "state": {
            "enum": [
              "queued",
              "not_queued_in_snapshot"
            ]
          },
          "receipt": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Invitation"
              },
              {
                "type": "null"
              }
            ]
          },
          "missing_queue_is_inconclusive": {
            "const": true
          },
          "no_release_authority": {
            "const": true
          }
        },
        "required": [
          "profile",
          "tenant_id",
          "request_id",
          "invite_key_sha256",
          "recovery_epoch",
          "observed_at",
          "state",
          "receipt",
          "missing_queue_is_inconclusive",
          "no_release_authority"
        ],
        "oneOf": [
          {
            "properties": {
              "state": {
                "const": "queued"
              },
              "receipt": {
                "$ref": "#/components/schemas/Invitation"
              }
            }
          },
          {
            "properties": {
              "state": {
                "const": "not_queued_in_snapshot"
              },
              "receipt": {
                "type": "null"
              }
            }
          }
        ]
      },
      "EnvelopeManifest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": {
            "const": "esign-envelope-manifest-v1"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "document_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "signers": {
            "type": "array",
            "minItems": 2,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "slot_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,64}$"
                },
                "role": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "recipient": {
                  "$ref": "#/components/schemas/Recipient"
                }
              },
              "required": [
                "slot_id",
                "role",
                "recipient"
              ]
            }
          }
        },
        "required": [
          "profile",
          "id",
          "document_sha256",
          "signers"
        ]
      },
      "EnvelopeCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "document_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "signers": {
            "type": "array",
            "minItems": 2,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "slot_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,64}$"
                },
                "role": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "recipient": {
                  "$ref": "#/components/schemas/Recipient"
                },
                "request_id": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "slot_id",
                "role",
                "recipient",
                "request_id"
              ]
            },
            "maxItems": 20
          }
        },
        "required": [
          "id",
          "document_sha256",
          "signers"
        ]
      },
      "SigningEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "manifest": {
            "$ref": "#/components/schemas/EnvelopeManifest"
          },
          "manifest_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "resource_version": {
            "type": "integer",
            "minimum": 1
          },
          "status": {
            "enum": [
              "pending",
              "partially_signed",
              "signed",
              "withdrawn",
              "expired",
              "incomplete"
            ]
          },
          "completion_status": {
            "enum": [
              "not_ready",
              "building",
              "failed",
              "ready"
            ]
          },
          "complete": {
            "type": "boolean"
          },
          "required_count": {
            "type": "integer",
            "minimum": 2
          },
          "signed_count": {
            "type": "integer",
            "minimum": 0
          },
          "ready_count": {
            "type": "integer",
            "minimum": 0
          },
          "members": {
            "type": "array",
            "minItems": 2,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "slot_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,64}$"
                },
                "role": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "request": {
                  "$ref": "#/components/schemas/SigningRequest"
                }
              },
              "required": [
                "slot_id",
                "role",
                "request"
              ]
            }
          }
        },
        "required": [
          "id",
          "tenant_id",
          "manifest",
          "manifest_sha256",
          "created_at",
          "expires_at",
          "resource_version",
          "status",
          "completion_status",
          "complete",
          "required_count",
          "signed_count",
          "ready_count",
          "members"
        ]
      },
      "EnvelopeSubmission": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "policy": {
            "$ref": "#/components/schemas/Definition"
          },
          "document": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200000
                  }
                },
                "required": [
                  "title",
                  "body"
                ]
              },
              {
                "type": "object",
                "additionalProperties": false,
                "description": "An uploaded PDF: `sha256` names an unexpired upload from `uploadDocument`.",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "sha256": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  }
                },
                "required": [
                  "title",
                  "sha256"
                ]
              }
            ]
          },
          "signers": {
            "type": "array",
            "minItems": 2,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "slot_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,64}$"
                },
                "role": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "recipient": {
                  "$ref": "#/components/schemas/Recipient"
                }
              },
              "required": [
                "slot_id",
                "role",
                "recipient"
              ]
            },
            "maxItems": 20
          },
          "expires_in": {
            "type": "integer",
            "minimum": 60,
            "maximum": 2592000
          }
        },
        "required": [
          "id",
          "policy",
          "document",
          "signers",
          "expires_in"
        ]
      },
      "EnvelopePreparation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": {
            "const": "esign-envelope-preparation-v1"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "request": {
            "$ref": "#/components/schemas/EnvelopeSubmission"
          },
          "manifest": {
            "$ref": "#/components/schemas/EnvelopeManifest"
          },
          "manifest_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "planned_members": {
            "type": "array",
            "minItems": 2,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "slot_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,64}$"
                },
                "request_id": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "slot_id",
                "request_id"
              ]
            }
          },
          "plan_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200000
          },
          "byte_length": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10485760
          },
          "original_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "prepare_key_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "intent_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "source_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "schema_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "policy_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "media_type": {
            "const": "application/pdf"
          }
        },
        "required": [
          "profile",
          "id",
          "tenant_id",
          "request",
          "manifest",
          "manifest_sha256",
          "planned_members",
          "plan_sha256",
          "byte_length",
          "original_sha256",
          "prepare_key_sha256",
          "intent_sha256",
          "source_sha256",
          "schema_sha256",
          "policy_sha256",
          "created_at",
          "expires_at"
        ],
        "oneOf": [
          {
            "required": [
              "text"
            ],
            "not": {
              "required": [
                "media_type"
              ]
            },
            "properties": {
              "byte_length": {
                "maximum": 200000
              }
            }
          },
          {
            "required": [
              "media_type"
            ],
            "not": {
              "required": [
                "text"
              ]
            }
          }
        ]
      },
      "EnvelopeInvitationBatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "envelope_id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "manifest_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "state": {
            "const": "queued"
          },
          "invitations": {
            "type": "array",
            "minItems": 2,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "slot_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,64}$"
                },
                "receipt": {
                  "$ref": "#/components/schemas/Invitation"
                }
              },
              "required": [
                "slot_id",
                "receipt"
              ]
            }
          }
        },
        "required": [
          "envelope_id",
          "tenant_id",
          "manifest_sha256",
          "state",
          "invitations"
        ]
      },
      "EnvelopeInvitationObservation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": {
            "const": "esign-envelope-invitation-observation-v1"
          },
          "envelope_id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "manifest_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "invite_key_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "state": {
            "enum": [
              "queued",
              "not_queued_in_snapshot"
            ]
          },
          "batch": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EnvelopeInvitationBatch"
              },
              {
                "type": "null"
              }
            ]
          },
          "recovery_epoch": {
            "type": "string",
            "format": "uuid"
          },
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "missing_queue_is_inconclusive": {
            "const": true
          },
          "no_release_authority": {
            "const": true
          }
        },
        "required": [
          "profile",
          "envelope_id",
          "tenant_id",
          "manifest_sha256",
          "invite_key_sha256",
          "state",
          "batch",
          "recovery_epoch",
          "observed_at",
          "missing_queue_is_inconclusive",
          "no_release_authority"
        ],
        "oneOf": [
          {
            "properties": {
              "state": {
                "const": "queued"
              },
              "batch": {
                "$ref": "#/components/schemas/EnvelopeInvitationBatch"
              }
            }
          },
          {
            "properties": {
              "state": {
                "const": "not_queued_in_snapshot"
              },
              "batch": {
                "type": "null"
              }
            }
          }
        ]
      },
      "AppInvitationHandoff": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": {
            "const": "esign-app-invitation-handoff-v1"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "delivery_id": {
            "type": "string",
            "format": "uuid"
          },
          "recipient": {
            "$ref": "#/components/schemas/Recipient"
          },
          "signing_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "email_delivery": {
            "const": "app_owned"
          },
          "invite_key_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "recovery_epoch": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "const": "ready"
          }
        },
        "required": [
          "profile",
          "tenant_id",
          "request_id",
          "delivery_id",
          "recipient",
          "signing_url",
          "expires_at",
          "email_delivery",
          "invite_key_sha256",
          "recovery_epoch",
          "state"
        ]
      },
      "AppEnvelopeInvitationHandoff": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": {
            "const": "esign-app-envelope-invitation-handoff-v1"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "envelope_id": {
            "type": "string",
            "format": "uuid"
          },
          "manifest_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "invitations": {
            "type": "array",
            "minItems": 2,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "slot_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "request_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "state": {
                  "enum": [
                    "ready",
                    "unavailable"
                  ]
                },
                "handoff": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AppInvitationHandoff"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "slot_id",
                "request_id",
                "state",
                "handoff"
              ]
            }
          },
          "email_delivery": {
            "const": "app_owned"
          },
          "invite_key_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "recovery_epoch": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "profile",
          "tenant_id",
          "envelope_id",
          "manifest_sha256",
          "invitations",
          "email_delivery",
          "invite_key_sha256",
          "recovery_epoch"
        ]
      },
      "AppAuthenticationContext": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": {
            "const": "esign-app-auth-context-v1"
          },
          "app_id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "session_id": {
            "type": "string",
            "format": "uuid"
          },
          "challenge_id": {
            "type": "string",
            "format": "uuid"
          },
          "binding_id": {
            "type": "string",
            "format": "uuid"
          },
          "expected_subject": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "issuer": {
            "type": "string",
            "format": "uri"
          },
          "redirect_uri": {
            "type": "string",
            "format": "uri"
          },
          "client_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "state_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "nonce_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "request_input_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "recipient_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "context_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "code_challenge": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "code_challenge_method": {
            "const": "S256"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "max_auth_age_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 300
          }
        },
        "required": [
          "profile",
          "app_id",
          "tenant_id",
          "request_id",
          "session_id",
          "challenge_id",
          "binding_id",
          "expected_subject",
          "issuer",
          "redirect_uri",
          "client_id",
          "state_sha256",
          "nonce_sha256",
          "request_input_sha256",
          "recipient_sha256",
          "context_sha256",
          "code_challenge",
          "code_challenge_method",
          "expires_at",
          "max_auth_age_seconds"
        ]
      },
      "SigningPolicyCatalog": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "policies": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "version": {
                  "type": "integer",
                  "minimum": 1
                },
                "authentication_method": {
                  "enum": [
                    "oidc-code-pkce",
                    "email-link"
                  ]
                },
                "policy_sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "consent_version": {
                  "type": "string",
                  "minLength": 1
                },
                "max_auth_age_seconds": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 900
                }
              },
              "required": [
                "name",
                "version",
                "authentication_method",
                "policy_sha256",
                "consent_version",
                "max_auth_age_seconds"
              ]
            }
          },
          "security_selection": {
            "const": "immutable-policy-version"
          },
          "email_delivery": {
            "const": "app_owned"
          }
        },
        "required": [
          "policies",
          "security_selection",
          "email_delivery"
        ]
      },
      "EvidenceTimestamp": {
        "type": "object",
        "additionalProperties": false,
        "description": "esign-timestamp-v1: an RFC 3161 timestamp over the SHA-256 of the exact evidence bytes.",
        "required": [
          "schema_version",
          "request_id",
          "evidence_sha256",
          "authority",
          "gen_time",
          "response"
        ],
        "properties": {
          "schema_version": {
            "const": "esign-timestamp-v1"
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "evidence_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "SHA-256 of the evidence bytes this timestamp covers"
          },
          "authority": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{0,39}$",
            "description": "Identifier of the Time Stamp Authority the operator configured, e.g. digicert"
          },
          "gen_time": {
            "type": "string",
            "format": "date-time",
            "description": "The authority's genTime, UTC, to the second"
          },
          "response": {
            "type": "string",
            "contentEncoding": "base64",
            "description": "The authority's DER TimeStampResp, unchanged"
          }
        }
      },
      "DocumentUpload": {
        "type": "object",
        "additionalProperties": false,
        "description": "Parked PDF bytes, named by SHA-256. Not a signing request.",
        "properties": {
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "byte_length": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10485760
          },
          "media_type": {
            "const": "application/pdf"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "sha256",
          "byte_length",
          "media_type",
          "expires_at"
        ]
      },
      "PdfSubmission": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "recipient": {
            "$ref": "#/components/schemas/Recipient"
          },
          "expires_in": {
            "type": "integer",
            "minimum": 60,
            "maximum": 2592000
          },
          "business_reference": {
            "type": "string",
            "maxLength": 200
          },
          "policy": {
            "$ref": "#/components/schemas/Definition"
          },
          "document": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "required": [
              "title",
              "sha256"
            ],
            "description": "`sha256` names an unexpired upload from `uploadDocument`."
          }
        },
        "required": [
          "policy",
          "document",
          "recipient",
          "expires_in"
        ]
      },
      "PdfDocumentPreparation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "const": "pdf"
          },
          "request": {
            "$ref": "#/components/schemas/PdfSubmission"
          },
          "renderer_version": {
            "const": "pdf-v1"
          },
          "media_type": {
            "const": "application/pdf"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "byte_length": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10485760
          },
          "original_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "intent_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "source_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "schema_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "policy_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "kind",
          "request",
          "renderer_version",
          "media_type",
          "title",
          "byte_length",
          "original_sha256",
          "intent_sha256",
          "source_sha256",
          "schema_sha256",
          "policy_sha256",
          "created_at",
          "expires_at"
        ]
      },
      "DocumentConversion": {
        "type": "object",
        "additionalProperties": false,
        "description": "A source file being turned into a PDF. When ready, `pdf.sha256` names an ordinary upload for `preparePdfDocument`.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "enum": [
              "converting",
              "ready",
              "failed"
            ]
          },
          "source_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "source_media_type": {
            "enum": [
              "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
              "application/msword",
              "application/vnd.oasis.opendocument.text",
              "application/rtf",
              "text/html",
              "text/plain",
              "image/png",
              "image/jpeg"
            ]
          },
          "source_byte_length": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10485760
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "pdf": {
            "$ref": "#/components/schemas/DocumentUpload"
          },
          "reason": {
            "enum": [
              "unsupported",
              "invalid",
              "timeout",
              "too_large",
              "converter_unavailable",
              "storage_unavailable",
              "worker_error"
            ]
          }
        },
        "required": [
          "id",
          "status",
          "source_sha256",
          "source_media_type",
          "source_byte_length",
          "created_at",
          "expires_at"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "ready"
                }
              }
            },
            "then": {
              "required": [
                "pdf"
              ],
              "not": {
                "required": [
                  "reason"
                ]
              }
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "const": "failed"
                }
              }
            },
            "then": {
              "required": [
                "reason"
              ],
              "not": {
                "required": [
                  "pdf"
                ]
              }
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "const": "converting"
                }
              }
            },
            "then": {
              "allOf": [
                {
                  "not": {
                    "required": [
                      "pdf"
                    ]
                  }
                },
                {
                  "not": {
                    "required": [
                      "reason"
                    ]
                  }
                }
              ]
            }
          }
        ]
      },
      "Notice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "published",
          "title",
          "what",
          "who",
          "action",
          "acknowledged"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{2,79}$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "added",
              "needs_upgrade",
              "breaking",
              "deprecated",
              "security"
            ]
          },
          "published": {
            "type": "string",
            "format": "date"
          },
          "deadline": {
            "type": "string",
            "format": "date"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "what": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "who": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "action": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "minimum_sdk": {
            "type": "string",
            "pattern": "^[0-9]{1,4}\\.[0-9]{1,4}\\.[0-9]{1,4}(-[0-9A-Za-z.]{1,40})?$"
          },
          "acknowledged": {
            "type": "boolean"
          }
        }
      },
      "SdkStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reported",
          "latest",
          "minimum_supported",
          "status"
        ],
        "properties": {
          "reported": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^[0-9]{1,4}\\.[0-9]{1,4}\\.[0-9]{1,4}(-[0-9A-Za-z.]{1,40})?$"
              },
              {
                "type": "null"
              }
            ]
          },
          "latest": {
            "type": "string",
            "pattern": "^[0-9]{1,4}\\.[0-9]{1,4}\\.[0-9]{1,4}(-[0-9A-Za-z.]{1,40})?$"
          },
          "minimum_supported": {
            "type": "string",
            "pattern": "^[0-9]{1,4}\\.[0-9]{1,4}\\.[0-9]{1,4}(-[0-9A-Za-z.]{1,40})?$"
          },
          "status": {
            "type": "string",
            "enum": [
              "current",
              "supported",
              "unsupported",
              "unknown"
            ]
          }
        }
      },
      "NoticeList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sdk",
          "notices"
        ],
        "properties": {
          "sdk": {
            "$ref": "#/components/schemas/SdkStatus"
          },
          "notices": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/Notice"
            }
          }
        }
      },
      "Compatibility": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "api_version",
          "sdk",
          "notices"
        ],
        "properties": {
          "api_version": {
            "type": "string",
            "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
          },
          "sdk": {
            "$ref": "#/components/schemas/SdkStatus"
          },
          "notices": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "unacknowledged",
              "ids"
            ],
            "properties": {
              "unacknowledged": {
                "type": "integer",
                "minimum": 0
              },
              "ids": {
                "type": "array",
                "maxItems": 200,
                "items": {
                  "type": "string",
                  "pattern": "^[a-z0-9][a-z0-9-]{2,79}$"
                }
              }
            }
          }
        }
      }
    },
    "headers": {
      "NoStore": {
        "description": "All success and error responses use no-store.",
        "schema": {
          "type": "string",
          "const": "no-store"
        }
      },
      "RetryAfter": {
        "description": "When supplied, decimal delay in seconds. Retry mutations using the same idempotency key.",
        "schema": {
          "type": "string",
          "pattern": "^[0-9]+$"
        }
      },
      "Notices": {
        "description": "Present on a successful API response while this app has unacknowledged notices: `<count>; latest=\"<notice id>\"`. Read them with GET /api/v1/notices.",
        "schema": {
          "type": "string",
          "pattern": "^[0-9]+; latest=\"[a-z0-9][a-z0-9-]{2,79}\"$"
        }
      }
    }
  },
  "webhooks": {
    "signingEvent": {
      "post": {
        "operationId": "receiveSigningEvent",
        "summary": "Signed event delivery to the app's HTTPS endpoint",
        "description": "Sent when a request changes state. The body is the same `Event` document as the event feed. Verify before trusting: compute HMAC-SHA256 with the key named by `Esign-Key-ID` over the bytes `<Esign-Timestamp>.<Esign-Delivery-ID>.<raw body>` and compare it in constant time with `Esign-Signature` (lowercase hex). Reject timestamps more than 300 seconds from now. Record `Esign-Event-ID` before acting and ignore repeats: a delivery can arrive more than once. Respond 2xx within 10 seconds; anything else is retried with exponential backoff (about 5 seconds doubling, at most 1 hour apart) for up to 72 hours or 100 attempts. Order is not guaranteed; use `stream_version` and `resource_version`, or re-read the request. The SDK's `receiveWebhookOnce` implements all of this.",
        "parameters": [
          {
            "name": "Esign-Event-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Esign-Delivery-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Esign-Timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,11}$"
            }
          },
          {
            "name": "Esign-Key-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Esign-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Accepted; no further attempts for this delivery"
          }
        }
      }
    }
  }
}