{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/signvoy-com/json-schema/signvoy-com-create-document-dto-schema.json",
  "title": "CreateDocumentDto",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/signvoy-com-openapi.json#/components/schemas/CreateDocumentDto",
  "type": "object",
  "properties": {
    "templateId": {
      "type": "string",
      "description": "Template UUID to create document from",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "description": "Custom name for the document",
      "maxLength": 255
    },
    "message": {
      "type": "string",
      "description": "Message to include with the signing request",
      "maxLength": 5000
    },
    "emailSubject": {
      "type": "string",
      "description": "Replaces the generated subject line on the signing request, the awaiting-your-turn heads-up, and reminders (which stay prefixed with \"Reminder: \"). Completion, decline, void and expiry notices always use their standard wording. Leave unset for the generated subject.",
      "maxLength": 120
    },
    "routingMode": {
      "type": "string",
      "description": "Signing-order mode. parallel (default): all recipients are invited at once. sequential: recipients are activated group-by-group by ascending order value — the next group is only activated once the current group has fully signed.",
      "enum": [
        "parallel",
        "sequential"
      ],
      "default": "parallel"
    },
    "reminders": {
      "description": "Automatic reminder cadence for this document. When omitted, the template's reminder default (or the product default) is used.",
      "allOf": [
        {
          "$ref": "#/$defs/ReminderSettingsDto"
        }
      ]
    },
    "expiry": {
      "description": "Signing deadline for this document. When omitted, the template's deadline default (or the product default) is used.",
      "allOf": [
        {
          "$ref": "#/$defs/ExpirySettingsDto"
        }
      ]
    },
    "recipients": {
      "description": "Everyone involved with the document, in signing order — those who sign, those who must view and confirm, and those who just receive a copy. At least one must sign or view.",
      "minItems": 1,
      "type": "array",
      "items": {
        "$ref": "#/$defs/CreateDocumentRecipientDto"
      }
    }
  },
  "required": [
    "templateId",
    "recipients"
  ],
  "$defs": {
    "CreateDocumentRecipientDto": {
      "type": "object",
      "properties": {
        "roleKey": {
          "type": "string",
          "description": "Template role key this recipient fills (matches `version.content.recipients[].key`). Required for `signer`; ignored for `cc` and `viewer`, which hold no fields and are assigned a synthetic key."
        },
        "name": {
          "type": "string",
          "description": "Recipient's full name",
          "maxLength": 255
        },
        "email": {
          "type": "string",
          "description": "Recipient's email address for notifications",
          "maxLength": 254
        },
        "type": {
          "type": "string",
          "description": "What this recipient is asked to do. `signer` (default) fills in fields and signs. `cc` receives a copy and never holds up the signing order. `viewer` must open and confirm they reviewed the document, and blocks the order until they do.",
          "enum": [
            "signer",
            "cc",
            "viewer"
          ],
          "default": "signer"
        },
        "order": {
          "type": "number",
          "description": "Position in the signing order. Signers default to the order set on their template role. For a `cc` this is also *when* the copy is sent: a position after every signer gets the certified final document, while a mid-order position gets the document as it stands at that step.",
          "minimum": 1
        }
      },
      "required": [
        "roleKey",
        "name"
      ]
    },
    "ExpirySettingsDto": {
      "type": "object",
      "properties": {
        "days": {
          "type": "number",
          "description": "Days after sending that this document can still be signed. The absolute deadline is derived from this when the document is sent.",
          "minimum": 1,
          "maximum": 365,
          "default": 30
        }
      }
    },
    "ReminderSettingsDto": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether automatic reminders are enabled for this document",
          "default": true
        },
        "intervalDays": {
          "type": "number",
          "description": "Days between automatic reminder emails",
          "minimum": 1,
          "maximum": 30,
          "default": 3
        },
        "maxReminders": {
          "type": "number",
          "description": "Maximum number of automatic reminders before giving up",
          "minimum": 0,
          "maximum": 10,
          "default": 3
        }
      }
    }
  }
}