{
  "openapi": "3.1.0",
  "info": {
    "title": "esign API",
    "version": "1.0.0",
    "description": "Generated from the Zod schemas in packages/contracts. The web application is a client of this API and has no privileged access it lacks (AD-01): if the UI can do something described nowhere here, that is an API bug."
  },
  "security": [
    {
      "bearerAuth": []
    },
    {
      "senderSession": []
    }
  ],
  "components": {
    "schemas": {
      "Error": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "UNAUTHENTICATED",
                  "FORBIDDEN",
                  "INSUFFICIENT_SCOPE",
                  "NOT_FOUND",
                  "VALIDATION_FAILED",
                  "ENVELOPE_NOT_DRAFT",
                  "ENVELOPE_TERMINAL",
                  "ENVELOPE_TYPE_MISMATCH",
                  "PARTY_ALREADY_COMPLETED",
                  "PARTY_IS_WITNESSED",
                  "FIELD_NOT_PREFILLABLE",
                  "SIGNING_ORDER_VIOLATION",
                  "DOCUMENT_TYPE_INELIGIBLE",
                  "PAGE_OUT_OF_RANGE",
                  "PREPARATION_UNSUPPORTED",
                  "NOT_READY_TO_DISTRIBUTE",
                  "DELIVERY_UNSUPPORTED",
                  "SIGNATURE_TIER_INSUFFICIENT",
                  "IDEMPOTENCY_KEY_REUSED",
                  "REQUEST_IN_PROGRESS",
                  "EXPORT_TOO_LARGE",
                  "RATE_LIMITED",
                  "SEALING_IN_PROGRESS",
                  "DOCUMENT_WITHHELD",
                  "TOKEN_ENVIRONMENT_MISMATCH",
                  "LINK_EXPIRED",
                  "SIGNING_CLOSED",
                  "ACCESS_CODE_REQUIRED",
                  "ACCESS_CODE_INVALID",
                  "AUTH_UNSUPPORTED",
                  "AUTH_REQUIRED",
                  "OTP_INVALID",
                  "OTP_EXPIRED",
                  "OTP_DELIVERY_FAILED",
                  "INVALID_CREDENTIALS",
                  "MFA_REQUIRED",
                  "MFA_INVALID",
                  "SESSION_EXPIRED",
                  "PASSWORD_UNACCEPTABLE",
                  "EMAIL_UNAVAILABLE",
                  "ALREADY_CLAIMED",
                  "SETUP_TOKEN_INVALID",
                  "SETTING_MISSING",
                  "SETTING_INVALID",
                  "SETTING_TEST_FAILED",
                  "CURSOR_INVALID",
                  "CONDITIONS_UNSUPPORTED",
                  "FIELD_NOT_FILLABLE",
                  "DISCLOSURE_HASH_MISMATCH",
                  "CONSENT_DEMONSTRATION_MISSING",
                  "DOCUMENT_NOT_READY",
                  "PRESENTED_HASH_MISMATCH",
                  "REQUIRED_FIELD_MISSING",
                  "INTERNAL"
                ]
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string"
                    },
                    "issue": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "path",
                    "issue"
                  ]
                }
              },
              "requestId": {
                "type": "string"
              },
              "docs": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "requestId"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "Envelope": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "DOCUMENT",
              "TEMPLATE"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "PENDING",
              "SEALING",
              "SEAL_FAILED",
              "COMPLETED",
              "DECLINED",
              "CANCELLED",
              "EXPIRED"
            ]
          },
          "title": {
            "type": "string"
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "organisationId": {
            "type": "string"
          },
          "teamId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "ownerId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          },
          "sentAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "completedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "title",
          "externalId",
          "organisationId",
          "teamId",
          "ownerId",
          "createdAt",
          "updatedAt",
          "sentAt",
          "completedAt",
          "expiresAt"
        ]
      },
      "EnvelopeDetail": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "DOCUMENT",
              "TEMPLATE"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "PENDING",
              "SEALING",
              "SEAL_FAILED",
              "COMPLETED",
              "DECLINED",
              "CANCELLED",
              "EXPIRED"
            ]
          },
          "title": {
            "type": "string"
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "organisationId": {
            "type": "string"
          },
          "teamId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "ownerId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          },
          "sentAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "completedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "position": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "filename": {
                  "type": "string"
                },
                "mimeType": {
                  "type": "string"
                },
                "pageCount": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "position",
                "filename",
                "mimeType",
                "pageCount"
              ]
            }
          },
          "parties": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "SIGNER",
                    "APPROVER",
                    "VIEWER",
                    "ASSISTANT",
                    "CC",
                    "WITNESS",
                    "NOTARY"
                  ]
                },
                "roleLabel": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "email": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "signingOrder": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "dispatchAfter": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string"
                },
                "witnessedPartyId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "hasAccessCode": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "role",
                "roleLabel",
                "name",
                "email",
                "signingOrder",
                "dispatchAfter",
                "status",
                "witnessedPartyId",
                "hasAccessCode"
              ]
            }
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "itemId": {
                  "type": "string"
                },
                "partyId": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "SIGNATURE",
                    "FREE_SIGNATURE",
                    "INITIALS",
                    "STAMP",
                    "NAME",
                    "EMAIL",
                    "PHONE",
                    "JOB_TITLE",
                    "COMPANY",
                    "DATE",
                    "TEXT",
                    "NUMBER",
                    "CHECKBOX",
                    "RADIO",
                    "DROPDOWN",
                    "CELLS",
                    "IMAGE",
                    "ATTACHMENT",
                    "SIGNATURE_MEANING"
                  ]
                },
                "page": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "w": {
                  "type": "number"
                },
                "h": {
                  "type": "number"
                },
                "required": {
                  "type": "boolean"
                },
                "readOnly": {
                  "type": "boolean"
                },
                "groupKey": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "itemId",
                "partyId",
                "type",
                "page",
                "x",
                "y",
                "w",
                "h",
                "required",
                "readOnly",
                "groupKey"
              ]
            }
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "title",
          "externalId",
          "organisationId",
          "teamId",
          "ownerId",
          "createdAt",
          "updatedAt",
          "sentAt",
          "completedAt",
          "expiresAt",
          "items",
          "parties",
          "fields"
        ]
      },
      "CreateEnvelope": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "type": {
            "default": "DOCUMENT",
            "type": "string",
            "enum": [
              "DOCUMENT",
              "TEMPLATE"
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "externalId": {
            "type": "string",
            "maxLength": 255
          },
          "teamId": {
            "type": "string"
          },
          "documentTypeKey": {
            "type": "string"
          },
          "folderId": {
            "type": "string"
          },
          "items": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "filename": {
                  "type": "string",
                  "minLength": 1
                },
                "uploadId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "filename",
                "uploadId"
              ]
            }
          },
          "parties": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "SIGNER",
                    "APPROVER",
                    "VIEWER",
                    "ASSISTANT",
                    "CC",
                    "WITNESS"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "email": {
                  "type": "string",
                  "format": "email",
                  "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                },
                "phone": {
                  "type": "string"
                },
                "signingOrder": {
                  "default": 1,
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "dispatchAfter": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "roleLabel": {
                  "type": "string"
                },
                "witnessesPartyIndex": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "witnessedPartyId": {
                  "type": "string"
                },
                "accessAuth": {
                  "default": [],
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "actionAuth": {
                  "default": [],
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "accessCode": {
                  "type": "string",
                  "minLength": 4,
                  "maxLength": 64
                }
              },
              "required": [
                "role"
              ]
            }
          },
          "fields": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "SIGNATURE",
                    "FREE_SIGNATURE",
                    "INITIALS",
                    "STAMP",
                    "NAME",
                    "EMAIL",
                    "PHONE",
                    "JOB_TITLE",
                    "COMPANY",
                    "DATE",
                    "TEXT",
                    "NUMBER",
                    "CHECKBOX",
                    "RADIO",
                    "DROPDOWN",
                    "CELLS",
                    "IMAGE",
                    "ATTACHMENT",
                    "SIGNATURE_MEANING"
                  ]
                },
                "partyIndex": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "itemIndex": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "page": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "x": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "y": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "w": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "h": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "required": {
                  "default": true,
                  "type": "boolean"
                },
                "readOnly": {
                  "default": false,
                  "type": "boolean"
                },
                "groupKey": {
                  "type": "string"
                },
                "meta": {
                  "default": {},
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                }
              },
              "required": [
                "type",
                "partyIndex",
                "itemIndex",
                "page",
                "x",
                "y",
                "w",
                "h"
              ]
            }
          }
        },
        "required": [
          "title"
        ]
      },
      "UpdateEnvelope": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "folderId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CopyEnvelope": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "externalId": {
            "type": "string",
            "maxLength": 255
          },
          "teamId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "folderId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EnvelopeDeletion": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "disposition": {
            "type": "string",
            "enum": [
              "REMOVED",
              "HIDDEN"
            ]
          },
          "itemsRemoved": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "uploadsReleased": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "disposition",
          "itemsRemoved",
          "uploadsReleased"
        ]
      },
      "PrepareResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "envelopeId": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "itemId": {
                  "type": "string"
                },
                "revisionId": {
                  "type": "string"
                },
                "alreadyPrepared": {
                  "type": "boolean"
                }
              },
              "required": [
                "itemId",
                "revisionId",
                "alreadyPrepared"
              ]
            }
          },
          "stepsApplied": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "CONVERT",
                "FLATTEN",
                "PAGE_OPS",
                "PLACEHOLDERS"
              ]
            }
          }
        },
        "required": [
          "envelopeId",
          "items",
          "stepsApplied"
        ]
      },
      "Distribute": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "method": {
            "default": "EMAIL",
            "type": "string",
            "enum": [
              "EMAIL",
              "NONE"
            ]
          },
          "subject": {
            "type": "string",
            "maxLength": 500
          },
          "message": {
            "type": "string",
            "maxLength": 5000
          },
          "partyExpiryDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3650
          },
          "signingOrderMode": {
            "default": "PARALLEL",
            "type": "string",
            "enum": [
              "PARALLEL",
              "SEQUENTIAL"
            ]
          },
          "reminders": {
            "type": "object",
            "properties": {
              "firstAfterHours": {
                "type": "integer",
                "minimum": 1,
                "maximum": 720
              },
              "repeatEveryHours": {
                "type": "integer",
                "minimum": 24,
                "maximum": 720
              }
            },
            "required": [
              "firstAfterHours"
            ]
          }
        }
      },
      "DistributeResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "envelope": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "DOCUMENT",
                  "TEMPLATE"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "DRAFT",
                  "PENDING",
                  "SEALING",
                  "SEAL_FAILED",
                  "COMPLETED",
                  "DECLINED",
                  "CANCELLED",
                  "EXPIRED"
                ]
              },
              "title": {
                "type": "string"
              },
              "externalId": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "organisationId": {
                "type": "string"
              },
              "teamId": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "ownerId": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              "sentAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "completedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "expiresAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "type",
              "status",
              "title",
              "externalId",
              "organisationId",
              "teamId",
              "ownerId",
              "createdAt",
              "updatedAt",
              "sentAt",
              "completedAt",
              "expiresAt"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "EMAIL",
              "NONE"
            ]
          },
          "links": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "partyId": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "SIGNER",
                    "APPROVER",
                    "VIEWER",
                    "ASSISTANT",
                    "CC",
                    "WITNESS",
                    "NOTARY"
                  ]
                },
                "name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "email": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "signingOrder": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "url": {
                  "type": "string"
                },
                "turnArrived": {
                  "type": "boolean"
                },
                "expiresAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "partyId",
                "role",
                "name",
                "email",
                "signingOrder",
                "url",
                "turnArrived",
                "expiresAt"
              ]
            }
          }
        },
        "required": [
          "envelope",
          "method"
        ]
      },
      "CancelEnvelope": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          }
        }
      },
      "CancelResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "envelope": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "DOCUMENT",
                  "TEMPLATE"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "DRAFT",
                  "PENDING",
                  "SEALING",
                  "SEAL_FAILED",
                  "COMPLETED",
                  "DECLINED",
                  "CANCELLED",
                  "EXPIRED"
                ]
              },
              "title": {
                "type": "string"
              },
              "externalId": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "organisationId": {
                "type": "string"
              },
              "teamId": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "ownerId": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              "sentAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "completedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "expiresAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "type",
              "status",
              "title",
              "externalId",
              "organisationId",
              "teamId",
              "ownerId",
              "createdAt",
              "updatedAt",
              "sentAt",
              "completedAt",
              "expiresAt"
            ]
          },
          "sessionsEnded": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "envelope",
          "sessionsEnded"
        ]
      },
      "DeclineParty": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          }
        },
        "required": [
          "reason"
        ]
      },
      "DeclineResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "envelope": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "DOCUMENT",
                  "TEMPLATE"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "DRAFT",
                  "PENDING",
                  "SEALING",
                  "SEAL_FAILED",
                  "COMPLETED",
                  "DECLINED",
                  "CANCELLED",
                  "EXPIRED"
                ]
              },
              "title": {
                "type": "string"
              },
              "externalId": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "organisationId": {
                "type": "string"
              },
              "teamId": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "ownerId": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              "sentAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "completedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "expiresAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "type",
              "status",
              "title",
              "externalId",
              "organisationId",
              "teamId",
              "ownerId",
              "createdAt",
              "updatedAt",
              "sentAt",
              "completedAt",
              "expiresAt"
            ]
          },
          "party": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "role": {
                "type": "string",
                "enum": [
                  "SIGNER",
                  "APPROVER",
                  "VIEWER",
                  "ASSISTANT",
                  "CC",
                  "WITNESS",
                  "NOTARY"
                ]
              },
              "status": {
                "type": "string"
              },
              "declineReason": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "role",
              "status",
              "declineReason"
            ]
          },
          "sessionsEnded": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "envelope",
          "party",
          "sessionsEnded"
        ]
      },
      "ExtendExpiry": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          }
        },
        "required": [
          "expiresAt"
        ]
      },
      "ExtendExpiryResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "partyId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "previousExpiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          }
        },
        "required": [
          "partyId",
          "status",
          "previousExpiresAt",
          "expiresAt"
        ]
      },
      "ResendResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "partyId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "delivery": {
            "type": "string",
            "enum": [
              "QUEUED",
              "ISSUED"
            ]
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "previousLinkInvalidated": {
            "type": "boolean"
          }
        },
        "required": [
          "partyId",
          "status",
          "delivery",
          "url",
          "expiresAt",
          "previousLinkInvalidated"
        ]
      },
      "SigningLinkState": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "partyId": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "SIGNER",
              "APPROVER",
              "VIEWER",
              "ASSISTANT",
              "CC",
              "WITNESS",
              "NOTARY"
            ]
          },
          "status": {
            "type": "string"
          },
          "issued": {
            "type": "boolean"
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "openedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "usable": {
            "type": "boolean"
          }
        },
        "required": [
          "partyId",
          "role",
          "status",
          "issued",
          "expiresAt",
          "openedAt",
          "usable"
        ]
      },
      "ItemPatch": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "position": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "uploadId": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "ItemList": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "position": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "filename": {
                  "type": "string"
                },
                "mimeType": {
                  "type": "string"
                },
                "pageCount": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "position",
                "filename",
                "mimeType",
                "pageCount"
              ]
            }
          },
          "fieldsReanchored": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "items"
        ]
      },
      "ItemRemoval": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "fieldsRemoved": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "uploadsReleased": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "fieldsRemoved",
          "uploadsReleased"
        ]
      },
      "AuditPage": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "eventId": {
                  "type": "string"
                },
                "envelopeId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "organisationId": {
                  "type": "string"
                },
                "seq": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "globalSeq": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "type": {
                  "type": "string"
                },
                "occurredAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "recordedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "payload": {},
                "prevHash": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "recordHash": {
                  "type": "string"
                },
                "anchor": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "anchorId": {
                          "type": "string"
                        },
                        "leafIndex": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "path": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "anchorId",
                        "leafIndex",
                        "path"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "eventId",
                "envelopeId",
                "organisationId",
                "seq",
                "globalSeq",
                "type",
                "occurredAt",
                "recordedAt",
                "payload",
                "prevHash",
                "recordHash",
                "anchor"
              ]
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "verification": {
            "type": "object",
            "properties": {
              "ok": {
                "type": "boolean"
              },
              "checked": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "RECORD_HASHES",
                    "SEQUENCE_CONTIGUITY"
                  ]
                }
              },
              "scope": {
                "type": "string",
                "enum": [
                  "PAGE",
                  "ENVELOPE"
                ]
              },
              "from": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "to": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reason": {
                "type": "string"
              },
              "failedAtSeq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "ok",
              "checked",
              "scope",
              "from",
              "to"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor",
          "verification"
        ]
      },
      "AuditExport": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "envelopeId": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "exportedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          },
          "recordCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "records": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "eventId": {
                  "type": "string"
                },
                "envelopeId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "organisationId": {
                  "type": "string"
                },
                "seq": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "globalSeq": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "type": {
                  "type": "string"
                },
                "occurredAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "recordedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "payload": {},
                "prevHash": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "recordHash": {
                  "type": "string"
                },
                "anchor": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "anchorId": {
                          "type": "string"
                        },
                        "leafIndex": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "path": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "anchorId",
                        "leafIndex",
                        "path"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "eventId",
                "envelopeId",
                "organisationId",
                "seq",
                "globalSeq",
                "type",
                "occurredAt",
                "recordedAt",
                "payload",
                "prevHash",
                "recordHash",
                "anchor"
              ]
            }
          },
          "anchors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "anchorId": {
                  "type": "string"
                },
                "fromGlobalSeq": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "toGlobalSeq": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "merkleRoot": {
                  "type": "string"
                },
                "leafCount": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "tsaUrl": {
                  "type": "string"
                },
                "genTime": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "timestampTokenDer": {
                  "type": "string"
                }
              },
              "required": [
                "anchorId",
                "fromGlobalSeq",
                "toGlobalSeq",
                "merkleRoot",
                "leafCount",
                "tsaUrl",
                "genTime",
                "timestampTokenDer"
              ]
            }
          },
          "verification": {
            "type": "object",
            "properties": {
              "ok": {
                "type": "boolean"
              },
              "checked": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "RECORD_HASHES",
                    "SEQUENCE_CONTIGUITY"
                  ]
                }
              },
              "scope": {
                "type": "string",
                "enum": [
                  "PAGE",
                  "ENVELOPE"
                ]
              },
              "from": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "to": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reason": {
                "type": "string"
              },
              "failedAtSeq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "ok",
              "checked",
              "scope",
              "from",
              "to"
            ]
          }
        },
        "required": [
          "envelopeId",
          "organisationId",
          "exportedAt",
          "recordCount",
          "records",
          "anchors",
          "verification"
        ]
      },
      "EnvelopeList": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "DOCUMENT",
                    "TEMPLATE"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "DRAFT",
                    "PENDING",
                    "SEALING",
                    "SEAL_FAILED",
                    "COMPLETED",
                    "DECLINED",
                    "CANCELLED",
                    "EXPIRED"
                  ]
                },
                "title": {
                  "type": "string"
                },
                "externalId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "organisationId": {
                  "type": "string"
                },
                "teamId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "ownerId": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "sentAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "completedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "expiresAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "type",
                "status",
                "title",
                "externalId",
                "organisationId",
                "teamId",
                "ownerId",
                "createdAt",
                "updatedAt",
                "sentAt",
                "completedAt",
                "expiresAt"
              ]
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "nextCursor": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "hasMore": {
                "type": "boolean"
              },
              "limit": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "nextCursor",
              "hasMore",
              "limit"
            ]
          }
        },
        "required": [
          "data",
          "pagination"
        ]
      },
      "BatchGetEnvelopes": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "ids": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "ids"
        ]
      },
      "CreateUpload": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "mimeType": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "byteLength": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{64}$"
          }
        },
        "required": [
          "filename",
          "mimeType",
          "byteLength"
        ]
      },
      "UploadTicket": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "method": {
            "type": "string",
            "const": "PUT"
          },
          "headers": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          }
        },
        "required": [
          "uploadId",
          "url",
          "method",
          "headers",
          "expiresAt"
        ]
      },
      "Job": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "QUEUED",
              "RUNNING",
              "SUCCEEDED",
              "FAILED"
            ]
          },
          "subjectId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "failureCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "state",
          "subjectId",
          "createdAt",
          "startedAt",
          "finishedAt",
          "failureCode"
        ]
      },
      "AddParties": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "parties": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "SIGNER",
                    "APPROVER",
                    "VIEWER",
                    "ASSISTANT",
                    "CC",
                    "WITNESS"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "email": {
                  "type": "string",
                  "format": "email",
                  "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                },
                "phone": {
                  "type": "string"
                },
                "signingOrder": {
                  "default": 1,
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "dispatchAfter": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "roleLabel": {
                  "type": "string"
                },
                "witnessesPartyIndex": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "witnessedPartyId": {
                  "type": "string"
                },
                "accessAuth": {
                  "default": [],
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "actionAuth": {
                  "default": [],
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "accessCode": {
                  "type": "string",
                  "minLength": 4,
                  "maxLength": 64
                }
              },
              "required": [
                "role"
              ]
            }
          }
        },
        "required": [
          "parties"
        ]
      },
      "UpdateParties": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "parties": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "SIGNER",
                    "APPROVER",
                    "VIEWER",
                    "ASSISTANT",
                    "CC",
                    "WITNESS"
                  ]
                },
                "name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "email": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "email",
                      "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "phone": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "roleLabel": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "signingOrder": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "dispatchAfter": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "accessAuth": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "actionAuth": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "accessCode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 4,
                      "maxLength": 64
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "witnessedPartyId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id"
              ]
            }
          }
        },
        "required": [
          "parties"
        ]
      },
      "PartyList": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "parties": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "SIGNER",
                    "APPROVER",
                    "VIEWER",
                    "ASSISTANT",
                    "CC",
                    "WITNESS",
                    "NOTARY"
                  ]
                },
                "roleLabel": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "email": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "signingOrder": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "dispatchAfter": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string"
                },
                "witnessedPartyId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "hasAccessCode": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "role",
                "roleLabel",
                "name",
                "email",
                "signingOrder",
                "dispatchAfter",
                "status",
                "witnessedPartyId",
                "hasAccessCode"
              ]
            }
          }
        },
        "required": [
          "parties"
        ]
      },
      "PartyRemoval": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "fieldsRemoved": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "fieldsRemoved"
        ]
      },
      "AddFields": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "fields": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "SIGNATURE",
                    "FREE_SIGNATURE",
                    "INITIALS",
                    "STAMP",
                    "NAME",
                    "EMAIL",
                    "PHONE",
                    "JOB_TITLE",
                    "COMPANY",
                    "DATE",
                    "TEXT",
                    "NUMBER",
                    "CHECKBOX",
                    "RADIO",
                    "DROPDOWN",
                    "CELLS",
                    "IMAGE",
                    "ATTACHMENT",
                    "SIGNATURE_MEANING"
                  ]
                },
                "partyId": {
                  "type": "string",
                  "minLength": 1
                },
                "itemId": {
                  "type": "string",
                  "minLength": 1
                },
                "page": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "x": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "y": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "w": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "h": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "required": {
                  "default": true,
                  "type": "boolean"
                },
                "readOnly": {
                  "default": false,
                  "type": "boolean"
                },
                "groupKey": {
                  "type": "string"
                },
                "meta": {
                  "default": {},
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                }
              },
              "required": [
                "type",
                "partyId",
                "itemId",
                "page",
                "x",
                "y",
                "w",
                "h"
              ]
            }
          }
        },
        "required": [
          "fields"
        ]
      },
      "UpdateFields": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "fields": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "partyId": {
                  "type": "string",
                  "minLength": 1
                },
                "itemId": {
                  "type": "string",
                  "minLength": 1
                },
                "page": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "x": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "y": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "w": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "h": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "required": {
                  "type": "boolean"
                },
                "readOnly": {
                  "type": "boolean"
                },
                "groupKey": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "meta": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                }
              },
              "required": [
                "id"
              ]
            }
          }
        },
        "required": [
          "fields"
        ]
      },
      "DeleteFields": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "ids": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "required": [
          "ids"
        ]
      },
      "FieldList": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "fields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "itemId": {
                  "type": "string"
                },
                "partyId": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "SIGNATURE",
                    "FREE_SIGNATURE",
                    "INITIALS",
                    "STAMP",
                    "NAME",
                    "EMAIL",
                    "PHONE",
                    "JOB_TITLE",
                    "COMPANY",
                    "DATE",
                    "TEXT",
                    "NUMBER",
                    "CHECKBOX",
                    "RADIO",
                    "DROPDOWN",
                    "CELLS",
                    "IMAGE",
                    "ATTACHMENT",
                    "SIGNATURE_MEANING"
                  ]
                },
                "page": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "w": {
                  "type": "number"
                },
                "h": {
                  "type": "number"
                },
                "required": {
                  "type": "boolean"
                },
                "readOnly": {
                  "type": "boolean"
                },
                "groupKey": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "itemId",
                "partyId",
                "type",
                "page",
                "x",
                "y",
                "w",
                "h",
                "required",
                "readOnly",
                "groupKey"
              ]
            }
          }
        },
        "required": [
          "fields"
        ]
      },
      "FieldRemoval": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "removed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "removed"
        ]
      },
      "PrefillFields": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "fields": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fieldId": {
                  "type": "string",
                  "minLength": 1
                },
                "value": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "text"
                        },
                        "text": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "text"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "number"
                        },
                        "number": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "kind",
                        "number"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "boolean"
                        },
                        "boolean": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "kind",
                        "boolean"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "date"
                        },
                        "iso": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "kind",
                        "iso"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "choice"
                        },
                        "selected": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "kind",
                        "selected"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "attachment"
                        },
                        "storageKey": {
                          "type": "string",
                          "minLength": 1
                        },
                        "filename": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "sha256": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{64}$"
                        }
                      },
                      "required": [
                        "kind",
                        "storageKey",
                        "filename",
                        "sha256"
                      ]
                    }
                  ]
                }
              },
              "required": [
                "fieldId",
                "value"
              ]
            }
          }
        },
        "required": [
          "fields"
        ]
      },
      "PrefillResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "prefilled": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "prefilled"
        ]
      },
      "FieldValues": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "values": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fieldId": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "SIGNATURE",
                    "FREE_SIGNATURE",
                    "INITIALS",
                    "STAMP",
                    "NAME",
                    "EMAIL",
                    "PHONE",
                    "JOB_TITLE",
                    "COMPANY",
                    "DATE",
                    "TEXT",
                    "NUMBER",
                    "CHECKBOX",
                    "RADIO",
                    "DROPDOWN",
                    "CELLS",
                    "IMAGE",
                    "ATTACHMENT",
                    "SIGNATURE_MEANING"
                  ]
                },
                "partyId": {
                  "type": "string"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "PREFILLED",
                    "COMPLETED"
                  ]
                },
                "value": {},
                "valueSha256": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "filledAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "filledByPartyId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "fieldId",
                "type",
                "partyId",
                "source",
                "value",
                "valueSha256",
                "filledAt",
                "filledByPartyId"
              ]
            }
          }
        },
        "required": [
          "values"
        ]
      },
      "VerifyRequest": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{64}$"
          }
        },
        "required": [
          "sha256"
        ]
      },
      "VerifyResponse": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "found": {
                "type": "boolean",
                "const": true
              },
              "status": {
                "type": "string",
                "enum": [
                  "DRAFT",
                  "PENDING",
                  "SEALING",
                  "SEAL_FAILED",
                  "COMPLETED",
                  "DECLINED",
                  "CANCELLED",
                  "EXPIRED"
                ]
              },
              "completedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "partyCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "certificateUrl": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uri"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "chainAnchor": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "genTime": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                      },
                      "tsa": {
                        "type": "string",
                        "format": "uri"
                      }
                    },
                    "required": [
                      "genTime",
                      "tsa"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "found",
              "status",
              "completedAt",
              "partyCount",
              "certificateUrl",
              "chainAnchor"
            ]
          },
          {
            "type": "object",
            "properties": {
              "found": {
                "type": "boolean",
                "const": false
              }
            },
            "required": [
              "found"
            ]
          }
        ]
      },
      "CreateSignSession": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 16,
            "maxLength": 256
          },
          "accessCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": [
          "token"
        ]
      },
      "SignSession": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "sessionToken": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "hashPresented": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          },
          "accessSatisfied": {
            "type": "boolean"
          },
          "outstandingAuth": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "canSign": {
            "type": "boolean"
          },
          "party": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "role": {
                "type": "string",
                "enum": [
                  "SIGNER",
                  "APPROVER",
                  "VIEWER",
                  "ASSISTANT",
                  "CC",
                  "WITNESS",
                  "NOTARY"
                ]
              },
              "roleLabel": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "email": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "signingOrder": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "status": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "role",
              "roleLabel",
              "name",
              "email",
              "signingOrder",
              "status"
            ]
          },
          "envelope": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "DRAFT",
                  "PENDING",
                  "SEALING",
                  "SEAL_FAILED",
                  "COMPLETED",
                  "DECLINED",
                  "CANCELLED",
                  "EXPIRED"
                ]
              },
              "expiresAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "title",
              "status",
              "expiresAt"
            ]
          }
        },
        "required": [
          "sessionToken",
          "sessionId",
          "hashPresented",
          "expiresAt",
          "accessSatisfied",
          "outstandingAuth",
          "canSign",
          "party",
          "envelope"
        ]
      },
      "SignSessionEnvelope": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "envelope": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "DRAFT",
                  "PENDING",
                  "SEALING",
                  "SEAL_FAILED",
                  "COMPLETED",
                  "DECLINED",
                  "CANCELLED",
                  "EXPIRED"
                ]
              },
              "expiresAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "title",
              "status",
              "expiresAt"
            ]
          },
          "party": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "role": {
                "type": "string",
                "enum": [
                  "SIGNER",
                  "APPROVER",
                  "VIEWER",
                  "ASSISTANT",
                  "CC",
                  "WITNESS",
                  "NOTARY"
                ]
              },
              "roleLabel": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "email": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "signingOrder": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "status": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "role",
              "roleLabel",
              "name",
              "email",
              "signingOrder",
              "status"
            ]
          },
          "canSign": {
            "type": "boolean"
          },
          "accessSatisfied": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "position": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "filename": {
                  "type": "string"
                },
                "mimeType": {
                  "type": "string"
                },
                "pageCount": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "position",
                "filename",
                "mimeType",
                "pageCount"
              ]
            }
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "itemId": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "SIGNATURE",
                    "FREE_SIGNATURE",
                    "INITIALS",
                    "STAMP",
                    "NAME",
                    "EMAIL",
                    "PHONE",
                    "JOB_TITLE",
                    "COMPANY",
                    "DATE",
                    "TEXT",
                    "NUMBER",
                    "CHECKBOX",
                    "RADIO",
                    "DROPDOWN",
                    "CELLS",
                    "IMAGE",
                    "ATTACHMENT",
                    "SIGNATURE_MEANING"
                  ]
                },
                "page": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "w": {
                  "type": "number"
                },
                "h": {
                  "type": "number"
                },
                "required": {
                  "type": "boolean"
                },
                "readOnly": {
                  "type": "boolean"
                },
                "groupKey": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "filled": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "itemId",
                "type",
                "page",
                "x",
                "y",
                "w",
                "h",
                "required",
                "readOnly",
                "groupKey",
                "filled"
              ]
            }
          },
          "otherParties": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "SIGNER",
                    "APPROVER",
                    "VIEWER",
                    "ASSISTANT",
                    "CC",
                    "WITNESS",
                    "NOTARY"
                  ]
                },
                "roleLabel": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "signingOrder": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "role",
                "roleLabel",
                "name",
                "signingOrder",
                "status"
              ]
            }
          }
        },
        "required": [
          "envelope",
          "party",
          "canSign",
          "accessSatisfied",
          "items",
          "fields",
          "otherParties"
        ]
      },
      "SaveFields": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "values": {
            "minItems": 1,
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fieldId": {
                  "type": "string"
                },
                "value": {
                  "anyOf": [
                    {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "text"
                            },
                            "text": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "kind",
                            "text"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "number"
                            },
                            "number": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "kind",
                            "number"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "boolean"
                            },
                            "boolean": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "kind",
                            "boolean"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "date"
                            },
                            "iso": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "kind",
                            "iso"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "choice"
                            },
                            "selected": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "selected"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "attachment"
                            },
                            "storageKey": {
                              "type": "string",
                              "minLength": 1
                            },
                            "filename": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "sha256": {
                              "type": "string",
                              "pattern": "^[0-9a-fA-F]{64}$"
                            }
                          },
                          "required": [
                            "kind",
                            "storageKey",
                            "filename",
                            "sha256"
                          ]
                        }
                      ]
                    },
                    {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "signature"
                            },
                            "capture": {
                              "type": "string",
                              "const": "TYPE"
                            },
                            "adopted": {
                              "type": "object",
                              "properties": {
                                "text": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "typeface": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                }
                              },
                              "required": [
                                "text",
                                "typeface"
                              ]
                            }
                          },
                          "required": [
                            "kind",
                            "capture",
                            "adopted"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "signature"
                            },
                            "capture": {
                              "type": "string",
                              "enum": [
                                "DRAW",
                                "UPLOAD",
                                "SAVED"
                              ]
                            },
                            "assetKey": {
                              "type": "string",
                              "minLength": 1
                            },
                            "sha256": {
                              "type": "string",
                              "pattern": "^[0-9a-fA-F]{64}$"
                            }
                          },
                          "required": [
                            "kind",
                            "capture",
                            "assetKey",
                            "sha256"
                          ]
                        }
                      ]
                    }
                  ]
                }
              },
              "required": [
                "fieldId",
                "value"
              ]
            }
          }
        },
        "required": [
          "values"
        ]
      },
      "SaveFieldsResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "saved": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "itemId": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "SIGNATURE",
                    "FREE_SIGNATURE",
                    "INITIALS",
                    "STAMP",
                    "NAME",
                    "EMAIL",
                    "PHONE",
                    "JOB_TITLE",
                    "COMPANY",
                    "DATE",
                    "TEXT",
                    "NUMBER",
                    "CHECKBOX",
                    "RADIO",
                    "DROPDOWN",
                    "CELLS",
                    "IMAGE",
                    "ATTACHMENT",
                    "SIGNATURE_MEANING"
                  ]
                },
                "page": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "w": {
                  "type": "number"
                },
                "h": {
                  "type": "number"
                },
                "required": {
                  "type": "boolean"
                },
                "readOnly": {
                  "type": "boolean"
                },
                "groupKey": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "filled": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "itemId",
                "type",
                "page",
                "x",
                "y",
                "w",
                "h",
                "required",
                "readOnly",
                "groupKey",
                "filled"
              ]
            }
          }
        },
        "required": [
          "saved",
          "fields"
        ]
      },
      "DisclosureAck": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "disclosureId": {
            "type": "string"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{64}$"
          }
        },
        "required": [
          "disclosureId",
          "sha256"
        ]
      },
      "DisclosureAckResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "acknowledged": {
            "type": "boolean",
            "const": true
          },
          "disclosureId": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "acknowledgedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          }
        },
        "required": [
          "acknowledged",
          "disclosureId",
          "kind",
          "version",
          "acknowledgedAt"
        ]
      },
      "AcknowledgeItem": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "itemId": {
            "type": "string",
            "minLength": 1
          },
          "itemSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          }
        },
        "required": [
          "itemId",
          "itemSha256"
        ]
      },
      "AcknowledgeResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "acknowledged": {
            "type": "boolean",
            "const": true
          },
          "itemId": {
            "type": "string"
          },
          "revisionId": {
            "type": "string"
          },
          "itemSha256": {
            "type": "string"
          },
          "acknowledgedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          }
        },
        "required": [
          "acknowledged",
          "itemId",
          "revisionId",
          "itemSha256",
          "acknowledgedAt"
        ]
      },
      "GrantConsent": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "disclosureId": {
            "type": "string"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{64}$"
          },
          "scope": {
            "default": "TRANSACTION",
            "type": "string",
            "enum": [
              "TRANSACTION",
              "CATEGORY"
            ]
          },
          "categoryKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "demonstrationEventId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "disclosureId",
          "sha256",
          "demonstrationEventId"
        ]
      },
      "GrantConsentResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "granted": {
            "type": "boolean",
            "const": true
          },
          "consentId": {
            "type": "string"
          },
          "disclosureId": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "scope": {
            "type": "string",
            "enum": [
              "TRANSACTION",
              "CATEGORY"
            ]
          },
          "grantedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          }
        },
        "required": [
          "granted",
          "consentId",
          "disclosureId",
          "version",
          "scope",
          "grantedAt"
        ]
      },
      "ViewProgress": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "itemId": {
            "type": "string"
          },
          "pagesViewed": {
            "default": [],
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000
            }
          },
          "acknowledgedAll": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "itemId"
        ]
      },
      "ViewProgressResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "item": {
            "type": "object",
            "properties": {
              "itemId": {
                "type": "string"
              },
              "pagesViewed": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                }
              },
              "pageCount": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "acknowledgedAll": {
                "type": "boolean"
              },
              "complete": {
                "type": "boolean"
              }
            },
            "required": [
              "itemId",
              "pagesViewed",
              "pageCount",
              "acknowledgedAll",
              "complete"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "itemId": {
                  "type": "string"
                },
                "pagesViewed": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "pageCount": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "acknowledgedAll": {
                  "type": "boolean"
                },
                "complete": {
                  "type": "boolean"
                }
              },
              "required": [
                "itemId",
                "pagesViewed",
                "pageCount",
                "acknowledgedAll",
                "complete"
              ]
            }
          },
          "allItemsViewed": {
            "type": "boolean"
          }
        },
        "required": [
          "item",
          "items",
          "allItemsViewed"
        ]
      },
      "SessionDecline": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          }
        }
      },
      "SessionDeclineResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "declined": {
            "type": "boolean",
            "const": true
          },
          "partyId": {
            "type": "string"
          },
          "envelopeStatus": {
            "type": "string"
          },
          "declinedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          }
        },
        "required": [
          "declined",
          "partyId",
          "envelopeStatus",
          "declinedAt"
        ]
      },
      "Complete": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "values": {
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fieldId": {
                  "type": "string"
                },
                "value": {
                  "anyOf": [
                    {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "text"
                            },
                            "text": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "kind",
                            "text"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "number"
                            },
                            "number": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "kind",
                            "number"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "boolean"
                            },
                            "boolean": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "kind",
                            "boolean"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "date"
                            },
                            "iso": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "kind",
                            "iso"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "choice"
                            },
                            "selected": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "selected"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "attachment"
                            },
                            "storageKey": {
                              "type": "string",
                              "minLength": 1
                            },
                            "filename": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "sha256": {
                              "type": "string",
                              "pattern": "^[0-9a-fA-F]{64}$"
                            }
                          },
                          "required": [
                            "kind",
                            "storageKey",
                            "filename",
                            "sha256"
                          ]
                        }
                      ]
                    },
                    {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "signature"
                            },
                            "capture": {
                              "type": "string",
                              "const": "TYPE"
                            },
                            "adopted": {
                              "type": "object",
                              "properties": {
                                "text": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "typeface": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                }
                              },
                              "required": [
                                "text",
                                "typeface"
                              ]
                            }
                          },
                          "required": [
                            "kind",
                            "capture",
                            "adopted"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "signature"
                            },
                            "capture": {
                              "type": "string",
                              "enum": [
                                "DRAW",
                                "UPLOAD",
                                "SAVED"
                              ]
                            },
                            "assetKey": {
                              "type": "string",
                              "minLength": 1
                            },
                            "sha256": {
                              "type": "string",
                              "pattern": "^[0-9a-fA-F]{64}$"
                            }
                          },
                          "required": [
                            "kind",
                            "capture",
                            "assetKey",
                            "sha256"
                          ]
                        }
                      ]
                    }
                  ]
                }
              },
              "required": [
                "fieldId",
                "value"
              ]
            }
          },
          "presentedHash": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{64}$"
          },
          "intentStatementVersion": {
            "type": "string",
            "minLength": 1
          },
          "intentAcknowledged": {
            "type": "boolean",
            "const": true
          },
          "signatureMeaning": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "actionAuth": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string",
                "const": "EMAIL_OTP"
              },
              "challengeId": {
                "type": "string",
                "minLength": 1
              },
              "code": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16
              }
            },
            "required": [
              "method",
              "challengeId",
              "code"
            ]
          }
        },
        "required": [
          "presentedHash",
          "intentStatementVersion",
          "intentAcknowledged"
        ]
      },
      "CompleteResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "completed": {
            "type": "boolean",
            "const": true
          },
          "partyId": {
            "type": "string"
          },
          "envelopeStatus": {
            "type": "string"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          },
          "presentedHash": {
            "type": "string"
          },
          "awaiting": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "SIGNER",
                    "APPROVER",
                    "VIEWER",
                    "ASSISTANT",
                    "CC",
                    "WITNESS",
                    "NOTARY"
                  ]
                }
              },
              "required": [
                "id",
                "role"
              ]
            }
          }
        },
        "required": [
          "completed",
          "partyId",
          "envelopeStatus",
          "completedAt",
          "presentedHash",
          "awaiting"
        ]
      },
      "ChallengeRequest": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "method": {
            "type": "string",
            "const": "EMAIL_OTP"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "ACCESS",
              "ACTION"
            ]
          }
        },
        "required": [
          "method",
          "purpose"
        ]
      },
      "ChallengeResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "const": "EMAIL_OTP"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "ACCESS",
              "ACTION"
            ]
          },
          "destination": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          }
        },
        "required": [
          "challengeId",
          "method",
          "purpose",
          "destination",
          "expiresAt"
        ]
      },
      "VerifyChallenge": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string",
            "minLength": 1
          },
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16
          }
        },
        "required": [
          "challengeId",
          "code"
        ]
      },
      "VerifyChallengeResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "accessSatisfied": {
            "type": "boolean"
          },
          "outstandingAuth": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "accessSatisfied",
          "outstandingAuth"
        ]
      },
      "Register": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "minLength": 3,
            "maxLength": 254
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 256
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "organisationName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "email",
          "password",
          "organisationName"
        ]
      },
      "Login": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "minLength": 3,
            "maxLength": 254
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          }
        },
        "required": [
          "email",
          "password"
        ]
      },
      "ChangePassword": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "newPassword": {
            "type": "string",
            "minLength": 12,
            "maxLength": 256
          }
        },
        "required": [
          "currentPassword",
          "newPassword"
        ]
      },
      "Session": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "email": {
                "type": "string"
              },
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "emailVerifiedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "locale": {
                "type": "string"
              },
              "timezone": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "email",
              "name",
              "emailVerifiedAt",
              "locale",
              "timezone"
            ]
          },
          "organisation": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "slug"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "OWNER",
              "ADMIN",
              "MANAGER",
              "MEMBER"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "token",
          "sessionId",
          "expiresAt",
          "user",
          "organisation",
          "role",
          "scopes"
        ]
      },
      "CurrentSession": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "email": {
                "type": "string"
              },
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "emailVerifiedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "locale": {
                "type": "string"
              },
              "timezone": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "email",
              "name",
              "emailVerifiedAt",
              "locale",
              "timezone"
            ]
          },
          "organisation": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "slug"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "OWNER",
              "ADMIN",
              "MANAGER",
              "MEMBER"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "aal": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          },
          "impersonatedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "sessionId",
          "user",
          "organisation",
          "role",
          "scopes",
          "aal",
          "expiresAt",
          "impersonatedBy"
        ]
      },
      "SessionList": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "current": {
                  "type": "boolean"
                },
                "ip": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "userAgent": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "aal": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "lastSeenAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "expiresAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                }
              },
              "required": [
                "id",
                "current",
                "ip",
                "userAgent",
                "aal",
                "createdAt",
                "lastSeenAt",
                "expiresAt"
              ]
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "TransferOwnership": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "toUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        },
        "required": [
          "toUserId"
        ]
      },
      "TransferOwnershipResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "envelopeId": {
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          },
          "previousOwnerId": {
            "type": "string"
          },
          "transferred": {
            "type": "boolean"
          }
        },
        "required": [
          "envelopeId",
          "ownerId",
          "previousOwnerId",
          "transferred"
        ]
      },
      "EventPage": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "nextSince": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "hasMore": {
            "type": "boolean"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "sequence": {
                  "type": "string",
                  "pattern": "^\\d+$"
                },
                "envelopeId": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "occurredAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "recordedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                },
                "data": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                }
              },
              "required": [
                "id",
                "sequence",
                "envelopeId",
                "type",
                "occurredAt",
                "recordedAt",
                "data"
              ]
            }
          }
        },
        "required": [
          "nextSince",
          "hasMore",
          "events"
        ]
      },
      "SetupStatus": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "claimed": {
            "type": "boolean"
          },
          "requiresSetupToken": {
            "type": "boolean"
          }
        },
        "required": [
          "claimed",
          "requiresSetupToken"
        ]
      },
      "ClaimInstance": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "setupToken": {
            "type": "string",
            "minLength": 16,
            "maxLength": 256
          },
          "email": {
            "type": "string",
            "minLength": 3,
            "maxLength": 254
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 256
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "organisationName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "email",
          "password",
          "organisationName"
        ]
      },
      "StorageSetting": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "bucket": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "region": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "endpoint": {
            "type": "string",
            "format": "uri"
          },
          "forcePathStyle": {
            "type": "boolean"
          },
          "accessKeyId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "secretAccessKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          }
        },
        "required": [
          "bucket",
          "region"
        ]
      },
      "MailSetting": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "transport": {
                "type": "string",
                "const": "smtp2go"
              },
              "fromAddress": {
                "type": "string",
                "minLength": 3,
                "maxLength": 254
              },
              "fromName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "apiKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "required": [
              "transport",
              "fromAddress"
            ]
          },
          {
            "type": "object",
            "properties": {
              "transport": {
                "type": "string",
                "const": "smtp"
              },
              "host": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "port": {
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              "username": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "fromAddress": {
                "type": "string",
                "minLength": 3,
                "maxLength": 254
              },
              "fromName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "implicitTls": {
                "type": "boolean"
              },
              "password": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "required": [
              "transport",
              "host",
              "port",
              "username",
              "fromAddress"
            ]
          }
        ]
      },
      "TimestampingSetting": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "authorities": {
            "minItems": 2,
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          }
        },
        "required": [
          "authorities"
        ]
      },
      "SettingView": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "configured": {
            "type": "boolean"
          },
          "hasSecret": {
            "type": "boolean"
          },
          "value": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "key",
          "configured",
          "hasSecret",
          "value",
          "updatedAt"
        ]
      },
      "SettingTestResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "detail": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "detail"
        ]
      },
      "SigningStatus": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "configured": {
            "type": "boolean"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "configured",
          "reason"
        ]
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An organisation API token. Scopes are per-operation."
      },
      "signingSession": {
        "type": "http",
        "scheme": "bearer",
        "description": "A signing session token, obtained from POST /sign/session by exchanging the party token from the invitation link. Carries no scopes: the session is the authorisation."
      },
      "senderSession": {
        "type": "http",
        "scheme": "bearer",
        "description": "A sender session token, obtained from POST /auth/login or POST /auth/register. A third authentication domain, separate from both the API token and the signing session: it belongs to a person at a browser rather than to a program calling the API. Its authority comes from the holder's organisation role rather than from a stored scope list, so a role changed in the admin UI takes effect on the next request ."
      }
    }
  },
  "paths": {
    "/envelopes": {
      "get": {
        "summary": "List envelopes",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "teamId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "folderId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "externalId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "createdAfter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "createdBefore",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of envelopes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeList"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create an envelope, optionally with items, parties and fields",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEnvelope"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, with every reference resolved to a real ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDetail"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_KEY_REUSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED, DOCUMENT_TYPE_INELIGIBLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/batch-get": {
      "post": {
        "summary": "Fetch up to 100 envelopes by ID",
        "x-read-only": true,
        "description": "A read, so it declares no Idempotency-Key. IDs the token cannot see are absent from the response rather than reported, for the same reason a single fetch across the organisation boundary is a 404.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchGetEnvelopes"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The envelopes that exist and are visible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeList"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}": {
      "get": {
        "summary": "Fetch one envelope, with its items, parties and fields",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The envelope and its sub-resources",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDetail"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update a draft envelope",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEnvelope"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete an envelope",
        "description": "Only a DRAFT is removed. Anything that has been distributed is HIDDEN instead: it may hold signatures a party is entitled to, so the sealed bytes, the parties' access and the audit chain all survive. A hidden envelope is absent from every read, so deleting it twice is the same NOT_FOUND as an envelope that never existed. Removing a draft releases the uploads behind it, but only where no other envelope references the same object.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "responses": {
          "200": {
            "description": "What was done",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDeletion"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL, SEALING_IN_PROGRESS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/uploads": {
      "post": {
        "summary": "Request a presigned upload target",
        "description": "The URL is bound to the declared length and type, both signed into it, so a PUT carrying different bytes is refused by storage rather than reconciled afterwards. A declared sha256 is signed in too. The response is the whole credential: the URL is not stored and not retrievable a second time.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUpload"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The handle and its presigned target",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadTicket"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_KEY_REUSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/verify": {
      "post": {
        "summary": "Confirm a document hash against a record",
        "x-read-only": true,
        "description": "Public and unauthenticated (7.27). Confirms integrity and completion without disclosing title, party identities or content. No match is a 200 carrying found: false, never a 404: the absence of a record has to be an answer.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Whether the hash matches a record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyResponse"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/transfer": {
      "post": {
        "summary": "Transfer an envelope to a different owner",
        "description": "The unglamorous, constant case: somebody leaves, and the envelopes they sent do not leave with them. An operation rather than a field update, because ownership answers \"whose work is this\" in every list and report: a silent change is a set of numbers that stop reconciling with no record of why. It writes envelope.ownership_transferred naming the previous owner, the new owner, the actor and the reason, in the same transaction as the change. The recipient must be an **active** member of the organisation: a departed colleague is exactly who an envelope is transferred away from, and transferring it back to them is the mistake this refuses. Transferring to the current owner succeeds, changes nothing and writes no event, so a retry is safe: `transferred` says which happened.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferOwnership"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The envelope, its new owner and its previous one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferOwnershipResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_KEY_REUSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/events": {
      "get": {
        "summary": "Pull the event stream, as an alternative to webhooks",
        "description": "Webhooks push; an integrator recovering from an outage, running a backfill, or sitting behind a network that refuses inbound calls needs to pull. This reads the same records the webhook fan-out reads, so the two cannot disagree about ordering. **Resume from `nextSince`, never from the sequence of the last event you received**: those are different numbers whenever the credential is team-scoped and therefore sees a filtered view, and a client that infers its own cursor will either re-scan the same range on every poll or skip it. `sequence` and `nextSince` are strings because they are exact integers that can outgrow what JSON numbers hold. A poll writes nothing to the audit trail: it carries no evidentiary claim, and one record per poll would drown the trail it exists to protect. Administrative events are a different stream and are not returned here.",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            },
            "description": "A previous response's nextSince. Absent means from the beginning."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of events and the cursor to resume from.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventPage"
                }
              }
            }
          },
          "400": {
            "description": "CURSOR_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/setup/status": {
      "get": {
        "summary": "Is this instance claimed?",
        "description": "An instance is unclaimed while its user table is empty, and the web app sends anyone arriving at one to a setup screen rather than a login form. The answer is only claimed: an unclaimed instance does not confirm what its setup token looks like, or whether one is configured at all.",
        "security": [],
        "x-no-idempotency-key": true,
        "responses": {
          "200": {
            "description": "Whether anybody has claimed this instance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupStatus"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/setup/claim": {
      "post": {
        "summary": "Become the first administrator of an unclaimed instance",
        "description": "The one endpoint that creates an account without an account already existing. In one transaction it creates the user, the organisation, an OWNER membership and a session, guarded by a re-check that the instance is still unclaimed, so two people racing produce one administrator and one ALREADY_CLAIMED. Nothing is seeded: there is no default administrator and no default password. The setup token is not optional, and that is the part worth arguing: an instance is reachable the moment DNS resolves, which is minutes before its owner opens it, and a stranger who finds it first would own an audit trail somebody may later rely on in court. It is generated during provisioning, written to /etc/esign/env beside the database password, and compared in constant time. An instance with no token configured cannot be claimed at all.",
        "security": [],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimInstance"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The administrator, their organisation, and a session for it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "401": {
            "description": "SETUP_TOKEN_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ALREADY_CLAIMED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED, PASSWORD_UNACCEPTABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/settings/signing": {
      "get": {
        "summary": "Whether this deployment can seal documents",
        "description": "Read-only. The signing certificate is deployment configuration, not a runtime setting, so there is no PUT and signing is not a settings key. This exists so an administrator can see that sealing is not possible without sending an envelope to find out. The reason names what is missing; it never carries the certificate or the key.",
        "responses": {
          "200": {
            "description": "Whether a document could be sealed, and why not.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigningStatus"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/settings/{key}": {
      "get": {
        "summary": "Read one runtime setting, without its credential",
        "description": "key is storage, mail or timestamping. The response carries what an administrator may read (which bucket, which host, which authorities) and hasSecret rather than the secret. There is no reveal, for any role, ever: a credential that can be read back out of a settings screen is one that leaks through a screenshot, a support session or a compromised admin account . An unconfigured key answers with configured: false rather than 404: the screen for a setting nobody has made yet is the screen an administrator most needs.",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "storage",
                "mail",
                "timestamping"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The readable half of the setting.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingView"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Configure object storage, outbound mail or the timestamp authorities",
        "description": "These are settings rather than deployment configuration, so rotating a Spaces key or moving mail provider is an admin action and not a redeployment . The request body is the schema for the key: StorageSetting, MailSetting or TimestampingSetting. A secret sent here is stored envelope-encrypted and never returned; omitting it leaves the stored one alone, which is what lets somebody change a bucket name without retyping a key they can no longer read. Timestamping requires two authorities, because a timestamp failure is fatal and never falls back to system time: one authority makes its downtime an unsealed envelope after every party has already signed. Every change writes an administrative event naming the key, the actor and the time, and never the value.",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "storage",
                "mail",
                "timestamping"
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/StorageSetting"
                  },
                  {
                    "$ref": "#/components/schemas/MailSetting"
                  },
                  {
                    "$ref": "#/components/schemas/TimestampingSetting"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stored setting, without its credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingView"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_KEY_REUSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED, SETTING_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/settings/{key}/test": {
      "post": {
        "summary": "Prove a configuration works before anything depends on it",
        "description": "Storage writes a small object under a reserved prefix and reads it back before deleting it: a credential with write and no read stores documents nobody can download, which would otherwise surface weeks later on a first download. Mail sends to an address the caller supplies in `to`. Timestamping checks that each authority answers. The test never writes the setting: a caller tests what they are about to save, and saving stays a separate act. A body that omits the secret uses the stored one, which is the only way to re-test a setting saved months ago. This exists because the alternative is discovering the credentials are wrong at the moment a signer clicks Sign.",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "storage",
                "mail",
                "timestamping"
              ]
            }
          }
        ],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/StorageSetting"
                  },
                  {
                    "$ref": "#/components/schemas/MailSetting"
                  },
                  {
                    "$ref": "#/components/schemas/TimestampingSetting"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The configuration works.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingTestResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED, SETTING_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "SETTING_TEST_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/register": {
      "post": {
        "summary": "Create a user, their first organisation, and a session",
        "description": "One transaction: a user without an organisation cannot own an envelope, so a partial registration is an account that cannot do the thing it was created for. The registrant is the organisation OWNER. token is returned once and never again. A taken address answers EMAIL_UNAVAILABLE, which is an enumeration oracle and is one on purpose: the flow that closes it (accept, say nothing, send mail) needs a delivery channel this deployment does not have, and a registration that silently does nothing is worse. The only password rule is length: at least 12 characters, at most 256 bytes, no composition rules, no forced rotation.",
        "security": [],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Register"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The account, and a session for it. token is shown here and nowhere else.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "409": {
            "description": "EMAIL_UNAVAILABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED, PASSWORD_UNACCEPTABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/login": {
      "post": {
        "summary": "Exchange an email and password for a session",
        "description": "A wrong password and an unknown address are the same answer and take the same time: INVALID_CREDENTIALS, always. The difference is a membership oracle, and the accounts it enumerates belong to the people whose signatures this system exists to protect: so an unknown address still runs a full password verification against a fixed dummy hash. Attempts are counted per address and per IP before anything is compared, because a limiter that counts only failures tells an attacker which guesses were close. MFA_REQUIRED means the password was right and a second factor is outstanding; this deployment cannot yet verify one, so such an account cannot sign in rather than signing in without it.",
        "security": [],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Login"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A session. token is shown here and nowhere else.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_CREDENTIALS, MFA_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/me": {
      "get": {
        "summary": "Who this session is, and what it can do",
        "description": "The sender UI's whole bootstrap: the user, the organisation, the role, the resolved scopes, the AAL and impersonatedBy, in one call. A UI that must ask four endpoints to decide what to render will get one of them wrong, and the one it gets wrong will be the authorisation. impersonatedBy is non-null when a member of staff is acting as this user, and is said plainly rather than left to be inferred. SESSION_EXPIRED is distinguished from UNAUTHENTICATED because the recovery differs: sign in again, rather than check what you sent.",
        "security": [
          {
            "senderSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The session, resolved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurrentSession"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED, SESSION_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "summary": "End this session",
        "description": "This session only. Others are listed and ended through /auth/sessions.",
        "security": [
          {
            "senderSession": []
          }
        ],
        "x-no-idempotency-key": true,
        "responses": {
          "204": {
            "description": "Ended"
          },
          "401": {
            "description": "UNAUTHENTICATED, SESSION_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/sessions": {
      "get": {
        "summary": "Every session this user currently holds",
        "description": "Only the ones that would still be admitted: a list showing sessions that cannot act would invite ending something already ended. current marks the one making the request, which a client cannot work out for itself.",
        "security": [
          {
            "senderSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The live sessions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionList"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED, SESSION_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/sessions/{id}": {
      "delete": {
        "summary": "End another session",
        "description": "Scoped to this user's own sessions. A session belonging to somebody else is NOT_FOUND rather than FORBIDDEN: the answer must not confirm that the ID exists.",
        "security": [
          {
            "senderSession": []
          }
        ],
        "x-no-idempotency-key": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Ended"
          },
          "401": {
            "description": "UNAUTHENTICATED, SESSION_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/password": {
      "post": {
        "summary": "Change the password, proving the current one",
        "description": "Revokes every other session and keeps this one. Revoking all of them logs the person out of the browser they just used, which trains people to avoid changing passwords; keeping only this one is the property that matters: whoever else was in the account is now out. sessionsRevoked says how many that was.",
        "security": [
          {
            "senderSession": []
          }
        ],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePassword"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Changed, with the number of other sessions ended",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "sessionsRevoked"
                  ],
                  "properties": {
                    "sessionsRevoked": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED, SESSION_EXPIRED, INVALID_CREDENTIALS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED, PASSWORD_UNACCEPTABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign/session": {
      "post": {
        "summary": "Exchange a party token for a signing session",
        "description": "The only endpoint in the signing surface that carries no session token, because it is where one comes from. The party token goes in the body rather than in Authorization: it reaches the signing view as a URL parameter, and a body keeps it out of the header a proxy log is most likely to be capturing. sessionToken is returned once and never again. An unrecognised token is NOT_FOUND; a recognised one in a state that refuses gets a specific code: its holder has already demonstrated possession, so LINK_EXPIRED, SIGNING_CLOSED, SIGNING_ORDER_VIOLATION, ACCESS_CODE_REQUIRED, ACCESS_CODE_INVALID and AUTH_UNSUPPORTED tell them nothing they did not have. No Idempotency-Key: that is scoped to an organisation and this caller has none.",
        "security": [],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSignSession"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A session. sessionToken is shown here and nowhere else.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignSession"
                }
              }
            }
          },
          "401": {
            "description": "ACCESS_CODE_REQUIRED, ACCESS_CODE_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SIGNING_CLOSED, SIGNING_ORDER_VIOLATION",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "LINK_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED, AUTH_UNSUPPORTED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign/session/envelope": {
      "get": {
        "summary": "The envelope as this party sees it",
        "description": "Scoped to the session's party. Other parties appear without email or phone (a signer is entitled to know they are waiting on the finance director, not to the finance director's address) and their fields are not returned at all. Conditional logic is resolved server-side; until the resolver exists (P2) a field carrying conditions is refused with CONDITIONS_UNSUPPORTED rather than returned unresolved, because showing a signer a field a rule would have hidden is a wrong answer that looks like a right one.",
        "security": [
          {
            "signingSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "The party-scoped envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignSessionEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SIGNING_CLOSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "LINK_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "CONDITIONS_UNSUPPORTED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign/session/fields": {
      "patch": {
        "summary": "Save field values as the signer works",
        "description": "A partial save, called repeatedly while somebody fills a form in: sending three of eight fields writes those three and leaves the rest alone. It writes nothing to the audit trail, and that is a decision: somebody typing produces a save every few seconds, and recording each would bury the events a court reads while building a keystroke-level history of a person filling in a form. What must be provable is what was signed, and complete captures that. Only this party's own fields: another party's is 404, the same answer as one that does not exist. A read-only field is FIELD_NOT_FILLABLE. Values are re-validated server-side here and again at complete.",
        "security": [
          {
            "signingSession": []
          }
        ],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveFields"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was saved, and every field of this party's",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaveFieldsResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "FIELD_NOT_FILLABLE, SIGNING_CLOSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "LINK_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED, CONDITIONS_UNSUPPORTED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign/session/complete": {
      "post": {
        "summary": "Apply the signature",
        "description": "presentedHash is echoed back by the client and must match the hash of what was presented to this party. It looks redundant (the server produced the revision) and the value is that it is an end-to-end check across a boundary the server cannot otherwise see: a stale tab, two diverged sessions, a rewriting middlebox, a modified client. Every one means the signer was looking at something other than what we presented, and the assent argument rests on that correspondence. A mismatch is PRESENTED_HASH_MISMATCH with no reconciliation path. Every required field must be filled, values are re-validated here regardless of having passed the partial save, and a party whose actionAuth this deployment cannot satisfy is refused rather than signed without it. The last party to complete moves the envelope to SEALING.",
        "security": [
          {
            "signingSession": []
          }
        ],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Complete"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The signature, and what the envelope is still waiting on",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompleteResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED, AUTH_REQUIRED, OTP_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PRESENTED_HASH_MISMATCH, FIELD_NOT_FILLABLE, DOCUMENT_NOT_READY, PARTY_ALREADY_COMPLETED, SIGNING_CLOSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "OTP_EXPIRED, LINK_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED, REQUIRED_FIELD_MISSING, AUTH_UNSUPPORTED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign/session/challenge": {
      "post": {
        "summary": "Send a one-time passcode",
        "description": "For a party whose accessAuth (purpose ACCESS) or actionAuth (purpose ACTION) includes EMAIL_OTP. A six-digit code is emailed to the party before this returns; it is never in the response. It works once, for ten minutes and five attempts, and a new challenge replaces the earlier one. At most five per party per hour. Answer ACCESS at POST /sign/session/verify, and ACTION in actionAuth at complete.",
        "security": [
          {
            "signingSession": []
          }
        ],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChallengeRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The code was sent; where to, masked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChallengeResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SIGNING_CLOSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "LINK_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "OTP_DELIVERY_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign/session/verify": {
      "post": {
        "summary": "Answer a one-time passcode for access",
        "description": "Satisfies EMAIL_OTP in the party's accessAuth for this session. Until every access requirement is met, the other signing endpoints answer AUTH_REQUIRED. A wrong code is OTP_INVALID; one past its ten minutes is OTP_EXPIRED.",
        "security": [
          {
            "signingSession": []
          }
        ],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyChallenge"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What is still outstanding, if anything",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyChallengeResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED, OTP_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SIGNING_CLOSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "OTP_EXPIRED, LINK_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign/session/decline": {
      "post": {
        "summary": "Decline, as the party themselves",
        "description": "The reason is optional here and required when an owner declines on somebody's behalf: a signer refusing in the signing view has already demonstrated they saw the document, so the record of their own act stands on its own. No actionAuth is required: a signer who cannot satisfy an OTP challenge would otherwise be left choosing between signing and going silent, and authentication guards the act that creates an obligation, not the one that declines to. Any party declining halts the envelope, so this moves it to DECLINED and ends every live session on it. A role with nothing to refuse (CC, VIEWER) is VALIDATION_FAILED, and a decision already made is SIGNING_CLOSED rather than remade.",
        "security": [
          {
            "signingSession": []
          }
        ],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionDecline"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The refusal, and the envelope it halted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionDeclineResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SIGNING_CLOSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "LINK_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign/session/document": {
      "get": {
        "summary": "One document this party is shown",
        "description": "One item per call: itemId names it, from the items GET /sign/session/envelope lists, and may be left out only when this party was shown one document. Left out when there are several, the call is VALIDATION_FAILED rather than an answer with whichever comes first. Returned as bytes, not as a link: a presigned URL would be a second credential with its own lifetime and its own answer to who may fetch this, and none of those answers would be the session's. Content-Disposition is inline with a filename, and no header, meta tag or viewer parameter asks a client to disable download, print or copy, and there is no configuration that turns it off. A canSign:false session still gets the document, because a completed signer reopening their link to save a copy is exercising the retention right UETA §8(b) rests on. x-item-sha256 is this item's hash, to check the bytes received. It is not what the client echoes at complete: that is the session's hashPresented, which covers every document shown.",
        "security": [
          {
            "signingSession": []
          }
        ],
        "parameters": [
          {
            "name": "itemId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The document",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "x-item-sha256": {
                "description": "SHA-256 of these bytes: this item's presented revision",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "DOCUMENT_NOT_READY, SIGNING_CLOSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "LINK_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign/session/view-progress": {
      "post": {
        "summary": "Report which pages of an item this party has seen",
        "description": "The client reports observations; whether they satisfy the requirement is the server's judgement, and allItemsViewed in the response is what gates the signing control. Cumulative and idempotent: posting pages 1-3 twice is the same state as posting them once, and posting page 2 alone never retracts 1 and 3. There is deliberately no endpoint that lowers view progress. acknowledgedAll is an explicit acknowledgement, accepted as an alternative to page tracking: recorded as that, and distinguishable in the trail from pages actually turned. A page outside the item's range is PAGE_OUT_OF_RANGE rather than silently dropped. An item with no page count has no denominator and can complete only on an acknowledgement.",
        "security": [
          {
            "signingSession": []
          }
        ],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ViewProgress"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "This item's progress, every item's, and whether the gate is met",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewProgressResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SIGNING_CLOSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "LINK_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED, PAGE_OUT_OF_RANGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign/session/acknowledge": {
      "post": {
        "summary": "Acknowledge receipt of one item",
        "description": "Certified delivery and supplemental documents are the same mechanism: this party must acknowledge this thing, and the acknowledgement is the evidence. The client echoes the hash of what it displayed, and a mismatch is PRESENTED_HASH_MISMATCH with no reconciliation path: an acknowledgement of a document other than the one on screen is worse than no acknowledgement, because it looks like evidence. The server compares against what it presented to **this party**, not the item's current revision: per-party visibility and correction both mean those can differ, and the current one is the one nobody may have seen. A repeat returns the original, with its original timestamp: the row is evidence and a second click is not a second acknowledgement. **This is not a signature**: it records receipt, carries no intent to be bound, and does not satisfy a must-view requirement. Accepting receipt of something without reading it is exactly what certified delivery records, so the two facts are kept apart.",
        "security": [
          {
            "signingSession": []
          }
        ],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcknowledgeItem"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The acknowledgement, with the revision and hash it names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcknowledgeResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "DOCUMENT_NOT_READY, PRESENTED_HASH_MISMATCH",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "LINK_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign/session/disclosure/ack": {
      "post": {
        "summary": "Acknowledge a disclosure",
        "description": "Records that this party said they had read a disclosure. Separate from consent because it is a different act: acknowledging an intent statement or a set of terms is not granting E-Sign consent, which additionally requires the demonstration of access. The client echoes the disclosure's hash and a mismatch is DISCLOSURE_HASH_MISMATCH: a disclosure is never edited in place, so differing hashes mean a stale client rather than a revision. Not gated on canSign: reading is not an act that creates an obligation.",
        "security": [
          {
            "signingSession": []
          }
        ],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisclosureAck"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was acknowledged, and which version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisclosureAckResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "DISCLOSURE_HASH_MISMATCH, SIGNING_CLOSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "LINK_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign/session/consent": {
      "post": {
        "summary": "Grant E-Sign consent",
        "description": "demonstrationEventId is required wherever the envelope is consumer-facing, and refusing without it is the point: ESIGN §7001(c)(1)(C) requires consent given in a manner that reasonably demonstrates the consumer can access information in the electronic form that will actually be used. A checkbox on an HTML page demonstrates nothing about PDF access capability, so there is no request shape in which one stands in for the demonstration. B2B envelopes still record consent (an explicit agreement to transact electronically satisfies UETA §5(b)) and there the demonstration may be null. Withdrawal is not this endpoint's inverse; a person withdrawing consent is not mid-signature, so it lives on the account surface.",
        "security": [
          {
            "signingSession": []
          }
        ],
        "x-no-idempotency-key": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GrantConsent"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The consent that was recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GrantConsentResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "DISCLOSURE_HASH_MISMATCH, SIGNING_CLOSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "LINK_EXPIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED, CONSENT_DEMONSTRATION_MISSING",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/fields": {
      "post": {
        "summary": "Place fields on a draft",
        "description": "Batch by default: a twenty-field envelope should be two calls, not twenty-one. A field names its party and its item by ID, and both must belong to the envelope in the path: a field pointing at another envelope's party is a signature box assigned to someone who was never sent this document. page >= 1 is enforced; that the page is within the document is not, because pageCount is not yet populated.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddFields"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The fields as placed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldList"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Move or change fields on a draft",
        "description": "Keyed by field ID. Moving a field to another party is ordinary: it is the most common correction in an editor. Geometry changes as a whole: x, y, w and h are sent together, because the bounds rule relates x to w and y to h.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFields"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The fields as they now stand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldList"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove fields from a draft",
        "description": "IDs in the request body. A body on DELETE is deliberate: a query string grows past what proxies and access logs handle for a fifty-field deletion, and a POST that means delete lies about the method to work around a transport limit. An ID not on the envelope is NOT_FOUND rather than ignored, so a caller who mistypes one is told.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteFields"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldRemoval"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/audit": {
      "get": {
        "summary": "Read the audit trail",
        "description": "Ascending by seq, oldest first: unlike every other list here, because a trail is a narrative. Every record carries prevHash and recordHash: withholding them would make the trail unverifiable by the person it exists to convince. The cursor is the seq itself, which is gapless and ordered by construction. verification reports what was actually checked (each record against its own hash, and seq contiguity) and is scoped to the PAGE. It is NOT whole-chain verification: the chain is per organisation, so one envelope's records are a subsequence of it with legitimate gaps in globalSeq. Use the evidence package and the offline verifier for the full claim. Reading the trail writes audit.accessed into it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the trail, with what was verified about it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditPage"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/evidence-package": {
      "post": {
        "summary": "Build the evidence package",
        "description": "A ZIP containing the audit trail as canonical JSON, every revision, the certificates and RFC 3161 tokens held for this envelope, a manifest listing each file with its SHA-256, and a README written for a lawyer. What the specified package asks for and this build cannot produce is listed by name in the manifest and repeated in the README, because a package that quietly omits something looks complete to whoever receives it. No size ceiling: this is what the audit export points at when a trail is too large to return as JSON, so a limit here would leave the largest envelopes with no way out. The archive SHA-256 is published in x-evidence-sha256 so an FRE 902(14) certification is a copy-paste exercise.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-no-idempotency-key": true,
        "responses": {
          "200": {
            "description": "The package",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "x-evidence-sha256": {
                "description": "SHA-256 of the archive",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN, INSUFFICIENT_SCOPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/audit/export": {
      "get": {
        "summary": "Export the whole trail",
        "description": "The complete trail as one RFC 8785 canonical JSON document: byte-reproducible, so two exports of an unchanged trail are identical and the ETag (the export's own SHA-256) is a single value standing for the entire trail. Carries the same verification claim and the same limits as the paginated read, with scope ENVELOPE: still one envelope's subsequence of a per-organisation chain, so linkage needs the evidence package. A trail too large to serve is EXPORT_TOO_LARGE rather than truncated: a truncated export that still looks like an export is a forgery waiting to be quoted in a filing. The human-readable PDF is not built yet.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The trail, canonically serialised",
            "headers": {
              "etag": {
                "description": "The export's SHA-256, quoted.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditExport"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "EXPORT_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/items/{itemId}": {
      "patch": {
        "summary": "Rename or move an item",
        "description": "Positions stay dense and ordered from zero: moving the third document to the front renumbers the two it passed. A caller supplies only the position they want and never has to know the others changed, which is why the whole list comes back. A position past the end means last.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ItemPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Every item, in its new order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ItemList"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove an item from a draft",
        "description": "The item's fields go with it and the response says how many. The upload behind it is released only where no revision outside this item references the same object, because a copy of the envelope points at the same bytes. Removing the last item is allowed: an envelope with no documents is a legitimate draft, and \"at least one document\" is a distribute precondition.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "responses": {
          "200": {
            "description": "What was removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ItemRemoval"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/items/{itemId}/download": {
      "get": {
        "summary": "Download an item",
        "description": "Serves the bytes of one revision. stage picks which; omitted, it serves the item's current revision: the most complete version that exists. Download is never inhibited: no response carries a header, wrapper or content type intended to prevent saving, printing or copying, because UETA 8(b) makes a record unenforceable against a recipient whose ability to print or store it was inhibited. The ETag is the revision's recorded SHA-256, so a caller can check what they received without a second call. A stage nobody has produced is NOT_FOUND rather than an empty body.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ORIGINAL",
                "PREPARED",
                "SIGNED",
                "SEALED"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The document bytes",
            "headers": {
              "etag": {
                "description": "The revision's recorded SHA-256, quoted.",
                "schema": {
                  "type": "string"
                }
              },
              "content-disposition": {
                "description": "attachment, with the item filename quoted.",
                "schema": {
                  "type": "string"
                }
              },
              "x-esign-revision-stage": {
                "description": "Which stage was actually served.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SEALING_IN_PROGRESS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/certificate": {
      "get": {
        "summary": "Download the completion certificate",
        "description": "A PDF that states who signed, when, how each signer was identified, the hash of what each was shown, the sealed document's hash and the audit chain head. It is built once, by the seal, before the envelope is COMPLETED, and sealed and timestamped the way the document is; it is never rebuilt on request. Its SHA-256 is in the envelope.completed audit record and is the ETag here. Before completion there is none, and the answer is NOT_FOUND.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The certificate bytes",
            "headers": {
              "etag": {
                "description": "The certificate's recorded SHA-256, quoted.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/fields/prefill": {
      "post": {
        "summary": "Supply values before sending",
        "description": "Owner-supplied values: a reference number the signer should not have to type, a date the sender already knows. A signature can never be prefilled: SIGNATURE, FREE_SIGNATURE, INITIALS and STAMP are FIELD_NOT_PREFILLABLE, always, because a value the owner supplied is not the party's assent. A prefilled field is not a completed one: filledAt and filledByPartyId stay null. The value must fit the field's type, and a choice must select from the options the field declares.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrefillFields"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many fields were set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrefillResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL, FIELD_NOT_PREFILLABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/fields/values": {
      "get": {
        "summary": "Read collected values",
        "description": "Available in any state, not only after completion: an owner who cannot read back what they prefilled has no way to confirm it, and the values of a partially-signed envelope are what a sender chasing a stalled signature needs. Each entry says whether the value was PREFILLED by the owner or COMPLETED by a party, because those are different claims and the value alone does not say which.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The values collected so far",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldValues"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/parties": {
      "post": {
        "summary": "Add parties to a draft",
        "description": "Batch by default. A witness names the party it witnesses by index within this request, or by ID when that party is already on the envelope: one form per party, never both. Role obligations are checked against the party set the request would produce, so an addition can be refused because of a party the request does not mention. Structural, so ENVELOPE_NOT_DRAFT applies.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddParties"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The parties as created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartyList"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Change parties on a draft",
        "description": "Keyed by party ID. role is changeable (a recipient who should have been an approver is an ordinary correction) and the obligations are re-checked against the resulting party set, so changing a SIGNER to a CC is refused when a WITNESS attests to it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateParties"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The parties as they now stand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartyList"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/parties/{partyId}": {
      "delete": {
        "summary": "Remove a party from a draft",
        "description": "The party's fields go with it (a field is owned by exactly one party) and the response says how many, because a caller who deletes a recipient and silently loses eleven field placements has been surprised by their own request. A party another party witnesses cannot be removed: PARTY_IS_WITNESSED.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "partyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "responses": {
          "200": {
            "description": "What was removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartyRemoval"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL, PARTY_IS_WITNESSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/jobs/{jobId}": {
      "get": {
        "summary": "Watch an asynchronous operation",
        "description": "The completion channel for the operations that return 202. The scope required is the scope that started the job: evidence_package needs evidence:export, bulk_send needs envelopes:send. Every other kind (seal, reminder, anchor, re-timestamp, integrity sweep, purge) is internal machinery and is not addressable here: a request for one is NOT_FOUND, not FORBIDDEN, because its existence is not part of this contract. A job outside the caller's tenancy is NOT_FOUND for the same reason.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/duplicate": {
      "post": {
        "summary": "Copy an envelope to a new draft",
        "description": "Reads the source and creates a new DRAFT of the same type; the source is never modified, so its state does not constrain the call and neither ENVELOPE_NOT_DRAFT nor ENVELOPE_TERMINAL is returned. Items are copied from the ORIGINAL revision, never a signed one. externalId is never inherited.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CopyEnvelope"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new draft",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDetail"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_KEY_REUSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/save-as-template": {
      "post": {
        "summary": "Copy a document to a new template",
        "description": "As duplicate, but the result is a TEMPLATE. ENVELOPE_TYPE_MISMATCH if the source is already a template: duplicating a template is spelled duplicate.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CopyEnvelope"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDetail"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_TYPE_MISMATCH, IDEMPOTENCY_KEY_REUSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/instantiate": {
      "post": {
        "summary": "Create a document from a template",
        "description": "As duplicate, but the source must be a TEMPLATE and the result is a DOCUMENT. ENVELOPE_TYPE_MISMATCH if the source is a document.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CopyEnvelope"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeDetail"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_TYPE_MISMATCH, IDEMPOTENCY_KEY_REUSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/prepare": {
      "post": {
        "summary": "Run the prepare stage",
        "description": "DRAFT only. An explicit call rather than something distribute does on the way past: hiding it there puts a slow, failure-prone transformation inside a call whose failure a caller reads as \"my envelope was not sent\". Each of the four steps is conditional on the document, and a PDF with no AcroForm needs none of them: its PREPARED revision carries the same bytes as ORIGINAL, referencing the same immutable object. A document that needs a step this deployment cannot perform is PREPARATION_UNSUPPORTED, naming the step, rather than passed through: marking an unflattened form as PREPARED means signing a document whose field values a later editor can still change. Nothing is written unless every item can be prepared.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "responses": {
          "200": {
            "description": "What preparing did, per item",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrepareResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED, PREPARATION_UNSUPPORTED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/distribute": {
      "post": {
        "summary": "Send for signing",
        "description": "A DRAFT document only: a TEMPLATE is instantiated, never sent (ENVELOPE_TYPE_MISMATCH). Every precondition is reported at once rather than one refusal per request: at least one SIGNER or APPROVER, every SIGNER with a signature field, every field pointing at a party and document on this envelope, and every document carrying a PREPARED revision from POST .../prepare. Party tokens are returned only for method \"NONE\", for the caller to distribute; they are returned once and only their hashes are stored, so a caller who loses a link resends rather than looks it up. method \"EMAIL\" queues an invitation to each party and returns no links: each link is minted when its email is sent, and exists only in that email. partyExpiryDays is where a deadline is set: it becomes parties.expiresAt = sentAt + days here, computed once against the moment of sending. Omitted means no deadline, which is the system default: a default deadline would be this system deciding when a customer's contracts stop being signable. signingOrderMode SEQUENTIAL enforces each party's signingOrder: only the first step is contacted now, and each later step when the one before it completes. Parties sharing a number sign together. Under NONE every link is returned at once with turnArrived, and a link whose turn has not arrived is refused with SIGNING_ORDER_VIOLATION until it has. reminders sets a schedule, EMAIL only: the first firstAfterHours after a party is invited, then every repeatEveryHours (at least 24), for 30 days from sending, to parties who have not finished and whose turn has arrived. Each reminder carries a new link, and earlier links stop working. Absent means no reminders.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Distribute"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Distributed, with the signing links where method is NONE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DistributeResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL, ENVELOPE_TYPE_MISMATCH, IDEMPOTENCY_KEY_REUSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED, NOT_READY_TO_DISTRIBUTE, DELIVERY_UNSUPPORTED, DOCUMENT_TYPE_INELIGIBLE, SIGNATURE_TIER_INSUFFICIENT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/parties/{partyId}/extend-expiry": {
      "post": {
        "summary": "Move a party's deadline later",
        "description": "An absolute timestamp, never a duration: \"extend by seven days\" has two plausible bases (from now, or from the deadline they already have) and they differ by however long the request sat in an inbox. It may only move later, because a deadline someone was told about is a promise and taking time back is a different act. A party with no deadline cannot be extended into having one: that is a restriction wearing the name of a grant. An EXPIRED party can be extended and returns to PENDING: the ordinary case, since a signer who missed the deadline is exactly who asks for more time; party.expired stays in the trail beside it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "partyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtendExpiry"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The deadline before and after",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtendExpiryResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL, PARTY_ALREADY_COMPLETED, SIGNING_CLOSED, IDEMPOTENCY_KEY_REUSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/parties/{partyId}/resend": {
      "post": {
        "summary": "Issue a party a fresh signing link",
        "description": "The endpoint an EMAIL-delivered caller has instead of a link: distribute returns none for such a party, because the token is minted in the sending process and lands only in the inbox. Resend necessarily issues a NEW token and the previous link stops working. That is not a policy choice: nothing in the system can reproduce the old one. What it does with the new token follows the envelope: an EMAIL envelope queues the same invitation job distribute writes and returns no url (delivery \"QUEUED\": nothing has left the building yet); a NONE envelope mints and returns the link, as distribute did, because that caller took custody. A party that was never given a link (CC, VIEWER) has none to resend, and a COMPLETED, DECLINED or EXPIRED party is refused: a fresh token for an expired party is a link that looks live and is rejected the moment it is used. Under sequential routing an EMAIL resend to a party whose turn has not arrived is SIGNING_ORDER_VIOLATION: that is somebody the sender chose not to contact yet.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "partyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "responses": {
          "200": {
            "description": "What was done, and the link when the caller holds custody",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResendResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL, PARTY_ALREADY_COMPLETED, SIGNING_CLOSED, SIGNING_ORDER_VIOLATION, IDEMPOTENCY_KEY_REUSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/parties/{partyId}/signing-link": {
      "get": {
        "summary": "The state of a party's signing link",
        "description": "A party token is generated at distribute, returned once, and never stored: only its hash. There is therefore no URL to return here, and a signingLink field would have to be either a lie or a re-issue disguised as a read. What this answers is the question an operator actually asks: whether a token was issued, when it expires, whether the party has opened it, and whether it would work right now. A consequence worth knowing: resend cannot send the same link, because nothing in the system can produce it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "partyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Whether this party has a live link, and until when",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigningLinkState"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/parties/{partyId}/decline": {
      "post": {
        "summary": "Record a refusal on a party's behalf",
        "description": "For a refusal the owner learned out of band: the signer telephoned, emailed, or said so in a meeting. Works on a party who has not opened their link, which the party's own decline does not. The reason is required here and optional when a party declines for themselves: an owner asserting somebody else's refusal is making a claim about another person, and it is worth little without saying what it rests on. Declining halts the envelope (any party declining moves it to DECLINED) so this terminates the whole thing, not one party's participation. A CC or VIEWER has nothing to refuse (VALIDATION_FAILED), and a party already in a terminal status is not re-decided by asserting it again.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "partyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeclineParty"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Declined, with the envelope it halted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeclineResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL, PARTY_ALREADY_COMPLETED, SIGNING_CLOSED, IDEMPOTENCY_KEY_REUSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/envelopes/{id}/cancel": {
      "post": {
        "summary": "Cancel a pending envelope",
        "description": "PENDING only: the owner's half of the state machine's three exits from it. A DRAFT has asked nobody for anything, so the operation on one is DELETE; a terminal envelope has already stopped. Party statuses are left exactly as they are: a party who opened the document did open it, and rewriting that would make the record say something false about what a person did. Party tokens are not destroyed either: the envelope status is what refuses them. Live signing sessions are ended in the same transaction, and nothing already signed is undone: CANCELLED still permits a partial download.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Scoped to (organisation, key), TTL 24 hours. Replaying with the same body returns the original response with Idempotency-Replayed: true; a different body returns 409 IDEMPOTENCY_KEY_REUSED."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelEnvelope"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancelled, with the number of signing sessions ended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ENVELOPE_NOT_DRAFT, ENVELOPE_TERMINAL, IDEMPOTENCY_KEY_REUSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  }
}
