{
  "components": {
    "schemas": {
      "BulkRowIn": {
        "properties": {
          "form_values": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Prefills keyed by field name, or by field index as a string.",
            "title": "Form Values",
            "type": "object"
          },
          "recipients": {
            "description": "One entry per template placeholder, in signing position: {name, email, auth_level?}.",
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Recipients",
            "type": "array"
          }
        },
        "required": [
          "recipients"
        ],
        "title": "BulkRowIn",
        "type": "object"
      },
      "BulkRowOut": {
        "properties": {
          "delivery_state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery State"
          },
          "document_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Id"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "recipients": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Recipients",
            "type": "array"
          },
          "row_no": {
            "title": "Row No",
            "type": "integer"
          },
          "sent_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sent At"
          },
          "status": {
            "enum": [
              "invalid",
              "queued",
              "sending",
              "sent",
              "failed",
              "canceled"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "row_no",
          "status",
          "recipients"
        ],
        "title": "BulkRowOut",
        "type": "object"
      },
      "BulkSendOut": {
        "properties": {
          "canceled_count": {
            "title": "Canceled Count",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "dispatched_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dispatched At"
          },
          "failed_count": {
            "title": "Failed Count",
            "type": "integer"
          },
          "finished_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "mode": {
            "enum": [
              "live",
              "test"
            ],
            "title": "Mode",
            "type": "string"
          },
          "review_flagged": {
            "title": "Review Flagged",
            "type": "boolean"
          },
          "row_count": {
            "title": "Row Count",
            "type": "integer"
          },
          "rows": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/BulkRowOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rows"
          },
          "sent_count": {
            "title": "Sent Count",
            "type": "integer"
          },
          "source_filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Filename"
          },
          "status": {
            "enum": [
              "draft",
              "invalid",
              "ready",
              "dispatching",
              "done",
              "failed",
              "canceled"
            ],
            "title": "Status",
            "type": "string"
          },
          "template_id": {
            "title": "Template Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "template_id",
          "mode",
          "row_count",
          "status",
          "sent_count",
          "failed_count",
          "canceled_count",
          "review_flagged",
          "created_at"
        ],
        "title": "BulkSendOut",
        "type": "object"
      },
      "BulkSendPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/BulkSendOut"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "BulkSendPage",
        "type": "object"
      },
      "CreateBulkSendIn": {
        "properties": {
          "rows": {
            "items": {
              "$ref": "#/components/schemas/BulkRowIn"
            },
            "minItems": 1,
            "title": "Rows",
            "type": "array"
          },
          "source_filename": {
            "anyOf": [
              {
                "maxLength": 300,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Filename"
          },
          "template_id": {
            "description": "A tpl_… id.",
            "title": "Template Id",
            "type": "string"
          }
        },
        "required": [
          "template_id",
          "rows"
        ],
        "title": "CreateBulkSendIn",
        "type": "object"
      },
      "CreateDocumentReq": {
        "properties": {
          "date_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date Format"
          },
          "display_timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Timezone"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/FieldSpec"
            },
            "title": "Fields",
            "type": "array"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "recipients": {
            "items": {
              "$ref": "#/components/schemas/RecipientSpec"
            },
            "title": "Recipients",
            "type": "array"
          },
          "redirect_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Redirect Url"
          },
          "reminder_cadence_days": {
            "anyOf": [
              {
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reminder Cadence Days"
          },
          "title": {
            "maxLength": 300,
            "minLength": 1,
            "title": "Title",
            "type": "string"
          },
          "visibility": {
            "default": "everyone",
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "title": "CreateDocumentReq",
        "type": "object"
      },
      "CreateKeyReq": {
        "properties": {
          "mode": {
            "default": "live",
            "pattern": "^(live|test)$",
            "title": "Mode",
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "CreateKeyReq",
        "type": "object"
      },
      "CreateTemplateIn": {
        "properties": {
          "fields": {
            "items": {
              "$ref": "#/components/schemas/FieldSpec"
            },
            "title": "Fields",
            "type": "array"
          },
          "name": {
            "maxLength": 300,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "pdf_base64": {
            "title": "Pdf Base64",
            "type": "string"
          },
          "recipients": {
            "items": {
              "$ref": "#/components/schemas/RecipientSpec"
            },
            "title": "Recipients",
            "type": "array"
          }
        },
        "required": [
          "name",
          "pdf_base64"
        ],
        "title": "CreateTemplateIn",
        "type": "object"
      },
      "CreateWebhookReq": {
        "properties": {
          "events": {
            "items": {
              "type": "string"
            },
            "title": "Events",
            "type": "array"
          },
          "url": {
            "maxLength": 2000,
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "title": "CreateWebhookReq",
        "type": "object"
      },
      "DeliveryOut": {
        "properties": {
          "attempt": {
            "title": "Attempt",
            "type": "integer"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "delivered_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At"
          },
          "event_type": {
            "title": "Event Type",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "next_retry_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Retry At"
          },
          "response_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Code"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "event_type",
          "status",
          "attempt",
          "created_at"
        ],
        "title": "DeliveryOut",
        "type": "object"
      },
      "DeviceCodeOut": {
        "properties": {
          "device_code": {
            "title": "Device Code",
            "type": "string"
          },
          "expires_in": {
            "title": "Expires In",
            "type": "integer"
          },
          "interval": {
            "title": "Interval",
            "type": "integer"
          },
          "user_code": {
            "title": "User Code",
            "type": "string"
          },
          "verification_uri": {
            "title": "Verification Uri",
            "type": "string"
          },
          "verification_uri_complete": {
            "title": "Verification Uri Complete",
            "type": "string"
          }
        },
        "required": [
          "device_code",
          "user_code",
          "verification_uri",
          "verification_uri_complete",
          "expires_in",
          "interval"
        ],
        "title": "DeviceCodeOut",
        "type": "object"
      },
      "DeviceCodeReq": {
        "properties": {
          "client": {
            "description": "e.g. senv",
            "pattern": "^[a-z][a-z0-9-]{0,31}$",
            "title": "Client",
            "type": "string"
          },
          "client_version": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Version"
          },
          "mode": {
            "default": "live",
            "enum": [
              "live",
              "test"
            ],
            "title": "Mode",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name for the key the human approves",
            "title": "Name"
          }
        },
        "required": [
          "client"
        ],
        "title": "DeviceCodeReq",
        "type": "object"
      },
      "DeviceTokenOut": {
        "properties": {
          "api_key": {
            "title": "Api Key",
            "type": "string"
          },
          "display": {
            "title": "Display",
            "type": "string"
          },
          "key_id": {
            "format": "uuid",
            "title": "Key Id",
            "type": "string"
          },
          "mode": {
            "title": "Mode",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "tenant_slug": {
            "title": "Tenant Slug",
            "type": "string"
          }
        },
        "required": [
          "api_key",
          "key_id",
          "display",
          "mode",
          "name",
          "tenant_slug"
        ],
        "title": "DeviceTokenOut",
        "type": "object"
      },
      "DeviceTokenReq": {
        "properties": {
          "device_code": {
            "maxLength": 128,
            "minLength": 16,
            "title": "Device Code",
            "type": "string"
          }
        },
        "required": [
          "device_code"
        ],
        "title": "DeviceTokenReq",
        "type": "object"
      },
      "DocumentAwaitingUpload": {
        "description": "`GET /documents/{id}` for a draft whose PDF has not been finalized.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "status": {
            "const": "awaiting_upload",
            "title": "Status",
            "type": "string"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "required": [
          "id",
          "status"
        ],
        "title": "DocumentAwaitingUpload",
        "type": "object"
      },
      "DocumentDraftOut": {
        "properties": {
          "expiresAt": {
            "format": "date-time",
            "title": "Expiresat",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "status": {
            "default": "awaiting_upload",
            "title": "Status",
            "type": "string"
          },
          "uploadUrl": {
            "title": "Uploadurl",
            "type": "string"
          }
        },
        "required": [
          "id",
          "uploadUrl",
          "expiresAt"
        ],
        "title": "DocumentDraftOut",
        "type": "object"
      },
      "DocumentOut": {
        "properties": {
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "date_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date Format"
          },
          "delivery_problem": {
            "default": false,
            "title": "Delivery Problem",
            "type": "boolean"
          },
          "display_timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Timezone"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/FieldOut"
            },
            "title": "Fields",
            "type": "array"
          },
          "folder_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Folder Id"
          },
          "id": {
            "description": "Public document id, `doc_…`",
            "title": "Id",
            "type": "string"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "mode": {
            "default": "live",
            "enum": [
              "live",
              "test"
            ],
            "title": "Mode",
            "type": "string"
          },
          "original_sha256": {
            "title": "Original Sha256",
            "type": "string"
          },
          "recipients": {
            "items": {
              "$ref": "#/components/schemas/RecipientOut"
            },
            "title": "Recipients",
            "type": "array"
          },
          "redirect_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Redirect Url"
          },
          "reminder_cadence_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reminder Cadence Days"
          },
          "seal_profile": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seal Profile"
          },
          "sealed": {
            "default": false,
            "title": "Sealed",
            "type": "boolean"
          },
          "sent_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sent At"
          },
          "size_bytes": {
            "title": "Size Bytes",
            "type": "integer"
          },
          "source_template_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Template Id"
          },
          "status": {
            "enum": [
              "draft",
              "sent",
              "partially_signed",
              "completed",
              "voided",
              "rejected",
              "expired"
            ],
            "title": "Status",
            "type": "string"
          },
          "team_id": {
            "format": "uuid",
            "title": "Team Id",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "visibility": {
            "enum": [
              "everyone",
              "managers"
            ],
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "id",
          "team_id",
          "title",
          "status",
          "original_sha256",
          "size_bytes",
          "visibility",
          "created_at"
        ],
        "title": "DocumentOut",
        "type": "object"
      },
      "DocumentPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/DocumentOut"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "DocumentPage",
        "type": "object"
      },
      "DuplicateDocumentIn": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "maxLength": 300,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "DuplicateDocumentIn",
        "type": "object"
      },
      "DuplicateTemplateIn": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "maxLength": 300,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "title": "DuplicateTemplateIn",
        "type": "object"
      },
      "EnvelopePatch": {
        "description": "Post-create mutable surface: display prefs, folder, visibility.\nStructural changes (recipients/fields) go through their own setters and\nare draft-only.",
        "properties": {
          "clear_folder": {
            "default": false,
            "title": "Clear Folder",
            "type": "boolean"
          },
          "date_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date Format"
          },
          "display_timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Timezone"
          },
          "folder_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Folder Id"
          },
          "redirect_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Redirect Url"
          },
          "reminder_cadence_days": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reminder Cadence Days"
          },
          "visibility": {
            "anyOf": [
              {
                "enum": [
                  "everyone",
                  "managers"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Visibility"
          }
        },
        "title": "EnvelopePatch",
        "type": "object"
      },
      "Envelopes": {
        "properties": {
          "allowance": {
            "title": "Allowance",
            "type": "integer"
          },
          "remaining": {
            "title": "Remaining",
            "type": "integer"
          },
          "resets_on": {
            "title": "Resets On",
            "type": "string"
          },
          "used": {
            "title": "Used",
            "type": "integer"
          }
        },
        "required": [
          "allowance",
          "used",
          "remaining",
          "resets_on"
        ],
        "title": "Envelopes",
        "type": "object"
      },
      "EventOut": {
        "properties": {
          "actor": {
            "additionalProperties": true,
            "title": "Actor",
            "type": "object"
          },
          "created_at_iso": {
            "title": "Created At Iso",
            "type": "string"
          },
          "envelope_id": {
            "title": "Envelope Id",
            "type": "string"
          },
          "event_type": {
            "title": "Event Type",
            "type": "string"
          },
          "hash": {
            "title": "Hash",
            "type": "string"
          },
          "ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip"
          },
          "payload": {
            "additionalProperties": true,
            "title": "Payload",
            "type": "object"
          },
          "payload_hash": {
            "title": "Payload Hash",
            "type": "string"
          },
          "prev_hash": {
            "title": "Prev Hash",
            "type": "string"
          },
          "seq": {
            "title": "Seq",
            "type": "integer"
          },
          "user_agent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Agent"
          }
        },
        "required": [
          "envelope_id",
          "seq",
          "event_type",
          "actor",
          "payload",
          "payload_hash",
          "created_at_iso",
          "prev_hash",
          "hash"
        ],
        "title": "EventOut",
        "type": "object"
      },
      "FairUse": {
        "properties": {
          "burst_rps": {
            "title": "Burst Rps",
            "type": "number"
          },
          "envelopes_per_day_review_threshold": {
            "default": 2000,
            "title": "Envelopes Per Day Review Threshold",
            "type": "integer"
          },
          "sustained_rps": {
            "title": "Sustained Rps",
            "type": "number"
          }
        },
        "required": [
          "sustained_rps",
          "burst_rps"
        ],
        "title": "FairUse",
        "type": "object"
      },
      "FieldOut": {
        "properties": {
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "envelope_id": {
            "title": "Envelope Id",
            "type": "string"
          },
          "h": {
            "title": "H",
            "type": "number"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "page": {
            "title": "Page",
            "type": "integer"
          },
          "prefill_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefill Value"
          },
          "read_only": {
            "title": "Read Only",
            "type": "boolean"
          },
          "recipient_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipient Id"
          },
          "required": {
            "title": "Required",
            "type": "boolean"
          },
          "settings": {
            "$ref": "#/components/schemas/FieldSettings"
          },
          "type": {
            "enum": [
              "signature",
              "initials",
              "name",
              "email",
              "date",
              "text",
              "number",
              "checkbox",
              "radio",
              "dropdown"
            ],
            "title": "Type",
            "type": "string"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          },
          "w": {
            "title": "W",
            "type": "number"
          },
          "x": {
            "title": "X",
            "type": "number"
          },
          "y": {
            "title": "Y",
            "type": "number"
          }
        },
        "required": [
          "id",
          "envelope_id",
          "recipient_id",
          "type",
          "page",
          "x",
          "y",
          "w",
          "h",
          "required",
          "read_only",
          "settings"
        ],
        "title": "FieldOut",
        "type": "object"
      },
      "FieldSettings": {
        "description": "F-12 field settings — enforced server-side at completion.",
        "properties": {
          "input_modes": {
            "anyOf": [
              {
                "items": {
                  "enum": [
                    "draw",
                    "type",
                    "upload"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Modes"
          },
          "max_length": {
            "anyOf": [
              {
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Length"
          },
          "max_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Value"
          },
          "min_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Value"
          },
          "options": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Options"
          },
          "pattern": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pattern"
          }
        },
        "title": "FieldSettings",
        "type": "object"
      },
      "FieldSpec": {
        "properties": {
          "h": {
            "exclusiveMinimum": 0.0,
            "maximum": 1.0,
            "title": "H",
            "type": "number"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 100,
                "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "page": {
            "minimum": 1.0,
            "title": "Page",
            "type": "integer"
          },
          "prefill_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefill Value"
          },
          "read_only": {
            "default": false,
            "title": "Read Only",
            "type": "boolean"
          },
          "recipient_index": {
            "minimum": 0.0,
            "title": "Recipient Index",
            "type": "integer"
          },
          "required": {
            "default": true,
            "title": "Required",
            "type": "boolean"
          },
          "settings": {
            "$ref": "#/components/schemas/FieldSettings"
          },
          "type": {
            "enum": [
              "signature",
              "initials",
              "name",
              "email",
              "date",
              "text",
              "number",
              "checkbox",
              "radio",
              "dropdown"
            ],
            "title": "Type",
            "type": "string"
          },
          "w": {
            "exclusiveMinimum": 0.0,
            "maximum": 1.0,
            "title": "W",
            "type": "number"
          },
          "x": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "X",
            "type": "number"
          },
          "y": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Y",
            "type": "number"
          }
        },
        "required": [
          "type",
          "recipient_index",
          "page",
          "x",
          "y",
          "w",
          "h"
        ],
        "title": "FieldSpec",
        "type": "object"
      },
      "FolderIn": {
        "properties": {
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "parent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Id"
          }
        },
        "required": [
          "name"
        ],
        "title": "FolderIn",
        "type": "object"
      },
      "FolderOut": {
        "properties": {
          "depth": {
            "description": "1 for a root folder; at most 5",
            "title": "Depth",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "parent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Id"
          }
        },
        "required": [
          "id",
          "name",
          "depth"
        ],
        "title": "FolderOut",
        "type": "object"
      },
      "FolderPatchIn": {
        "properties": {
          "move_to_root": {
            "default": false,
            "title": "Move To Root",
            "type": "boolean"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 120,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "parent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Id"
          }
        },
        "title": "FolderPatchIn",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "KeyCreated": {
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "display": {
            "title": "Display",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "mode": {
            "title": "Mode",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          }
        },
        "required": [
          "id",
          "name",
          "display",
          "mode",
          "key"
        ],
        "title": "KeyCreated",
        "type": "object"
      },
      "KeyOut": {
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "display": {
            "title": "Display",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "mode": {
            "title": "Mode",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          }
        },
        "required": [
          "id",
          "name",
          "display",
          "mode"
        ],
        "title": "KeyOut",
        "type": "object"
      },
      "Me": {
        "properties": {
          "band": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Band"
          },
          "envelopes": {
            "$ref": "#/components/schemas/Envelopes"
          },
          "fair_use": {
            "$ref": "#/components/schemas/FairUse"
          },
          "grace_until": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Grace Until"
          },
          "key_mode": {
            "title": "Key Mode",
            "type": "string"
          },
          "plan": {
            "title": "Plan",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_slug": {
            "title": "Tenant Slug",
            "type": "string"
          }
        },
        "required": [
          "tenant_slug",
          "status",
          "grace_until",
          "key_mode",
          "plan",
          "band",
          "envelopes",
          "fair_use"
        ],
        "title": "Me",
        "type": "object"
      },
      "PatchTemplateIn": {
        "description": "D54: every part given replaces the stored one; absent parts stay.",
        "properties": {
          "fields": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FieldSpec"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fields"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 300,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "recipients": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/RecipientSpec"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipients"
          }
        },
        "title": "PatchTemplateIn",
        "type": "object"
      },
      "PatchWebhookReq": {
        "description": "D58(a): every member optional; `active: true` re-enables a disabled\nendpoint (the only way back from `/disable` short of recreating it).",
        "properties": {
          "active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active"
          },
          "events": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Events"
          },
          "url": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "title": "PatchWebhookReq",
        "type": "object"
      },
      "PingOut": {
        "properties": {
          "event_id": {
            "title": "Event Id",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "event_id"
        ],
        "title": "PingOut",
        "type": "object"
      },
      "RecipientOut": {
        "properties": {
          "auth_level": {
            "enum": [
              "link",
              "otp",
              "account",
              "passkey"
            ],
            "title": "Auth Level",
            "type": "string"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "consent_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Consent At"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "email_normalized": {
            "title": "Email Normalized",
            "type": "string"
          },
          "envelope_id": {
            "title": "Envelope Id",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "reassigned_from": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reassigned From"
          },
          "reject_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reject Reason"
          },
          "rejected_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rejected At"
          },
          "role": {
            "enum": [
              "signer",
              "approver",
              "viewer",
              "cc"
            ],
            "title": "Role",
            "type": "string"
          },
          "signing_order": {
            "title": "Signing Order",
            "type": "integer"
          },
          "status": {
            "enum": [
              "pending",
              "sent",
              "opened",
              "completed",
              "rejected",
              "reassigned"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "envelope_id",
          "role",
          "name",
          "email",
          "email_normalized",
          "signing_order",
          "auth_level",
          "status"
        ],
        "title": "RecipientOut",
        "type": "object"
      },
      "RecipientSpec": {
        "properties": {
          "auth_level": {
            "default": "link",
            "enum": [
              "link",
              "otp",
              "account",
              "passkey"
            ],
            "title": "Auth Level",
            "type": "string"
          },
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "role": {
            "default": "signer",
            "enum": [
              "signer",
              "approver",
              "viewer",
              "cc"
            ],
            "title": "Role",
            "type": "string"
          },
          "signing_order": {
            "default": 1,
            "minimum": 1.0,
            "title": "Signing Order",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "email"
        ],
        "title": "RecipientSpec",
        "type": "object"
      },
      "RedeliverOut": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "status": {
            "const": "queued",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status"
        ],
        "title": "RedeliverOut",
        "type": "object"
      },
      "SendOut": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "status": {
            "const": "sent",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status"
        ],
        "title": "SendOut",
        "type": "object"
      },
      "SendReq": {
        "properties": {
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          }
        },
        "title": "SendReq",
        "type": "object"
      },
      "TemplateOut": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/FieldSpec"
            },
            "title": "Fields",
            "type": "array"
          },
          "id": {
            "description": "Public template id, `tpl_…`",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "recipients": {
            "items": {
              "$ref": "#/components/schemas/RecipientSpec"
            },
            "title": "Recipients",
            "type": "array"
          },
          "sha256": {
            "title": "Sha256",
            "type": "string"
          },
          "team_id": {
            "format": "uuid",
            "title": "Team Id",
            "type": "string"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "version": {
            "default": 1,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "team_id",
          "name",
          "sha256",
          "created_at"
        ],
        "title": "TemplateOut",
        "type": "object"
      },
      "TemplatePage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/TemplateOut"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "TemplatePage",
        "type": "object"
      },
      "UseTemplateIn": {
        "properties": {
          "date_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date Format"
          },
          "display_timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Timezone"
          },
          "form_values": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Prefill values keyed by field name, or by field index as a string in the template's field order (\"0\", \"1\", …). An unknown key fails the request with 422.",
            "title": "Form Values",
            "type": "object"
          },
          "recipients": {
            "items": {
              "$ref": "#/components/schemas/RecipientSpec"
            },
            "title": "Recipients",
            "type": "array"
          },
          "redirect_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Redirect Url"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "required": [
          "recipients"
        ],
        "title": "UseTemplateIn",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "VoidOut": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "status": {
            "const": "voided",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status"
        ],
        "title": "VoidOut",
        "type": "object"
      },
      "VoidReq": {
        "properties": {
          "reason": {
            "maxLength": 1000,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "title": "VoidReq",
        "type": "object"
      },
      "WebhookCreated": {
        "properties": {
          "active": {
            "title": "Active",
            "type": "boolean"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "title": "Events",
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "previous_secret_expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Secret Expires At"
          },
          "secret": {
            "title": "Secret",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "active",
          "secret"
        ],
        "title": "WebhookCreated",
        "type": "object"
      },
      "WebhookOut": {
        "properties": {
          "active": {
            "title": "Active",
            "type": "boolean"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "title": "Events",
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "previous_secret_expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Secret Expires At"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "active"
        ],
        "title": "WebhookOut",
        "type": "object"
      }
    }
  },
  "info": {
    "description": "The SignEnvoy public REST API. Authenticate with an API key: `Authorization: Bearer senv_live_…`.",
    "title": "SignEnvoy API",
    "version": "1.3.0-m4"
  },
  "openapi": "3.1.0",
  "paths": {
    "/bulk-sends": {
      "get": {
        "operationId": "list_bulk_sends_bulk_sends_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkSendPage"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Bulk Sends",
        "tags": [
          "bulk-sends"
        ]
      },
      "post": {
        "operationId": "create_bulk_send_bulk_sends_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBulkSendIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkSendOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Bulk Send",
        "tags": [
          "bulk-sends"
        ]
      }
    },
    "/bulk-sends/{bulk_send_id}": {
      "get": {
        "operationId": "get_bulk_send_bulk_sends__bulk_send_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "bulk_send_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Bulk Send Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkSendOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Bulk Send",
        "tags": [
          "bulk-sends"
        ]
      }
    },
    "/bulk-sends/{bulk_send_id}/cancel": {
      "post": {
        "operationId": "cancel_bulk_send_bulk_sends__bulk_send_id__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "bulk_send_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Bulk Send Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkSendOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Cancel Bulk Send",
        "tags": [
          "bulk-sends"
        ]
      }
    },
    "/bulk-sends/{bulk_send_id}/dispatch": {
      "post": {
        "operationId": "dispatch_bulk_send_bulk_sends__bulk_send_id__dispatch_post",
        "parameters": [
          {
            "in": "path",
            "name": "bulk_send_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Bulk Send Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkSendOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Dispatch Bulk Send",
        "tags": [
          "bulk-sends"
        ]
      }
    },
    "/device/code": {
      "post": {
        "operationId": "device_code_device_code_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceCodeReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceCodeOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Device Code",
        "tags": [
          "auth"
        ]
      }
    },
    "/device/token": {
      "post": {
        "operationId": "device_token_device_token_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceTokenReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceTokenOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Device Token",
        "tags": [
          "auth"
        ]
      }
    },
    "/documents": {
      "get": {
        "operationId": "list_documents_documents_get",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "folder",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Folder"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "created",
              "title": "Sort",
              "type": "string"
            }
          },
          {
            "description": "A bulk send id: list only its member documents. Without it, members of bulk sends are hidden (the batch is the first-class object, BS-4).",
            "in": "query",
            "name": "batch",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "A bulk send id: list only its member documents. Without it, members of bulk sends are hidden (the batch is the first-class object, BS-4).",
              "title": "Batch"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentPage"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Documents",
        "tags": [
          "documents"
        ]
      },
      "post": {
        "operationId": "create_document_documents_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDraftOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Document",
        "tags": [
          "documents"
        ]
      }
    },
    "/documents/{doc_id}": {
      "get": {
        "operationId": "get_document_documents__doc_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/DocumentOut"
                    },
                    {
                      "$ref": "#/components/schemas/DocumentAwaitingUpload"
                    }
                  ],
                  "title": "Response Get Document Documents  Doc Id  Get"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Document",
        "tags": [
          "documents"
        ]
      },
      "patch": {
        "operationId": "patch_document_documents__doc_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnvelopePatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Patch Document",
        "tags": [
          "documents"
        ]
      }
    },
    "/documents/{doc_id}/content": {
      "put": {
        "description": "Direct-upload fallback for backends without presigned PUT.",
        "operationId": "upload_document_content_documents__doc_id__content_put",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upload Document Content",
        "tags": [
          "documents"
        ]
      }
    },
    "/documents/{doc_id}/download": {
      "get": {
        "operationId": "download_document_documents__doc_id__download_get",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "variant",
            "required": false,
            "schema": {
              "default": "signed",
              "title": "Variant",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download Document",
        "tags": [
          "documents"
        ]
      }
    },
    "/documents/{doc_id}/duplicate": {
      "post": {
        "description": "T-5 \"use as new\" (D54): a fresh draft from the original PDF with the\nsame recipients, fields, and display preferences. No signing links exist\nuntil it is sent; nothing is emailed.",
        "operationId": "duplicate_document_documents__doc_id__duplicate_post",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/DuplicateDocumentIn"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Req"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Duplicate Document",
        "tags": [
          "documents"
        ]
      }
    },
    "/documents/{doc_id}/events": {
      "get": {
        "operationId": "document_events_documents__doc_id__events_get",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "after_seq",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "After Seq",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/EventOut"
                  },
                  "title": "Response Document Events Documents  Doc Id  Events Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Document Events",
        "tags": [
          "documents"
        ]
      }
    },
    "/documents/{doc_id}/fields": {
      "put": {
        "operationId": "put_fields_documents__doc_id__fields_put",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "items": {
                  "$ref": "#/components/schemas/FieldSpec"
                },
                "title": "Fields",
                "type": "array"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/FieldOut"
                  },
                  "title": "Response Put Fields Documents  Doc Id  Fields Put",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Put Fields",
        "tags": [
          "documents"
        ]
      }
    },
    "/documents/{doc_id}/finalize": {
      "post": {
        "operationId": "finalize_document_documents__doc_id__finalize_post",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Finalize Document",
        "tags": [
          "documents"
        ]
      }
    },
    "/documents/{doc_id}/recipients": {
      "put": {
        "operationId": "put_recipients_documents__doc_id__recipients_put",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "items": {
                  "$ref": "#/components/schemas/RecipientSpec"
                },
                "title": "Recipients",
                "type": "array"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RecipientOut"
                  },
                  "title": "Response Put Recipients Documents  Doc Id  Recipients Put",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Put Recipients",
        "tags": [
          "documents"
        ]
      }
    },
    "/documents/{doc_id}/send": {
      "post": {
        "operationId": "send_document_documents__doc_id__send_post",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/SendReq"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Req"
              }
            }
          }
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Send Document",
        "tags": [
          "documents"
        ]
      }
    },
    "/documents/{doc_id}/void": {
      "post": {
        "operationId": "void_document_documents__doc_id__void_post",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoidReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoidOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Void Document",
        "tags": [
          "documents"
        ]
      }
    },
    "/events/stream": {
      "get": {
        "operationId": "event_stream_events_stream_get",
        "parameters": [
          {
            "in": "query",
            "name": "events",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Events"
            }
          },
          {
            "in": "query",
            "name": "after_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "After Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Event Stream",
        "tags": [
          "events"
        ]
      }
    },
    "/folders": {
      "get": {
        "operationId": "list_folders_folders_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/FolderOut"
                  },
                  "title": "Response List Folders Folders Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Folders",
        "tags": [
          "folders"
        ]
      },
      "post": {
        "operationId": "create_folder_folders_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FolderIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Folder",
        "tags": [
          "folders"
        ]
      }
    },
    "/folders/{folder_id}": {
      "delete": {
        "operationId": "delete_folder_folders__folder_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "folder_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Folder Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Folder",
        "tags": [
          "folders"
        ]
      },
      "patch": {
        "operationId": "patch_folder_folders__folder_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "folder_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Folder Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FolderPatchIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Patch Folder",
        "tags": [
          "folders"
        ]
      }
    },
    "/keys": {
      "get": {
        "operationId": "list_keys_keys_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/KeyOut"
                  },
                  "title": "Response List Keys Keys Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Keys",
        "tags": [
          "keys"
        ]
      },
      "post": {
        "operationId": "create_key_keys_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKeyReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Key",
        "tags": [
          "keys"
        ]
      }
    },
    "/keys/{key_id}/revoke": {
      "post": {
        "operationId": "revoke_key_keys__key_id__revoke_post",
        "parameters": [
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Key Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke Key",
        "tags": [
          "keys"
        ]
      }
    },
    "/me": {
      "get": {
        "operationId": "me_me_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Me",
        "tags": [
          "account"
        ]
      }
    },
    "/templates": {
      "get": {
        "description": "D46(f): the CLI's `template list`.",
        "operationId": "list_templates_templates_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplatePage"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Templates",
        "tags": [
          "templates"
        ]
      },
      "post": {
        "operationId": "create_template_templates_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTemplateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Template",
        "tags": [
          "templates"
        ]
      }
    },
    "/templates/{tpl_id}": {
      "delete": {
        "description": "D54: soft delete — the template disappears from list/get/use;\ndocuments created from it are unaffected.",
        "operationId": "delete_template_templates__tpl_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "tpl_id",
            "required": true,
            "schema": {
              "title": "Tpl Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Template",
        "tags": [
          "templates"
        ]
      },
      "get": {
        "description": "D46(f): the CLI's `template pull` — the definition round-trips.",
        "operationId": "get_template_templates__tpl_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "tpl_id",
            "required": true,
            "schema": {
              "title": "Tpl Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Template",
        "tags": [
          "templates"
        ]
      },
      "patch": {
        "description": "D54/TE-6: replaces the parts given and bumps `version`. Documents\nalready created from the template are unaffected.",
        "operationId": "patch_template_templates__tpl_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "tpl_id",
            "required": true,
            "schema": {
              "title": "Tpl Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchTemplateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Patch Template",
        "tags": [
          "templates"
        ]
      }
    },
    "/templates/{tpl_id}/duplicate": {
      "post": {
        "description": "T-5: a new template (version 1) from the same PDF and definition.",
        "operationId": "duplicate_template_templates__tpl_id__duplicate_post",
        "parameters": [
          {
            "in": "path",
            "name": "tpl_id",
            "required": true,
            "schema": {
              "title": "Tpl Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/DuplicateTemplateIn"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Req"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Duplicate Template",
        "tags": [
          "templates"
        ]
      }
    },
    "/templates/{tpl_id}/use": {
      "post": {
        "operationId": "use_template_templates__tpl_id__use_post",
        "parameters": [
          {
            "in": "path",
            "name": "tpl_id",
            "required": true,
            "schema": {
              "title": "Tpl Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UseTemplateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Use Template",
        "tags": [
          "templates"
        ]
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "list_webhooks_webhooks_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WebhookOut"
                  },
                  "title": "Response List Webhooks Webhooks Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Webhooks",
        "tags": [
          "webhooks"
        ]
      },
      "post": {
        "operationId": "create_webhook_webhooks_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Webhook",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/webhooks/{webhook_id}": {
      "delete": {
        "operationId": "delete_webhook_webhooks__webhook_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "webhook_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Webhook Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Webhook",
        "tags": [
          "webhooks"
        ]
      },
      "patch": {
        "description": "D58(a): edit url/events, and re-enable (`active: true`).",
        "operationId": "patch_webhook_webhooks__webhook_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "webhook_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Webhook Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchWebhookReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Patch Webhook",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/webhooks/{webhook_id}/deliveries": {
      "get": {
        "operationId": "list_deliveries_webhooks__webhook_id__deliveries_get",
        "parameters": [
          {
            "in": "path",
            "name": "webhook_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Webhook Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/DeliveryOut"
                  },
                  "title": "Response List Deliveries Webhooks  Webhook Id  Deliveries Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Deliveries",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/webhooks/{webhook_id}/deliveries/{delivery_id}/redeliver": {
      "post": {
        "operationId": "redeliver_webhooks__webhook_id__deliveries__delivery_id__redeliver_post",
        "parameters": [
          {
            "in": "path",
            "name": "webhook_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Webhook Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "title": "Delivery Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RedeliverOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Redeliver",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/webhooks/{webhook_id}/disable": {
      "post": {
        "operationId": "disable_webhook_webhooks__webhook_id__disable_post",
        "parameters": [
          {
            "in": "path",
            "name": "webhook_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Webhook Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Disable Webhook",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/webhooks/{webhook_id}/ping": {
      "post": {
        "description": "D58(a): queue one delivery of type `ping`, signed like any other.\n`ping` is not subscribable (EVENT_TYPES is unchanged); the deliverer\nsends every queued row regardless of the endpoint's event filter.",
        "operationId": "ping_webhook_webhooks__webhook_id__ping_post",
        "parameters": [
          {
            "in": "path",
            "name": "webhook_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Webhook Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PingOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Ping Webhook",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/webhooks/{webhook_id}/rotate-secret": {
      "post": {
        "description": "D58(a): a new secret, shown once; the previous one keeps co-signing\ndeliveries for ROTATION_GRACE (`v1=<new>,v1=<old>` in the header) so a\nhandler can be switched without a signature outage. A second rotation\ninside the window retires the older secret immediately: at most two\nsecrets are ever live.",
        "operationId": "rotate_secret_webhooks__webhook_id__rotate_secret_post",
        "parameters": [
          {
            "in": "path",
            "name": "webhook_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Webhook Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rotate Secret",
        "tags": [
          "webhooks"
        ]
      }
    }
  }
}
