{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/airsign-com-au/json-schema/airsign-com-au-create-session-from-template-request-schema.json",
  "title": "CreateSessionFromTemplateRequest",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/airsign-com-au-api-docs-openapi.json#/components/schemas/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": "#/$defs/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": "#/$defs/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": "#/$defs/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."
    }
  },
  "$defs": {
    "ReminderFrequency": {
      "type": "string",
      "enum": [
        "daily",
        "weekly",
        "monthly",
        "quarterly"
      ]
    },
    "TableVariableValue": {
      "type": "object",
      "required": [
        "headers",
        "data"
      ],
      "properties": {
        "headers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "data": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "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."
        }
      }
    }
  }
}