{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zsign-io/json-schema/zsign-io-agent-draft-response-schema.json",
  "title": "AgentDraftResponse",
  "description": "Unsent draft created or updated by an agent. Not a send receipt:\nno session_id, no signing_urls, credits_charged is always 0.",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zsign-io-openapi.yml#/components/schemas/AgentDraftResponse",
  "properties": {
    "document_id": {
      "type": "string",
      "format": "uuid",
      "title": "Document Id"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "ready_to_send"
      ],
      "title": "Status"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "filename": {
      "type": "string",
      "title": "Filename"
    },
    "parsed_fields": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Parsed Fields"
    },
    "parties": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Parties"
    },
    "recipients": {
      "items": {
        "$ref": "#/$defs/RecipientData"
      },
      "type": "array",
      "title": "Recipients"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Metadata"
    },
    "credits_charged": {
      "type": "integer",
      "title": "Credits Charged",
      "default": 0
    },
    "sent": {
      "type": "boolean",
      "title": "Sent",
      "default": false
    },
    "documents": {
      "items": {
        "$ref": "#/$defs/EnvelopeDocumentOut"
      },
      "type": "array",
      "title": "Documents",
      "default": []
    },
    "revision": {
      "type": "integer",
      "title": "Revision",
      "default": 1
    },
    "package_file_count": {
      "type": "integer",
      "title": "Package File Count",
      "default": 1
    }
  },
  "type": "object",
  "required": [
    "document_id",
    "status",
    "name",
    "filename",
    "parsed_fields",
    "parties",
    "recipients"
  ],
  "$defs": {
    "EnvelopeDocumentOut": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "filename": {
          "type": "string",
          "title": "Filename"
        },
        "page_start": {
          "type": "integer",
          "title": "Page Start"
        },
        "page_count": {
          "type": "integer",
          "title": "Page Count"
        },
        "position": {
          "type": "integer",
          "title": "Position"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "filename",
        "page_start",
        "page_count",
        "position"
      ],
      "title": "EnvelopeDocumentOut",
      "description": "One document inside an envelope, as every wire payload lists it."
    },
    "RecipientData": {
      "properties": {
        "email": {
          "type": "string",
          "format": "email",
          "title": "Email"
        },
        "name": {
          "type": "string",
          "maxLength": 255,
          "title": "Name"
        },
        "role": {
          "type": "string",
          "maxLength": 100,
          "title": "Role"
        },
        "signing_order": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Signing Order"
        }
      },
      "type": "object",
      "required": [
        "email",
        "name",
        "role"
      ],
      "title": "RecipientData"
    }
  }
}