{
  "openapi": "3.1.0",
  "info": {
    "title": "AirSign API",
    "version": "1.0.0",
    "summary": "REST API for the AirSign e-signature platform.",
    "description": "AirSign is an Australian e-signature platform. The REST API lets you create signing\nsessions from templates or from scratch (using the\n[block document format](https://airsign.com.au/api-docs/block-document-format)),\nupload PDFs and images, send sessions and invitations, track signing status, and\ndownload the signed documents and certificate of completion.\n\n**Plans:** API access is available on paid plans (Starter and up). It is not included\nin the Free plan. See [pricing](https://airsign.com.au/pricing).\n\n**Authentication:** obtain a Bearer access token (JWT) with the OAuth 2.0 client\ncredentials flow at `POST https://api.airsign.com.au/oidc/token` using\n`scope=api:all`, then send it as `Authorization: Bearer {access_token}` on every\nrequest. A token issued without the `api:all` scope is rejected with\n`403 Insufficient scope`.\n\n**Drafts first:** sessions created through the API are drafts by default. The\nresponse includes a `draftUrl` that opens the session in the AirSign editor for\nreview; send it with [Send Session](https://airsign.com.au/api-docs/send-session), or\npass `sendImmediately: true` to email the signing invitations straight away.\n\n**Rate limits:** some endpoints are rate limited per organisation (for example List\nSessions allows 60 requests per hour). Rate-limited responses carry\n`X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` headers, and a\n`429` response includes `Retry-After`.\n",
    "termsOfService": "https://airsign.com.au/terms-and-conditions",
    "contact": {
      "name": "AirSign",
      "email": "info@airsign.com.au",
      "url": "https://airsign.com.au/api-docs/overview"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://airsign.com.au/terms-and-conditions"
    },
    "x-logo": {
      "url": "https://airsign.com.au/android-chrome-512x512.png",
      "altText": "AirSign"
    }
  },
  "externalDocs": {
    "description": "AirSign API documentation",
    "url": "https://airsign.com.au/api-docs/overview"
  },
  "servers": [
    {
      "url": "https://api.airsign.com.au",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "oauth2ClientCredentials": [
        "api:all"
      ]
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": "Obtain an OAuth 2.0 access token with the client credentials flow.",
      "externalDocs": {
        "url": "https://airsign.com.au/api-docs/authentication"
      }
    },
    {
      "name": "Sessions",
      "description": "Signing sessions: create (from scratch or from a template), update drafts, send,\nresend invitations, read recipient access passwords, track status and download\nthe signed documents.\n"
    },
    {
      "name": "Templates",
      "description": "Reusable signing templates with variables for the values that change each time."
    },
    {
      "name": "Files",
      "description": "Upload PDFs and images for use in sessions, templates and block documents.",
      "externalDocs": {
        "url": "https://airsign.com.au/api-docs/upload-file"
      }
    }
  ],
  "paths": {
    "/oidc/token": {
      "post": {
        "operationId": "getAccessToken",
        "tags": [
          "Authentication"
        ],
        "summary": "Get an access token",
        "description": "Issues a Bearer access token (JWT) using the OAuth 2.0 Client Credentials flow.\nAuthenticate with HTTP Basic auth using `base64(client_id:client_secret)`.\n`scope` must be `api:all`; without it the token is issued but every API request\nis rejected with `403 Insufficient scope`. Request a new token when the current\none expires (`expires_in` seconds).\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/authentication"
        },
        "security": [
          {
            "clientBasicAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              },
              "examples": {
                "clientCredentials": {
                  "summary": "Client credentials grant",
                  "value": {
                    "grant_type": "client_credentials",
                    "scope": "api:all"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access token issued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                },
                "examples": {
                  "token": {
                    "value": {
                      "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.example.signature",
                      "expires_in": 3600,
                      "token_type": "Bearer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid client credentials."
          }
        }
      }
    },
    "/api/v1/Session": {
      "post": {
        "operationId": "createSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Create a session",
        "description": "Create a signing session from scratch - no template or PDF required. Documents are\nwritten in the [block document format](https://airsign.com.au/api-docs/block-document-format);\nAirSign handles layout and signature field placement. Previously uploaded PDFs\n(see [Upload File](https://airsign.com.au/api-docs/upload-file)) can be included as\n`uploadedPdf` entries: their own form fields are imported and any extra `fields`\nare placed by anchor text or page coordinates.\n\nBy default the session is created as a **draft** and the response includes a\n`draftUrl` that opens it in the AirSign editor for review. Set\n`sendImmediately: true` to email the signing invitations straight away. Every\nsigner should end up with a signature field somewhere - the response's `warnings`\ntell you if not.\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/create-session"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSessionRequest"
              },
              "examples": {
                "mutualNda": {
                  "summary": "Two-party NDA as a draft",
                  "value": {
                    "name": "NDA - Acme Pty Ltd",
                    "sendImmediately": false,
                    "files": [
                      {
                        "type": "blocks",
                        "document": {
                          "format": "blocks",
                          "title": "Mutual NDA",
                          "blocks": [
                            {
                              "type": "heading",
                              "text": "1. Purpose"
                            },
                            {
                              "type": "paragraph",
                              "text": "The parties wish to exchange confidential information."
                            },
                            {
                              "type": "spacer",
                              "height": 24
                            },
                            {
                              "type": "signatureBlock",
                              "recipient": "partyA",
                              "label": "Party A"
                            },
                            {
                              "type": "signatureBlock",
                              "recipient": "partyB",
                              "label": "Party B"
                            }
                          ]
                        }
                      }
                    ],
                    "recipients": [
                      {
                        "key": "partyA",
                        "name": "Ada Lovelace",
                        "email": "ada@example.com"
                      },
                      {
                        "key": "partyB",
                        "name": "Charles Babbage",
                        "email": "charles@example.com"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session created (as a draft unless `sendImmediately` was true).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionSummary"
                },
                "examples": {
                  "draft": {
                    "value": {
                      "name": "NDA - Acme Pty Ltd",
                      "sessionId": "7d1c2f8a-3b4e-4a5f-9c6d-1e2f3a4b5c6d",
                      "status": "draft",
                      "selfSignOnly": false,
                      "createdAt": "2026-06-12 10:15:00",
                      "updatedAt": "2026-06-12 10:15:00",
                      "files": [
                        {
                          "fileId": null,
                          "fileName": "Mutual NDA.pdf",
                          "zones": [],
                          "sessionId": "7d1c2f8a-3b4e-4a5f-9c6d-1e2f3a4b5c6d"
                        }
                      ],
                      "recipients": [
                        {
                          "recipientId": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                          "status": "draft",
                          "name": "Ada Lovelace",
                          "email": "ada@example.com",
                          "signingOrder": 1
                        },
                        {
                          "recipientId": "1b2c3d4e-5f6a-4b7c-9d8e-0f1a2b3c4d5e",
                          "status": "draft",
                          "name": "Charles Babbage",
                          "email": "charles@example.com",
                          "signingOrder": 2
                        }
                      ],
                      "draftUrl": "https://app.airsign.com.au/authenticated/main/sessions/session/7d1c2f8a-3b4e-4a5f-9c6d-1e2f3a4b5c6d",
                      "sent": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/DocumentBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Session limit reached for your plan (`SESSION_LIMIT_REACHED`), a setting requires\na plan feature (`PLAN_FEATURE_REQUIRED`), or the token lacks the `api:all` scope.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "sessionLimit": {
                    "value": {
                      "message": "Session limit reached for your plan",
                      "error": "SESSION_LIMIT_REACHED"
                    }
                  },
                  "planFeature": {
                    "value": {
                      "message": "Session expiry requires a plan feature",
                      "error": "PLAN_FEATURE_REQUIRED"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "A referenced uploaded file was not found (`FILE_NOT_FOUND`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "fileNotFound": {
                    "value": {
                      "message": "File not found",
                      "error": "FILE_NOT_FOUND"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/SessionFromTemplate": {
      "post": {
        "operationId": "createSessionFromTemplate",
        "tags": [
          "Sessions"
        ],
        "summary": "Create a session from a template",
        "description": "Create a new signing session from an active template and specify recipients.\n`recipients` overrides the template recipients **by index** - pass an empty object\n`{}` to leave a position on its template defaults; it must not exceed the number\nof recipients defined in the template.\n\nOptional session settings override the template's values; some require plan\nfeatures and return `403` without them.\n\n**Signing order:** recipients inherit the template's signing order. The order is a\nrouting level, not a strict rank: recipients sharing a level are notified at the\nsame time, and a higher level is only notified once every recipient at all lower\nlevels has completed. Recipients without an order are level 0.\n\n**Optional recipients:** with `sendImmediately: true`, an optional recipient left\nwithout its required contact detail is dropped (with its fields and any coupled\nwitness or nominated recipients). Pass `{ \"exclude\": true }` at its position to drop\nan optional recipient explicitly (works for drafts too).\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/create-session-from-template"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSessionFromTemplateRequest"
              },
              "examples": {
                "withVariables": {
                  "summary": "Send with variables and reminders",
                  "value": {
                    "templateId": "2bc7fc6a-2b90-44f4-9889-d8f7673f5f4f",
                    "name": "api test multirecipient",
                    "sendImmediately": true,
                    "recipients": [
                      {
                        "name": "test1",
                        "email": "test1@example.com"
                      }
                    ],
                    "variableValues": {
                      "client_name": "Jane Smith",
                      "contract_date": "2025-01-15"
                    },
                    "tagIds": [
                      "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9"
                    ],
                    "expiryDays": 30,
                    "reminderEnabled": true,
                    "reminderFrequency": "weekly"
                  }
                },
                "signingOrder": {
                  "summary": "Override signing order",
                  "value": {
                    "templateId": "2bc7fc6a-2b90-44f4-9889-d8f7673f5f4f",
                    "sendImmediately": true,
                    "recipients": [
                      {
                        "name": "First Signer",
                        "email": "first@example.com",
                        "signingOrder": 1
                      },
                      {
                        "name": "Second Signer",
                        "email": "second@example.com",
                        "signingOrder": 2
                      }
                    ]
                  }
                },
                "excludeOptional": {
                  "summary": "Exclude an optional recipient",
                  "value": {
                    "templateId": "2bc7fc6a-2b90-44f4-9889-d8f7673f5f4f",
                    "sendImmediately": true,
                    "recipients": [
                      {
                        "name": "First Signer",
                        "email": "first@example.com"
                      },
                      {
                        "exclude": true
                      },
                      {
                        "name": "Second Director",
                        "email": "director@example.com"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionFromTemplateResponse"
                },
                "examples": {
                  "sent": {
                    "value": {
                      "name": "Api Test",
                      "sessionId": "7d1c2f8a-3b4e-4a5f-9c6d-1e2f3a4b5c6d",
                      "status": "pending",
                      "selfSignOnly": false,
                      "expiryDays": 30,
                      "expiryDate": "2025-08-01 16:19:36",
                      "reminderEnabled": true,
                      "reminderFrequency": "weekly",
                      "senderProfileId": null,
                      "overrideCompletionEmailRecipients": null,
                      "overrideAttachPdf": null,
                      "overrideAttachCertificate": null,
                      "overrideCreateCombinedDoc": null,
                      "overrideAttachCombinedDoc": null,
                      "overrideCustomCompletionMessage": null,
                      "createdAt": "2025-07-02 16:19:36",
                      "completedDate": null,
                      "updatedAt": "2025-07-02 16:19:36",
                      "files": [
                        {
                          "fileId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                          "fileName": "contract.pdf",
                          "fileType": "application/octet-stream",
                          "namespace": "templateDocuments",
                          "zones": [
                            {
                              "id": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
                              "name": "signingZone3315",
                              "type": "signingZone",
                              "label": "Sign",
                              "page": 1,
                              "recipientId": "default",
                              "x": 29.17,
                              "y": 38.01,
                              "w": 100,
                              "h": 50
                            }
                          ],
                          "sessionId": "7d1c2f8a-3b4e-4a5f-9c6d-1e2f3a4b5c6d",
                          "importedZones": true
                        }
                      ],
                      "recipients": [
                        {
                          "recipientId": "default",
                          "status": "pending",
                          "name": "test1",
                          "email": "test1@example.com"
                        }
                      ],
                      "tagIds": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body, template not active, recipients mismatch, missing required\nvariables, `exclude` on a non-optional recipient (`RECIPIENT_NOT_OPTIONAL`), or no\nrecipients remaining after exclusions (`NO_RECIPIENTS_REMAIN`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "notOptional": {
                    "value": {
                      "message": "Recipient 2 is not optional in this template",
                      "error": "RECIPIENT_NOT_OPTIONAL"
                    }
                  },
                  "noneRemain": {
                    "value": {
                      "message": "No recipients remain after exclusions",
                      "error": "NO_RECIPIENTS_REMAIN"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Your plan does not include the required feature for the provided session settings,\nor the token lacks the `api:all` scope.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Template not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "notFound": {
                    "value": {
                      "message": "Template not found"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/Sessions": {
      "get": {
        "operationId": "listSessions",
        "tags": [
          "Sessions"
        ],
        "summary": "List sessions",
        "description": "Query signing sessions for your organisation with filtering, sorting and\npagination. Useful for dashboards, reporting and polling for status changes\n(filter with `updatedAfter`). Rate limited to 60 requests per hour per organisation.\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/list-sessions"
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by status. Comma-separated for multiple, e.g. `pending,completed`.\nValues: `draft`, `pending`, `inProgress`, `completed`, `cancelled`, `expired`.\n",
            "schema": {
              "type": "string"
            },
            "example": "pending,completed"
          },
          {
            "name": "name",
            "in": "query",
            "description": "Search sessions by name (substring match).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recipientEmail",
            "in": "query",
            "description": "Filter sessions that include this recipient email.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          },
          {
            "name": "createdAfter",
            "in": "query",
            "description": "ISO 8601 datetime. Only return sessions created after this date.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "createdBefore",
            "in": "query",
            "description": "ISO 8601 datetime. Only return sessions created before this date.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "updatedAfter",
            "in": "query",
            "description": "ISO 8601 datetime. Only return sessions updated after this date. Ideal for polling.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2025-01-01T00:00:00Z"
          },
          {
            "name": "updatedBefore",
            "in": "query",
            "description": "ISO 8601 datetime. Only return sessions updated before this date.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Sort field.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "updatedAt",
                "completedDate",
                "name"
              ],
              "default": "updatedAt"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of sessions.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionList"
                },
                "examples": {
                  "completed": {
                    "value": {
                      "sessions": [
                        {
                          "sessionId": "7d1c2f8a-3b4e-4a5f-9c6d-1e2f3a4b5c6d",
                          "name": "Employment Contract - John Doe",
                          "status": "completed",
                          "selfSignOnly": false,
                          "createdAt": "2025-06-15T10:30:00.000Z",
                          "updatedAt": "2025-06-16T14:22:00.000Z",
                          "completedDate": "2025-06-16T14:22:00.000Z",
                          "expiryDate": "2025-07-15T10:30:00.000Z",
                          "recipients": [
                            {
                              "recipientId": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                              "name": "John Doe",
                              "email": "john@example.com",
                              "status": "completed",
                              "recipientType": "toCompleteEmail",
                              "signingOrder": 1
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "total": 42,
                        "limit": 10,
                        "offset": 0,
                        "hasMore": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/Session/{sessionId}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SessionId"
        }
      ],
      "get": {
        "operationId": "getSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Get a session",
        "description": "Retrieve full details of a signing session by its ID, including file information\nand recipient statuses. Once the session is completed, the signed PDFs and\ncertificate are available via\n[Download Documents](https://airsign.com.au/api-docs/download-documents).\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/get-session"
        },
        "responses": {
          "200": {
            "description": "The session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                },
                "examples": {
                  "pending": {
                    "value": {
                      "sessionId": "7d1c2f8a-3b4e-4a5f-9c6d-1e2f3a4b5c6d",
                      "name": "Employment Contract - John Doe",
                      "status": "pending",
                      "selfSignOnly": false,
                      "sessionType": "offlineSigning",
                      "createdAt": "2025-06-15T10:30:00.000Z",
                      "updatedAt": "2025-06-15T10:30:00.000Z",
                      "completedDate": null,
                      "files": [
                        {
                          "fileId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                          "fileName": "contract.pdf",
                          "fileType": "application/pdf",
                          "status": "pending"
                        }
                      ],
                      "recipients": [
                        {
                          "recipientId": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                          "name": "John Doe",
                          "email": "john@example.com",
                          "status": "pending",
                          "recipientType": "toCompleteEmail",
                          "signingOrder": 1,
                          "requireAccessPassword": false
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "description": "Session not found or does not belong to your organisation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "notFound": {
                    "value": {
                      "message": "Session not found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "put": {
        "operationId": "updateSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Update a draft session",
        "description": "Update a **draft** session before it is sent (the `draftUrl` stays the same).\nSessions that have already been sent cannot be updated. Three kinds of change,\ncombinable in one request:\n\n- **Settings:** pass any of `name`, `expiryDays`, `reminderEnabled`,\n  `reminderFrequency` alone to patch just those.\n- **Recipient details:** pass `recipients` alone to fix names, emails or signing\n  order in place. List every current recipient in signing order (same count);\n  recipient identities and placed fields are preserved.\n- **Documents:** pass `files` and `recipients` together to replace the whole\n  document set, exactly as Create Session takes it. Previous documents, fields and\n  recipients are rebuilt from scratch, discarding manual edits made in the editor.\n\nAt least one field must be provided.\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/update-session"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSessionRequest"
              },
              "examples": {
                "fixRecipientEmail": {
                  "summary": "Fix a recipient email",
                  "value": {
                    "recipients": [
                      {
                        "key": "parent",
                        "name": "Ada Lovelace",
                        "email": "ada@example.com"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The same summary shape Create Session returns, including `draftUrl` (unchanged),\na per-file `fieldCount`, and `warnings` (e.g. a recipient left without a\nsignature field).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionSummary"
                }
              }
            }
          },
          "400": {
            "description": "Session is not a draft (`NOT_A_DRAFT`), `files` sent without `recipients`\n(`INVALID_REQUEST`), `recipients` alone does not match the current recipient count\n(`RECIPIENT_COUNT_MISMATCH`), or a document failed to compile\n(`DOCUMENT_VALIDATION_FAILED` with per-block `issues`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "notADraft": {
                    "value": {
                      "message": "Only draft sessions can be updated",
                      "error": "NOT_A_DRAFT"
                    }
                  },
                  "countMismatch": {
                    "value": {
                      "message": "recipients must list every current recipient",
                      "error": "RECIPIENT_COUNT_MISMATCH"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Expiry/reminder settings on a plan without the session expiry feature\n(`PLAN_FEATURE_REQUIRED`), or the token lacks the `api:all` scope.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Session not found, or a referenced uploaded file/image not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Archive or delete a session",
        "description": "By default the session is **archived**: its status becomes `cancelled`, reminders\nstop, still-active recipients are cancelled, and it can be restored from the\nsessions list in the AirSign app. With `permanent=true` the session is\n**deleted**: hidden everywhere and not restorable in the app. Deletion takes\neffect immediately.\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/delete-session"
        },
        "parameters": [
          {
            "name": "permanent",
            "in": "query",
            "description": "`false` (default) archives the session (restorable in the app); `true` deletes it permanently.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Session archived or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteSessionResponse"
                },
                "examples": {
                  "archived": {
                    "value": {
                      "sessionId": "7d1c2f8a-3b4e-4a5f-9c6d-1e2f3a4b5c6d",
                      "name": "Junior Footy Registration - 2027 Season",
                      "previousStatus": "draft",
                      "status": "cancelled",
                      "permanent": false,
                      "restorable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Session is already archived (`ALREADY_ARCHIVED`) - pass `permanent=true` to delete\nit, or restore it in the app.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "alreadyArchived": {
                    "value": {
                      "message": "Session is already archived",
                      "error": "ALREADY_ARCHIVED"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "description": "Session not found (including already permanently deleted sessions).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/Session/{sessionId}/Send": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SessionId"
        }
      ],
      "post": {
        "operationId": "sendSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Send a draft session",
        "description": "Send a **draft** session: it transitions to `pending` and signing invitations are\nemailed to the recipients. If the session has an `expiryDays` setting, the expiry\ndate starts counting now. No request body is required. To resend an invitation on\nan already-sent session, use Send Invitation instead.\n\n`passwordRecipients` is only present when a recipient has `requireAccessPassword`.\nTheir password is created now - read each one with Get Recipient Password and give\nit to them by phone, text or in person.\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/send-session"
        },
        "responses": {
          "200": {
            "description": "Session sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendSessionResponse"
                },
                "examples": {
                  "sent": {
                    "value": {
                      "sessionId": "7d1c2f8a-3b4e-4a5f-9c6d-1e2f3a4b5c6d",
                      "status": "pending",
                      "sentAt": "2026-06-12T10:30:00.000Z",
                      "recipients": [
                        {
                          "recipientId": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                          "name": "Ada Lovelace",
                          "email": "ada@example.com",
                          "signingOrder": 1
                        }
                      ],
                      "passwordRecipients": [
                        {
                          "recipientId": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                          "name": "Ada Lovelace",
                          "email": "ada@example.com"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Session is not a draft (`NOT_A_DRAFT`), has no recipients (`NO_RECIPIENTS`),\nrecipients are missing a name or email (`INCOMPLETE_RECIPIENTS` - finish the draft\nin the editor), or the session is self-sign only (`SELF_SIGN_ONLY`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "incomplete": {
                    "value": {
                      "message": "Some recipients are missing a name or email",
                      "error": "INCOMPLETE_RECIPIENTS"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "description": "Session not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/Session/{sessionId}/SendInvitation": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SessionId"
        }
      ],
      "post": {
        "operationId": "sendInvitation",
        "tags": [
          "Sessions"
        ],
        "summary": "Send or resend an invitation",
        "description": "Send or resend a signing invitation email to a recipient of a `pending` or\n`inProgress` session. Target a specific recipient by ID or email, or send an empty\nbody to invite the next pending recipient.\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/send-invitation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendInvitationRequest"
              },
              "examples": {
                "byEmail": {
                  "value": {
                    "recipientEmail": "john@example.com"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invitation sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendInvitationResponse"
                },
                "examples": {
                  "sent": {
                    "value": {
                      "success": true,
                      "sessionId": "7d1c2f8a-3b4e-4a5f-9c6d-1e2f3a4b5c6d",
                      "recipientId": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                      "recipientEmail": "john@example.com",
                      "sentAt": "2025-06-15T10:30:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Session is not in `pending` or `inProgress` status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "wrongStatus": {
                    "value": {
                      "message": "Session must be in pending or inProgress status to send invitations"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "description": "Session or recipient not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/Session/{sessionId}/Recipient/{recipientId}/AccessPassword": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SessionId"
        },
        {
          "name": "recipientId",
          "in": "path",
          "required": true,
          "description": "The recipient's identifier (from the session's `recipients`).",
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getRecipientPassword",
        "tags": [
          "Sessions"
        ],
        "summary": "Get a recipient's access password",
        "description": "A recipient created with `requireAccessPassword: true` must type a password before\nthe documents open. AirSign creates it when the session is sent and never emails\nit. Read it here and give it to the recipient by phone, text or in person. Every\nread is recorded in the session's audit log.\n\nCapitals, spaces and dashes are ignored when the recipient types it. Five wrong\nattempts lock the recipient out for 15 minutes. If the recipient reassigns the\ndocument, the new signer gets a new password - read it again.\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/get-recipient-password"
        },
        "responses": {
          "200": {
            "description": "The recipient's access password.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecipientPasswordResponse"
                },
                "examples": {
                  "password": {
                    "value": {
                      "sessionId": "7d1c2f8a-3b4e-4a5f-9c6d-1e2f3a4b5c6d",
                      "recipientId": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                      "name": "Ada Lovelace",
                      "email": "ada@example.com",
                      "accessPassword": "K7QM-4PXR",
                      "note": "Give this password to the recipient by phone, text or in person - never by the same email as the signing link."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The recipient does not need a password (`NO_ACCESS_PASSWORD`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "noPassword": {
                    "value": {
                      "message": "This recipient does not need an access password",
                      "error": "NO_ACCESS_PASSWORD"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "description": "Session or recipient not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The session is still a draft - the password is created when it is sent (`NOT_SENT`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "notSent": {
                    "value": {
                      "message": "The session has not been sent yet",
                      "error": "NOT_SENT"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/Session/{sessionId}/Documents": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SessionId"
        }
      ],
      "get": {
        "operationId": "listSessionDocuments",
        "tags": [
          "Sessions"
        ],
        "summary": "Get download links for all signed documents",
        "description": "Returns short-lived pre-signed URLs (see `expiresInSeconds`) for the signed PDF\ndocuments of a session whose status is `completed` or `completedAndGenerated`.\nFetch them promptly and do not store them.\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/download-documents"
        },
        "responses": {
          "200": {
            "description": "Download links for the signed documents.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDownloads"
                },
                "examples": {
                  "completed": {
                    "value": {
                      "sessionId": "7d1c2f8a-3b4e-4a5f-9c6d-1e2f3a4b5c6d",
                      "sessionStatus": "completedAndGenerated",
                      "documents": [
                        {
                          "fileId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                          "fileName": "signed-contract.pdf",
                          "url": "https://storage.example.com/signed-contract.pdf?X-Amz-Signature=example"
                        }
                      ],
                      "expiresInSeconds": 36000
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/SessionOrFileNotFound"
          },
          "409": {
            "$ref": "#/components/responses/NotCompleted"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/Session/{sessionId}/Document/{fileId}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SessionId"
        },
        {
          "name": "fileId",
          "in": "path",
          "required": true,
          "description": "The file identifier from the session's `files` array (see Get Session).",
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getSessionDocument",
        "tags": [
          "Sessions"
        ],
        "summary": "Get a download link for one signed document",
        "description": "Returns a short-lived pre-signed URL for one signed PDF of a completed session -\nthe same response shape as the all-documents endpoint, for one file.\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/download-documents"
        },
        "responses": {
          "200": {
            "description": "Download link for the signed document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDownloads"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/SessionOrFileNotFound"
          },
          "409": {
            "$ref": "#/components/responses/NotCompleted"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/Session/{sessionId}/Certificate": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SessionId"
        }
      ],
      "get": {
        "operationId": "getSessionCertificate",
        "tags": [
          "Sessions"
        ],
        "summary": "Download the certificate of completion",
        "description": "Streams the certificate of completion of a completed session as PDF bytes (it is\ngenerated on demand).\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/download-documents"
        },
        "responses": {
          "200": {
            "description": "The certificate of completion.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/SessionOrFileNotFound"
          },
          "409": {
            "$ref": "#/components/responses/NotCompleted"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/Templates": {
      "get": {
        "operationId": "listTemplates",
        "tags": [
          "Templates"
        ],
        "summary": "List templates",
        "description": "List the templates of your organisation. Use this to find template IDs for creating sessions.",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/list-templates"
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by template status.",
            "schema": {
              "type": "string",
              "default": "active"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of templates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateList"
                },
                "examples": {
                  "active": {
                    "value": {
                      "templates": [
                        {
                          "templateId": "2bc7fc6a-2b90-44f4-9889-d8f7673f5f4f",
                          "name": "Employment Contract",
                          "status": "active",
                          "selfSignOnly": false,
                          "createdAt": "2025-05-01T08:00:00.000Z",
                          "updatedAt": "2025-06-10T12:00:00.000Z",
                          "recipientCount": 2,
                          "hasVariables": false
                        }
                      ],
                      "pagination": {
                        "total": 5,
                        "limit": 50,
                        "offset": 0,
                        "hasMore": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          }
        }
      }
    },
    "/api/v1/Template": {
      "post": {
        "operationId": "createTemplate",
        "tags": [
          "Templates"
        ],
        "summary": "Create a template",
        "description": "Create a reusable signing template from scratch using the block document format\n(and/or uploaded PDFs). Use `{{{variableName}}}` tokens in document text and in\nrecipient names/emails for values that change each time - declare each one in\n`variables` and supply values later with Create Session From Template. Templates\nare created as drafts for review in the editor (`editorUrl`); pass\n`activate: true` to make the template immediately usable.\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/create-template"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTemplateRequest"
              },
              "examples": {
                "offerLetter": {
                  "summary": "Offer letter with variables",
                  "value": {
                    "name": "Offer Letter",
                    "activate": true,
                    "document": {
                      "format": "blocks",
                      "title": "Letter of Offer",
                      "blocks": [
                        {
                          "type": "paragraph",
                          "text": "Dear {{{candidateName}}}, we are pleased to offer you the role of {{{roleTitle}}}."
                        },
                        {
                          "type": "spacer",
                          "height": 24
                        },
                        {
                          "type": "signatureBlock",
                          "recipient": "candidate",
                          "label": "Candidate"
                        }
                      ]
                    },
                    "recipients": [
                      {
                        "key": "candidate",
                        "name": "{{{candidateName}}}",
                        "email": "{{{candidateEmail}}}"
                      }
                    ],
                    "variables": [
                      {
                        "name": "candidateName",
                        "displayName": "Candidate name"
                      },
                      {
                        "name": "candidateEmail",
                        "displayName": "Candidate email"
                      },
                      {
                        "name": "roleTitle",
                        "displayName": "Role title"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Template created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateTemplateResponse"
                },
                "examples": {
                  "active": {
                    "value": {
                      "templateId": "2bc7fc6a-2b90-44f4-9889-d8f7673f5f4f",
                      "name": "Offer Letter",
                      "status": "active",
                      "pageCount": 1,
                      "recipients": [
                        {
                          "recipientId": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                          "name": "{{{candidateName}}}",
                          "email": "{{{candidateEmail}}}",
                          "signingOrder": 1
                        }
                      ],
                      "variables": [
                        "candidateName",
                        "candidateEmail",
                        "roleTitle"
                      ],
                      "editorUrl": "https://app.airsign.com.au/authenticated/main/templates/template/2bc7fc6a-2b90-44f4-9889-d8f7673f5f4f",
                      "activated": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/DocumentBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "A setting requires a plan feature (`PLAN_FEATURE_REQUIRED`), or the token lacks the `api:all` scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/Template/{templateId}": {
      "parameters": [
        {
          "name": "templateId",
          "in": "path",
          "required": true,
          "description": "The unique identifier of the template.",
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getTemplate",
        "tags": [
          "Templates"
        ],
        "summary": "Get a template",
        "description": "Retrieve full details of a template by its ID, including files, recipients and\ntemplate variables. Empty recipient name/email fields should be filled when\ncreating a session; `optional` recipients can be left blank or excluded.\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/get-template"
        },
        "responses": {
          "200": {
            "description": "The template.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                },
                "examples": {
                  "template": {
                    "value": {
                      "templateId": "2bc7fc6a-2b90-44f4-9889-d8f7673f5f4f",
                      "name": "Employment Contract",
                      "status": "active",
                      "selfSignOnly": false,
                      "createdAt": "2025-05-01T08:00:00.000Z",
                      "updatedAt": "2025-06-10T12:00:00.000Z",
                      "files": [
                        {
                          "fileId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                          "fileName": "contract.pdf"
                        }
                      ],
                      "recipients": [
                        {
                          "recipientId": "default",
                          "name": "Employee",
                          "email": "",
                          "recipientType": "toCompleteEmail",
                          "signingOrder": 1,
                          "optional": false
                        }
                      ],
                      "variables": [
                        {
                          "variableId": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a",
                          "name": "employee_name",
                          "displayName": "Employee Name",
                          "type": "text",
                          "required": true,
                          "defaultValue": "",
                          "description": "Full legal name of the employee"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "description": "Template not found or does not belong to your organisation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "notFound": {
                    "value": {
                      "message": "Template not found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/File": {
      "post": {
        "operationId": "uploadFile",
        "tags": [
          "Files"
        ],
        "summary": "Upload a PDF",
        "description": "Upload a PDF (base64-encoded, up to 7MB decoded) for use in sessions and\ntemplates. Reference the returned `fileId` in a `files` entry as\n`{ \"type\": \"uploadedPdf\", \"fileId\": \"...\" }`. `formFields` lists the PDF's own\nform fields in PDF points (top-left origin); they are imported as AirSign fields\nwhen the file is used, and missing fields (typically the signature) can be added\nwith `fields`. A PDF that cannot be opened is rejected with `INVALID_PDF`.\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/upload-file"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadRequest"
              },
              "examples": {
                "pdf": {
                  "value": {
                    "fileName": "supplier-terms.pdf",
                    "data": "JVBERi0xLjcK"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PDF uploaded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadFileResponse"
                },
                "examples": {
                  "uploaded": {
                    "value": {
                      "fileId": "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
                      "fileName": "supplier-terms.pdf",
                      "fileType": "application/pdf",
                      "sizeBytes": 482133,
                      "pageCount": 2,
                      "pages": [
                        {
                          "pageNumber": 1,
                          "width": 595.28,
                          "height": 841.89
                        },
                        {
                          "pageNumber": 2,
                          "width": 595.28,
                          "height": 841.89
                        }
                      ],
                      "formFields": [
                        {
                          "name": "supplier_name",
                          "type": "textZone",
                          "label": "Supplier name",
                          "page": 1,
                          "x": 160,
                          "y": 123.9,
                          "w": 220,
                          "h": 18
                        },
                        {
                          "name": "accepts_terms",
                          "type": "checkboxZone",
                          "page": 2,
                          "x": 60,
                          "y": 187.9,
                          "w": 14,
                          "h": 14
                        }
                      ],
                      "hasSignatureField": false,
                      "nextStep": "This PDF has form fields but NO signature field - add one with files[].fields (fieldType \"signature\", anchored to the signature caption or by page/x/y)."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid base64 (`INVALID_BASE64`), the decoded file is not a PDF\n(`INVALID_FILE_TYPE`), or the PDF cannot be opened (`INVALID_PDF`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalidType": {
                    "value": {
                      "message": "Only PDF files are accepted",
                      "error": "INVALID_FILE_TYPE"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "413": {
            "description": "File too large - max 7MB decoded (`FILE_TOO_LARGE`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "tooLarge": {
                    "value": {
                      "message": "File too large",
                      "error": "FILE_TOO_LARGE"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/Image": {
      "post": {
        "operationId": "uploadImage",
        "tags": [
          "Files"
        ],
        "summary": "Upload an image",
        "description": "Upload a PNG, JPEG, WebP or GIF image (base64-encoded, up to 2MB decoded) for use\nas a block document `logo` or inline `image` block. Takes the same body as Upload\nFile. The response returns the `fileId` and pixel dimensions.\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/upload-file#upload-image"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadRequest"
              },
              "examples": {
                "logo": {
                  "value": {
                    "fileName": "club-logo.png",
                    "data": "iVBORw0KGgo="
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image uploaded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadImageResponse"
                },
                "examples": {
                  "uploaded": {
                    "value": {
                      "fileId": "0f6d2b7e-5c1a-4e0b-9a3f-2b7c8d9e1f00",
                      "fileName": "club-logo.png",
                      "fileType": "image/png",
                      "width": 400,
                      "height": 400,
                      "sizeBytes": 18234
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid base64 (`INVALID_BASE64`) or not a supported image (`INVALID_FILE_TYPE`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "413": {
            "description": "Image too large - max 2MB decoded (`FILE_TOO_LARGE`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Access token from `POST https://api.airsign.com.au/oidc/token` (client credentials,\n`scope=api:all`), sent as `Authorization: Bearer {access_token}`.\n"
      },
      "oauth2ClientCredentials": {
        "type": "oauth2",
        "description": "OAuth 2.0 client credentials flow. Request `scope=api:all`.",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://api.airsign.com.au/oidc/token",
            "scopes": {
              "api:all": "Full access to the AirSign API."
            }
          }
        }
      },
      "clientBasicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "HTTP Basic auth with `base64(client_id:client_secret)`, used only on the token endpoint."
      }
    },
    "parameters": {
      "SessionId": {
        "name": "sessionId",
        "in": "path",
        "required": true,
        "description": "The unique identifier of the session.",
        "schema": {
          "type": "string"
        },
        "example": "7d1c2f8a-3b4e-4a5f-9c6d-1e2f3a4b5c6d"
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "description": "Number of results per page.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 50
        }
      },
      "Offset": {
        "name": "offset",
        "in": "query",
        "description": "Number of results to skip for pagination.",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        }
      }
    },
    "headers": {
      "X-RateLimit-Limit": {
        "description": "Maximum requests allowed per window.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Remaining": {
        "description": "Requests remaining in the current window.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Reset": {
        "description": "Unix timestamp when the window resets.",
        "schema": {
          "type": "integer"
        }
      },
      "Retry-After": {
        "description": "Seconds until you can retry.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid authentication token.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InsufficientScope": {
        "description": "The access token was issued without the `api:all` scope (`403 Insufficient scope`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit exceeded.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "rateLimited": {
                "value": {
                  "message": "Rate limit exceeded. Please try again later.",
                  "retryAfter": 1800
                }
              }
            }
          }
        }
      },
      "DocumentBadRequest": {
        "description": "Invalid request body, or the document failed layout validation\n(`DOCUMENT_VALIDATION_FAILED` with a structured `issues` list - see the\n[block document format](https://airsign.com.au/api-docs/block-document-format)).\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "validationFailed": {
                "value": {
                  "message": "Document failed layout validation with 1 issue(s)",
                  "error": "DOCUMENT_VALIDATION_FAILED",
                  "issues": [
                    {
                      "kind": "title-too-long",
                      "page": 1,
                      "message": "title wraps to 2 lines in the header band - shorten it to fit one line (roughly 30 characters)",
                      "snippet": "A Very Long Agreement Title That Cannot Fit"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "SessionOrFileNotFound": {
        "description": "Session or file not found, or the session does not belong to your organisation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotCompleted": {
        "description": "`SESSION_NOT_COMPLETED` - signing has not finished yet; `DOCUMENT_NOT_READY` - the\nsigned PDF is still being generated, retry shortly.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "notCompleted": {
                "value": {
                  "message": "Certificate is only available for completed sessions",
                  "error": "SESSION_NOT_COMPLETED"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Error body returned by the API.",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human-readable description of the error."
          },
          "error": {
            "type": "string",
            "description": "Machine-readable error code, e.g. `DOCUMENT_VALIDATION_FAILED`, `NOT_A_DRAFT`, `PLAN_FEATURE_REQUIRED`."
          },
          "issues": {
            "type": "array",
            "description": "Present with `DOCUMENT_VALIDATION_FAILED`.",
            "items": {
              "$ref": "#/components/schemas/ValidationIssue"
            }
          },
          "retryAfter": {
            "type": "integer",
            "description": "Seconds until you can retry (rate-limit errors)."
          }
        }
      },
      "ValidationIssue": {
        "type": "object",
        "required": [
          "kind",
          "message"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "Issue kind. Block documents: `title-too-long`, `out-of-bounds`,\n`zone-out-of-bounds`, `unknown-recipient`, `duplicate-field-name`,\n`unknown-image`, `image-too-tall`, `tokens-in-session`, `undeclared-variable`.\nUploaded PDF fields: `anchor-not-found`, `page-out-of-range`,\n`zone-out-of-bounds`, `duplicate-field-name`, `unknown-recipient`.\n"
          },
          "page": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "snippet": {
            "type": "string"
          }
        }
      },
      "TokenRequest": {
        "type": "object",
        "required": [
          "grant_type",
          "scope"
        ],
        "properties": {
          "grant_type": {
            "type": "string",
            "enum": [
              "client_credentials"
            ]
          },
          "scope": {
            "type": "string",
            "enum": [
              "api:all"
            ],
            "description": "Must be `api:all`."
          }
        }
      },
      "TokenResponse": {
        "type": "object",
        "required": [
          "access_token",
          "expires_in",
          "token_type"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "description": "The JWT access token to use in API requests."
          },
          "expires_in": {
            "type": "integer",
            "description": "Token lifetime in seconds."
          },
          "token_type": {
            "type": "string",
            "enum": [
              "Bearer"
            ]
          }
        }
      },
      "ReminderFrequency": {
        "type": "string",
        "enum": [
          "daily",
          "weekly",
          "monthly",
          "quarterly"
        ]
      },
      "BlockDocument": {
        "type": "object",
        "description": "A document described as a flow of blocks, laid out by AirSign on A4 portrait pages\nwith automatic wrapping, page breaks and field placement. See\nhttps://airsign.com.au/api-docs/block-document-format\n",
        "externalDocs": {
          "url": "https://airsign.com.au/api-docs/block-document-format"
        },
        "required": [
          "format",
          "title",
          "blocks"
        ],
        "properties": {
          "format": {
            "type": "string",
            "enum": [
              "blocks"
            ]
          },
          "title": {
            "type": "string",
            "description": "Shown in the header band of every page. Must fit on one line (roughly 30 characters) or the request is rejected."
          },
          "subtitle": {
            "type": "string",
            "maxLength": 200
          },
          "footerLabel": {
            "type": "string",
            "description": "Footer text; page numbers are appended automatically. Defaults to the title."
          },
          "theme": {
            "$ref": "#/components/schemas/Theme"
          },
          "logo": {
            "$ref": "#/components/schemas/Logo"
          },
          "blocks": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/Block"
            }
          }
        },
        "examples": [
          {
            "format": "blocks",
            "title": "Junior Footy Sign-Up",
            "subtitle": "Season 2027 registration and parental consent",
            "theme": {
              "headerStyle": "band",
              "primaryColor": "#c8102e",
              "accentColor": "#111111"
            },
            "logo": {
              "fileId": "0f6d2b7e-5c1a-4e0b-9a3f-2b7c8d9e1f00"
            },
            "blocks": [
              {
                "type": "heading",
                "text": "Player details"
              },
              {
                "type": "fieldRow",
                "fields": [
                  {
                    "fieldType": "text",
                    "label": "Child name",
                    "recipient": "parent"
                  },
                  {
                    "fieldType": "date",
                    "label": "Date of birth",
                    "recipient": "parent"
                  },
                  {
                    "fieldType": "dropdown",
                    "label": "Age group",
                    "recipient": "parent",
                    "options": [
                      "Under 8",
                      "Under 10",
                      "Under 12"
                    ]
                  }
                ]
              },
              {
                "type": "field",
                "fieldType": "radio",
                "label": "Has your child played before?",
                "recipient": "parent",
                "options": [
                  "Yes",
                  "No"
                ]
              },
              {
                "type": "field",
                "fieldType": "multilineText",
                "label": "Medical conditions or allergies",
                "recipient": "parent",
                "required": false
              },
              {
                "type": "heading",
                "text": "Consent"
              },
              {
                "type": "paragraph",
                "text": "I confirm that I am the parent or legal guardian of the child named above and consent to their participation for the season."
              },
              {
                "type": "field",
                "fieldType": "checkbox",
                "label": "I have read and agree to the club code of conduct",
                "recipient": "parent",
                "required": true
              },
              {
                "type": "bulletList",
                "items": [
                  "Bring boots and a mouthguard.",
                  "Training is Tuesdays and Thursdays."
                ]
              },
              {
                "type": "spacer",
                "height": 16
              },
              {
                "type": "signatureBlock",
                "recipient": "parent",
                "label": "Parent / Guardian"
              }
            ]
          }
        ]
      },
      "HexColor": {
        "type": "string",
        "pattern": "^#[0-9a-fA-F]{6}$"
      },
      "Theme": {
        "type": "object",
        "description": "Every value is optional. Omit the theme for the classic look.",
        "properties": {
          "headerStyle": {
            "type": "string",
            "enum": [
              "line",
              "band"
            ],
            "default": "line",
            "description": "`line`: coloured title with a rule under it. `band`: a solid `primaryColor` band across the top of every page."
          },
          "primaryColor": {
            "$ref": "#/components/schemas/HexColor"
          },
          "accentColor": {
            "$ref": "#/components/schemas/HexColor"
          },
          "textColor": {
            "$ref": "#/components/schemas/HexColor"
          },
          "bandTextColor": {
            "$ref": "#/components/schemas/HexColor"
          }
        }
      },
      "Logo": {
        "type": "object",
        "description": "An image from Upload Image, shown at the right of the header band on every page (fits a 130 x 60 point slot).",
        "required": [
          "fileId"
        ],
        "properties": {
          "fileId": {
            "type": "string"
          },
          "width": {
            "type": "number",
            "minimum": 20,
            "maximum": 130
          }
        }
      },
      "Align": {
        "type": "string",
        "enum": [
          "left",
          "center",
          "right"
        ]
      },
      "Block": {
        "description": "One block of a block document, selected by `type`.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/HeadingBlock"
          },
          {
            "$ref": "#/components/schemas/ParagraphBlock"
          },
          {
            "$ref": "#/components/schemas/BulletListBlock"
          },
          {
            "$ref": "#/components/schemas/SpacerBlock"
          },
          {
            "$ref": "#/components/schemas/PageBreakBlock"
          },
          {
            "$ref": "#/components/schemas/ImageBlock"
          },
          {
            "$ref": "#/components/schemas/FieldBlock"
          },
          {
            "$ref": "#/components/schemas/FieldRowBlock"
          },
          {
            "$ref": "#/components/schemas/SignatureBlock"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "heading": "#/components/schemas/HeadingBlock",
            "paragraph": "#/components/schemas/ParagraphBlock",
            "bulletList": "#/components/schemas/BulletListBlock",
            "spacer": "#/components/schemas/SpacerBlock",
            "pageBreak": "#/components/schemas/PageBreakBlock",
            "image": "#/components/schemas/ImageBlock",
            "field": "#/components/schemas/FieldBlock",
            "fieldRow": "#/components/schemas/FieldRowBlock",
            "signatureBlock": "#/components/schemas/SignatureBlock"
          }
        }
      },
      "HeadingBlock": {
        "type": "object",
        "description": "A bold section heading, never left orphaned at the bottom of a page.",
        "required": [
          "type",
          "text"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "heading"
            ]
          },
          "text": {
            "type": "string",
            "maxLength": 500
          }
        }
      },
      "ParagraphBlock": {
        "type": "object",
        "description": "Body text with automatic wrapping. Use `\\n` for line breaks.",
        "required": [
          "type",
          "text"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "paragraph"
            ]
          },
          "text": {
            "type": "string"
          },
          "fontSize": {
            "type": "number",
            "minimum": 7,
            "maximum": 24
          },
          "bold": {
            "type": "boolean"
          },
          "muted": {
            "type": "boolean",
            "description": "Renders in grey for fine print."
          },
          "align": {
            "$ref": "#/components/schemas/Align"
          }
        }
      },
      "BulletListBlock": {
        "type": "object",
        "required": [
          "type",
          "items"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "bulletList"
            ]
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SpacerBlock": {
        "type": "object",
        "description": "A vertical gap.",
        "required": [
          "type",
          "height"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "spacer"
            ]
          },
          "height": {
            "type": "number",
            "minimum": 1,
            "maximum": 600,
            "description": "Height in points."
          }
        }
      },
      "PageBreakBlock": {
        "type": "object",
        "description": "Forces the next block onto a new page.",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "pageBreak"
            ]
          },
          "header": {
            "type": [
              "object",
              "null"
            ],
            "description": "Omit to keep the document header, `null` for no header band, or an object to retitle that page.",
            "properties": {
              "title": {
                "type": "string"
              },
              "subtitle": {
                "type": "string"
              }
            }
          }
        }
      },
      "ImageBlock": {
        "type": "object",
        "description": "An inline picture uploaded with Upload Image. Height follows the aspect ratio.",
        "required": [
          "type",
          "fileId"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "image"
            ]
          },
          "fileId": {
            "type": "string"
          },
          "width": {
            "type": "number",
            "minimum": 20,
            "maximum": 483,
            "description": "Points. Defaults to the pixel width capped at the content width (483 points)."
          },
          "align": {
            "$ref": "#/components/schemas/Align"
          }
        }
      },
      "FieldType": {
        "type": "string",
        "description": "Input field type.",
        "enum": [
          "text",
          "multilineText",
          "date",
          "number",
          "email",
          "auMobile",
          "checkbox",
          "radio",
          "dropdown",
          "initials"
        ]
      },
      "DateFormat": {
        "type": "string",
        "enum": [
          "DD/MM/YYYY",
          "DD/MM/YY",
          "MM/DD/YYYY",
          "MM/DD/YY",
          "YYYY-MM-DD",
          "MM/YYYY",
          "MM/YY"
        ],
        "default": "DD/MM/YYYY"
      },
      "FieldProperties": {
        "type": "object",
        "description": "An input the recipient fills in while signing.",
        "required": [
          "fieldType",
          "label",
          "recipient"
        ],
        "properties": {
          "fieldType": {
            "$ref": "#/components/schemas/FieldType"
          },
          "label": {
            "type": "string",
            "description": "Printed above the input (beside it for a single checkbox). Required fields get a `*`."
          },
          "recipient": {
            "type": "string",
            "description": "Key of the recipient who fills the field in."
          },
          "name": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]+$",
            "description": "Stable key the value is stored under. Defaults to a slug of the label; must be unique within the document."
          },
          "required": {
            "type": "boolean",
            "description": "Defaults to `true` for every type except `checkbox`."
          },
          "placeholder": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "string"
            },
            "description": "Required for `radio` and `dropdown` (at least 2); optional on `checkbox` to make a multi-select group."
          },
          "dateFormat": {
            "$ref": "#/components/schemas/DateFormat"
          }
        }
      },
      "FieldBlock": {
        "description": "A single input field spanning the content width.",
        "allOf": [
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "field"
                ]
              }
            }
          },
          {
            "$ref": "#/components/schemas/FieldProperties"
          }
        ]
      },
      "FieldRowBlock": {
        "type": "object",
        "description": "Two or three inputs side by side in equal columns, kept whole on one page.",
        "required": [
          "type",
          "fields"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "fieldRow"
            ]
          },
          "fields": {
            "type": "array",
            "minItems": 2,
            "maxItems": 3,
            "items": {
              "$ref": "#/components/schemas/FieldProperties"
            }
          }
        }
      },
      "SignatureBlock": {
        "type": "object",
        "description": "A signature area with name, date-signed and signature fields bound to one recipient. Every signer should get exactly one.",
        "required": [
          "type",
          "recipient",
          "label"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "signatureBlock"
            ]
          },
          "recipient": {
            "type": "string",
            "description": "Must match a `key` in the request's `recipients`."
          },
          "label": {
            "type": "string",
            "maxLength": 100
          }
        }
      },
      "FileEntry": {
        "description": "A document in a session or template - a block document or a previously uploaded PDF.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/BlocksFileEntry"
          },
          {
            "$ref": "#/components/schemas/UploadedPdfFileEntry"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "blocks": "#/components/schemas/BlocksFileEntry",
            "uploadedPdf": "#/components/schemas/UploadedPdfFileEntry"
          }
        }
      },
      "BlocksFileEntry": {
        "type": "object",
        "required": [
          "type",
          "document"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "blocks"
            ]
          },
          "document": {
            "$ref": "#/components/schemas/BlockDocument"
          }
        }
      },
      "UploadedPdfFileEntry": {
        "type": "object",
        "description": "References a file from Upload File. The PDF's own form fields are imported as\nAirSign fields, and fields the PDF lacks (typically the signature) are placed with\n`fields`, by anchor text or page coordinates.\n",
        "required": [
          "type",
          "fileId"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "uploadedPdf"
            ]
          },
          "fileId": {
            "type": "string",
            "description": "The uploaded file."
          },
          "fileName": {
            "type": "string",
            "description": "Display name; defaults to the uploaded name."
          },
          "importFields": {
            "type": "boolean",
            "default": true,
            "description": "Import the PDF's own form fields."
          },
          "recipient": {
            "type": "string",
            "description": "Recipient key who fills the imported fields. Defaults to the first recipient."
          },
          "importedFields": {
            "type": "object",
            "description": "Per-field tweaks keyed by the PDF field name from the upload response.",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "recipient": {
                  "type": "string"
                },
                "required": {
                  "type": "boolean"
                },
                "exclude": {
                  "type": "boolean"
                }
              }
            }
          },
          "fields": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/PdfField"
            }
          }
        }
      },
      "PdfField": {
        "type": "object",
        "description": "A field placed on an uploaded PDF, either by anchor (`anchor`, `placement`, ...) or\nabsolutely (`page`, `x`, `y` in PDF points from the top-left; A4 is 595 x 842).\nField names must be unique within a file (imported names count).\n",
        "required": [
          "fieldType"
        ],
        "properties": {
          "fieldType": {
            "type": "string",
            "enum": [
              "text",
              "multilineText",
              "date",
              "number",
              "email",
              "auMobile",
              "checkbox",
              "radio",
              "dropdown",
              "initials",
              "signature",
              "dateSigned",
              "signerName"
            ]
          },
          "label": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "placeholder": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dateFormat": {
            "$ref": "#/components/schemas/DateFormat"
          },
          "anchor": {
            "type": "string",
            "description": "Text to find in the PDF (case-insensitive); the field is placed relative to it."
          },
          "placement": {
            "type": "string",
            "enum": [
              "right",
              "below",
              "above",
              "left",
              "over"
            ],
            "default": "right"
          },
          "anchorOccurrence": {
            "type": "integer"
          },
          "offsetX": {
            "type": "number"
          },
          "offsetY": {
            "type": "number"
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "w": {
            "type": "number",
            "description": "Width. Defaults: signature 100, text 200, checkbox/radio 12, initials 60."
          },
          "h": {
            "type": "number",
            "description": "Height. Defaults: signature 50, text 15, checkbox/radio 12, initials 40."
          },
          "optionSpacing": {
            "type": "number",
            "default": 60
          },
          "optionDirection": {
            "type": "string",
            "enum": [
              "row",
              "column"
            ]
          }
        }
      },
      "SessionRecipientInput": {
        "type": "object",
        "required": [
          "key",
          "name",
          "email"
        ],
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]+$",
            "description": "Stable identifier referenced by `recipient` on signature blocks and fields."
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "signingOrder": {
            "type": "integer",
            "description": "1-based signing order. Defaults to the array position."
          },
          "requireAccessPassword": {
            "type": "boolean",
            "default": false,
            "description": "The recipient must type a password (created on send, read with Get Recipient Password) before the documents open."
          }
        }
      },
      "TemplateRecipientInput": {
        "type": "object",
        "required": [
          "key"
        ],
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "name": {
            "type": "string",
            "description": "May be a `{{{variable}}}` token or left blank to fill in at session creation."
          },
          "email": {
            "type": "string",
            "description": "May be a `{{{variable}}}` token or left blank to fill in at session creation."
          },
          "signingOrder": {
            "type": "integer"
          },
          "requireAccessPassword": {
            "type": "boolean",
            "default": false,
            "description": "Each session created from the template gets its own password."
          }
        }
      },
      "TemplateRecipientOverride": {
        "type": "object",
        "description": "Overrides the template recipient at the same index. Pass `{}` to keep the template defaults.",
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "exclude": {
            "type": "boolean",
            "description": "Drop an optional recipient. Returns `RECIPIENT_NOT_OPTIONAL` if the template does not mark it optional."
          },
          "signingOrder": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "requireAccessPassword": {
            "type": "boolean",
            "description": "Defaults to the template recipient's setting."
          }
        }
      },
      "Zone": {
        "type": "object",
        "description": "A placed field on a document page.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "examples": [
              "signingZone"
            ]
          },
          "label": {
            "type": "string"
          },
          "page": {
            "type": "integer"
          },
          "recipientId": {
            "type": "string"
          },
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "w": {
            "type": "number"
          },
          "h": {
            "type": "number"
          }
        }
      },
      "RecipientSummary": {
        "type": "object",
        "properties": {
          "recipientId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "signingOrder": {
            "type": "integer"
          }
        }
      },
      "PasswordRecipient": {
        "type": "object",
        "properties": {
          "recipientId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          }
        }
      },
      "CreateSessionRequest": {
        "type": "object",
        "required": [
          "name",
          "files",
          "recipients"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 50
          },
          "files": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/FileEntry"
            }
          },
          "recipients": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/SessionRecipientInput"
            }
          },
          "sendImmediately": {
            "type": "boolean",
            "default": false,
            "description": "Email signing invitations now, or leave the session in draft for review."
          },
          "expiryDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 730,
            "description": "Days before the session expires. Requires the Session Expiry plan feature."
          },
          "reminderEnabled": {
            "type": "boolean",
            "description": "Send automatic reminders. Requires the Session Expiry plan feature."
          },
          "reminderFrequency": {
            "$ref": "#/components/schemas/ReminderFrequency"
          }
        }
      },
      "SessionSummary": {
        "type": "object",
        "description": "Returned by Create Session and Update Session.",
        "properties": {
          "name": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "`draft` unless the session was sent immediately."
          },
          "selfSignOnly": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fileId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fileName": {
                  "type": "string"
                },
                "zones": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Zone"
                  }
                },
                "sessionId": {
                  "type": "string"
                },
                "fieldCount": {
                  "type": "integer",
                  "description": "Number of fields placed on the file."
                }
              }
            }
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecipientSummary"
            }
          },
          "draftUrl": {
            "type": "string",
            "format": "uri",
            "description": "Opens the draft in the AirSign editor for review. Present for drafts."
          },
          "sent": {
            "type": "boolean"
          },
          "passwordRecipients": {
            "type": "array",
            "description": "Recipients that need an access password (only when sent and a recipient has `requireAccessPassword`).",
            "items": {
              "$ref": "#/components/schemas/PasswordRecipient"
            }
          },
          "warnings": {
            "type": "array",
            "description": "E.g. a recipient left without a signature field.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CreateSessionFromTemplateRequest": {
        "type": "object",
        "required": [
          "templateId"
        ],
        "properties": {
          "templateId": {
            "type": "string",
            "description": "The ID of the template to use; must be active."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 50,
            "description": "Defaults to the template name."
          },
          "sendImmediately": {
            "type": "boolean",
            "default": false
          },
          "recipients": {
            "type": "array",
            "description": "Overrides the template recipients by index. Must not exceed the number of template recipients.",
            "items": {
              "$ref": "#/components/schemas/TemplateRecipientOverride"
            }
          },
          "variableValues": {
            "type": "object",
            "description": "Template variable values keyed by variable name. Text variables accept strings,\nimage variables accept file IDs, table variables accept `{ headers, data }`.\nRequired variables must be provided.\n",
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/components/schemas/TableVariableValue"
                }
              ]
            }
          },
          "tagIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tag UUIDs to associate with the session."
          },
          "expiryDays": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 730,
            "description": "Days before the session expires; null means no expiry. Plan feature: Session Expiry."
          },
          "reminderEnabled": {
            "type": "boolean",
            "description": "Plan feature: Session Expiry."
          },
          "reminderFrequency": {
            "$ref": "#/components/schemas/ReminderFrequency"
          },
          "senderProfileId": {
            "type": "string",
            "description": "ID of a verified sender profile. Plan feature: Sender Profiles."
          },
          "overrideCompletionEmailRecipients": {
            "type": "string",
            "enum": [
              "all",
              "sender_only",
              "sender_and_cc",
              "none"
            ],
            "description": "Who receives the completion email. Plan feature: Advanced Completion Email."
          },
          "overrideAttachPdf": {
            "type": "boolean",
            "description": "Attach the signed PDF to the completion email. Plan feature: Advanced Completion Email."
          },
          "overrideAttachCertificate": {
            "type": "boolean",
            "description": "Attach the signing certificate to the completion email. Plan feature: Advanced Completion Email."
          },
          "overrideCreateCombinedDoc": {
            "type": "boolean",
            "description": "Create a combined PDF (all signed documents followed by the Certificate of Completion) when the session completes."
          },
          "overrideAttachCombinedDoc": {
            "type": "boolean",
            "description": "Attach the combined PDF to the completion email (requires overrideCreateCombinedDoc). Plan feature: Advanced Completion Email."
          },
          "overrideCustomCompletionMessage": {
            "type": "string",
            "maxLength": 50000,
            "description": "Custom message in the completion email. Plan feature: Advanced Completion Email."
          },
          "overrideDownloadLinkExpiryDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365,
            "description": "Days before the completion email download link expires. Plan feature: Advanced Completion Email."
          }
        }
      },
      "TableVariableValue": {
        "type": "object",
        "required": [
          "headers",
          "data"
        ],
        "properties": {
          "headers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "data": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      },
      "SessionFromTemplateResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "selfSignOnly": {
            "type": "boolean"
          },
          "expiryDays": {
            "type": [
              "integer",
              "null"
            ]
          },
          "expiryDate": {
            "type": [
              "string",
              "null"
            ]
          },
          "reminderEnabled": {
            "type": "boolean"
          },
          "reminderFrequency": {
            "$ref": "#/components/schemas/ReminderFrequency"
          },
          "senderProfileId": {
            "type": [
              "string",
              "null"
            ]
          },
          "overrideCompletionEmailRecipients": {
            "type": [
              "string",
              "null"
            ]
          },
          "overrideAttachPdf": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "overrideAttachCertificate": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "overrideCreateCombinedDoc": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "overrideAttachCombinedDoc": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "overrideCustomCompletionMessage": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "completedDate": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": "string"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fileId": {
                  "type": "string"
                },
                "fileName": {
                  "type": "string"
                },
                "fileType": {
                  "type": "string"
                },
                "namespace": {
                  "type": "string"
                },
                "zones": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Zone"
                  }
                },
                "sessionId": {
                  "type": "string"
                },
                "importedZones": {
                  "type": "boolean"
                }
              }
            }
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecipientSummary"
            }
          },
          "passwordRecipients": {
            "type": "array",
            "description": "Recipients that need an access password (only when sent and a recipient has `requireAccessPassword`).",
            "items": {
              "$ref": "#/components/schemas/PasswordRecipient"
            }
          },
          "tagIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SessionRecipient": {
        "type": "object",
        "properties": {
          "recipientId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "recipientType": {
            "type": "string",
            "examples": [
              "toCompleteEmail"
            ]
          },
          "signingOrder": {
            "type": "integer"
          },
          "requireAccessPassword": {
            "type": "boolean"
          }
        }
      },
      "Session": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "e.g. `draft`, `pending`, `inProgress`, `completed`, `completedAndGenerated`, `cancelled`, `expired`."
          },
          "selfSignOnly": {
            "type": "boolean"
          },
          "sessionType": {
            "type": "string",
            "examples": [
              "offlineSigning"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "completedDate": {
            "type": [
              "string",
              "null"
            ]
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fileId": {
                  "type": "string"
                },
                "fileName": {
                  "type": "string"
                },
                "fileType": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              }
            }
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionRecipient"
            }
          }
        }
      },
      "SessionListItem": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "selfSignOnly": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "completedDate": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiryDate": {
            "type": [
              "string",
              "null"
            ]
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionRecipient"
            }
          }
        }
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total number of matching items."
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "hasMore": {
            "type": "boolean",
            "description": "Whether there are more results beyond this page."
          }
        }
      },
      "SessionList": {
        "type": "object",
        "properties": {
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionListItem"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "UpdateSessionRequest": {
        "type": "object",
        "minProperties": 1,
        "description": "At least one field must be provided. `files` requires `recipients` in the same request.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 50
          },
          "files": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/FileEntry"
            }
          },
          "recipients": {
            "type": "array",
            "description": "With `files`, the full recipient list the new documents bind to. Alone, an in-place details update for the existing recipients, in signing order, same count.",
            "items": {
              "$ref": "#/components/schemas/SessionRecipientInput"
            }
          },
          "expiryDays": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 730,
            "description": "null clears it. Plan-gated (session expiry feature); counting starts when the session is sent."
          },
          "reminderEnabled": {
            "type": "boolean"
          },
          "reminderFrequency": {
            "$ref": "#/components/schemas/ReminderFrequency"
          }
        },
        "dependentRequired": {
          "files": [
            "recipients"
          ]
        }
      },
      "DeleteSessionResponse": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "previousStatus": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "`cancelled` when archived."
          },
          "permanent": {
            "type": "boolean"
          },
          "restorable": {
            "type": "boolean"
          }
        }
      },
      "SendSessionResponse": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "sentAt": {
            "type": "string",
            "format": "date-time"
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecipientSummary"
            }
          },
          "passwordRecipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PasswordRecipient"
            }
          }
        }
      },
      "SendInvitationRequest": {
        "type": "object",
        "description": "All fields optional. If none are provided, the invitation goes to the next pending recipient.",
        "properties": {
          "recipientId": {
            "type": "string"
          },
          "recipientEmail": {
            "type": "string",
            "format": "email"
          }
        }
      },
      "SendInvitationResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "sessionId": {
            "type": "string"
          },
          "recipientId": {
            "type": "string"
          },
          "recipientEmail": {
            "type": "string"
          },
          "sentAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RecipientPasswordResponse": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "recipientId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "accessPassword": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "DocumentDownloads": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "sessionStatus": {
            "type": "string"
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fileId": {
                  "type": "string"
                },
                "fileName": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri",
                  "description": "Short-lived pre-signed download URL."
                }
              }
            }
          },
          "expiresInSeconds": {
            "type": "integer"
          }
        }
      },
      "TemplateListItem": {
        "type": "object",
        "properties": {
          "templateId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "selfSignOnly": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "recipientCount": {
            "type": "integer"
          },
          "hasVariables": {
            "type": "boolean"
          }
        }
      },
      "TemplateList": {
        "type": "object",
        "properties": {
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateListItem"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "TemplateVariable": {
        "type": "object",
        "properties": {
          "variableId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "number",
              "date",
              "image",
              "table"
            ]
          },
          "required": {
            "type": "boolean",
            "description": "Whether a value must be provided when creating a session."
          },
          "defaultValue": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "Template": {
        "type": "object",
        "properties": {
          "templateId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "selfSignOnly": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fileId": {
                  "type": "string"
                },
                "fileName": {
                  "type": "string"
                }
              }
            }
          },
          "recipients": {
            "type": "array",
            "description": "Template recipients. Empty name/email fields should be filled when creating a session.",
            "items": {
              "type": "object",
              "properties": {
                "recipientId": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "recipientType": {
                  "type": "string"
                },
                "signingOrder": {
                  "type": "integer"
                },
                "optional": {
                  "type": "boolean",
                  "description": "Leave blank or pass `exclude: true` at this position when creating a session and the recipient is dropped."
                }
              }
            }
          },
          "variables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateVariable"
            }
          }
        }
      },
      "TemplateVariableInput": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "date",
              "number"
            ],
            "default": "text"
          },
          "required": {
            "type": "boolean",
            "default": true
          },
          "defaultValue": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "CreateTemplateRequest": {
        "type": "object",
        "description": "Provide exactly one of `document` or `files`.",
        "required": [
          "name",
          "recipients"
        ],
        "oneOf": [
          {
            "required": [
              "document"
            ]
          },
          {
            "required": [
              "files"
            ]
          }
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 50
          },
          "document": {
            "$ref": "#/components/schemas/BlockDocument"
          },
          "files": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/FileEntry"
            }
          },
          "recipients": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/TemplateRecipientInput"
            }
          },
          "variables": {
            "type": "array",
            "maxItems": 50,
            "description": "Every `{{{token}}}` used in the document must be declared here.",
            "items": {
              "$ref": "#/components/schemas/TemplateVariableInput"
            }
          },
          "activate": {
            "type": "boolean",
            "default": false,
            "description": "`true` creates the template as `active`; `false` creates a `draft` to review and activate in the editor."
          },
          "expiryDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 730,
            "description": "Default for sessions created from this template. Requires the Session Expiry plan feature."
          },
          "reminderEnabled": {
            "type": "boolean",
            "description": "Default for sessions created from this template. Requires the Session Expiry plan feature."
          },
          "reminderFrequency": {
            "$ref": "#/components/schemas/ReminderFrequency"
          }
        }
      },
      "CreateTemplateResponse": {
        "type": "object",
        "properties": {
          "templateId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active"
            ]
          },
          "pageCount": {
            "type": "integer"
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecipientSummary"
            }
          },
          "variables": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "editorUrl": {
            "type": "string",
            "format": "uri"
          },
          "activated": {
            "type": "boolean"
          }
        }
      },
      "UploadRequest": {
        "type": "object",
        "required": [
          "fileName",
          "data"
        ],
        "properties": {
          "fileName": {
            "type": "string",
            "maxLength": 255,
            "description": "File name. For PDFs a `.pdf` extension is added if missing."
          },
          "data": {
            "type": "string",
            "contentEncoding": "base64",
            "description": "Base64-encoded file bytes, without a `data:` URI prefix. Max 7MB decoded for PDFs, 2MB for images."
          }
        }
      },
      "UploadFileResponse": {
        "type": "object",
        "properties": {
          "fileId": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "fileType": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer"
          },
          "pageCount": {
            "type": "integer"
          },
          "pages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "pageNumber": {
                  "type": "integer"
                },
                "width": {
                  "type": "number"
                },
                "height": {
                  "type": "number"
                }
              }
            }
          },
          "formFields": {
            "type": "array",
            "description": "The PDF's own form fields in PDF points (top-left origin).",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "page": {
                  "type": "integer"
                },
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "w": {
                  "type": "number"
                },
                "h": {
                  "type": "number"
                }
              }
            }
          },
          "hasSignatureField": {
            "type": "boolean"
          },
          "nextStep": {
            "type": "string"
          }
        }
      },
      "UploadImageResponse": {
        "type": "object",
        "properties": {
          "fileId": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "fileType": {
            "type": "string"
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "sizeBytes": {
            "type": "integer"
          }
        }
      }
    }
  }
}
