zSign Drafts API

The drafts API from zSign — 9 operation(s) for drafts.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 12

POST /api/documents/drafts Create Draft #
GET /api/documents/drafts/limits Envelope Limits #
GET /api/documents/drafts/{document_id} Get Draft #
PATCH /api/documents/drafts/{document_id} Update Draft #
DELETE /api/documents/drafts/{document_id} Delete Draft #
PUT /api/documents/drafts/{document_id}/fields Replace Draft Fields #
POST /api/documents/drafts/{document_id}/documents Add Draft Document #
PUT /api/documents/drafts/{document_id}/documents/order Reorder Draft Documents #
DELETE /api/documents/drafts/{document_id}/documents/{part_id} Remove Draft Document #
PATCH /api/documents/drafts/{document_id}/documents/{part_id} Rename Draft Document #
POST /api/documents/drafts/{document_id}/send Send Draft #
POST /api/documents/drafts/{document_id}/save-as-template Save Draft As Template #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/zsign-io:zsign-io-drafts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

zsign-io-drafts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: zSign Drafts API
  description: Document Processing and Signing Sessions API
  version: 1.0.0
tags:
- name: Drafts
paths:
  /api/documents/drafts:
    post:
      tags:
      - Drafts
      summary: Create Draft
      description: 'Create a draft the editor can place fields onto, either from

        uploaded PDF(s) (tagged or not) or by stamping out a fresh copy of an

        existing template.


        `files` (repeatable) creates a multi-document envelope; `file` is the

        single-document form and is still accepted; when both are given the

        order is `file` first, then `files`. `document_names` is an optional

        JSON array of display names aligned with that order. Exactly one of

        `file`/`files` or `template_id`.'
      operationId: create_draft_api_documents_drafts_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_create_draft_api_documents_drafts_post'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/documents/drafts/limits:
    get:
      tags:
      - Drafts
      summary: Envelope Limits
      description: 'Configured envelope limits, so the upload UI can show them before

        a submit rather than hardcoding a number that drifts from the server.'
      operationId: envelope_limits_api_documents_drafts_limits_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeLimitsOut'
      security:
      - HTTPBearer: []
  /api/documents/drafts/{document_id}:
    get:
      tags:
      - Drafts
      summary: Get Draft
      operationId: get_draft_api_documents_drafts__document_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Drafts
      summary: Update Draft
      description: 'Envelope title and/or the recipients typed so far, so the sender can

        leave for the editor and come back without retyping.'
      operationId: update_draft_api_documents_drafts__document_id__patch
      security:
      - HTTPBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DraftUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Drafts
      summary: Delete Draft
      description: 'Delete a whole draft: the row, its parts, and every GCS object they

        own. Session-auth twin of DELETE /api/v1/documents/drafts/{id}.'
      operationId: delete_draft_api_documents_drafts__document_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      - name: revision
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          title: Revision
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/documents/drafts/{document_id}/fields:
    put:
      tags:
      - Drafts
      summary: Replace Draft Fields
      description: 'Whole-list replace. Translates the wire''s nested `position` shape

        into the flat dict DocumentProcessor.normalize_fields expects -- see

        that method''s docstring for why the shapes differ and normalize_fields''

        contract cannot change (the live tag-parse path depends on it too).


        CONTRACT: the response''s `fields` must contain exactly one entry per

        submitted field, in the SAME ORDER they were sent.


        The editor reconciles this response to its own field list positionally

        (frontend/src/services/draftService.ts) and has no way to detect a

        violation -- it would silently apply one field''s server-confirmed name

        to a different field, and that wrong name would be written back on the

        next autosave and carried into the signed document.


        Nothing enforces this at the type level; it holds because every link is

        order-preserving by construction (the comprehension below, the

        one-append-per-input loop in normalize_fields, and returning that list

        directly rather than re-fetching). Do not add a sort, a group-by-page,

        or a position-dedupe step without also giving the client a stable

        per-field key to reconcile on instead. TestAutosaveFieldsHTTP''s ordering

        tests pin this.'
      operationId: replace_draft_fields_api_documents_drafts__document_id__fields_put
      security:
      - HTTPBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DraftFieldsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/documents/drafts/{document_id}/documents:
    post:
      tags:
      - Drafts
      summary: Add Draft Document
      description: 'Append one uploaded PDF, or every document of a saved template, to a

        draft envelope. Fields already placed keep their pages; inserted fields

        come after them. `role_mapping` (template only) is a JSON object

        {source_role: destination_role}; unmapped roles stay literal.'
      operationId: add_draft_document_api_documents_drafts__document_id__documents_post
      security:
      - HTTPBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_add_draft_document_api_documents_drafts__document_id__documents_post'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/documents/drafts/{document_id}/documents/order:
    put:
      tags:
      - Drafts
      summary: Reorder Draft Documents
      operationId: reorder_draft_documents_api_documents_drafts__document_id__documents_order_put
      security:
      - HTTPBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentOrderRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/documents/drafts/{document_id}/documents/{part_id}:
    delete:
      tags:
      - Drafts
      summary: Remove Draft Document
      operationId: remove_draft_document_api_documents_drafts__document_id__documents__part_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      - name: part_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Part Id
      - name: revision
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          title: Revision
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Drafts
      summary: Rename Draft Document
      operationId: rename_draft_document_api_documents_drafts__document_id__documents__part_id__patch
      security:
      - HTTPBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      - name: part_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Part Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentRenameRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/documents/drafts/{document_id}/send:
    post:
      tags:
      - Drafts
      summary: Send Draft
      description: 'Debit a credit, convert the draft in place into a sendable document,

        and send it -- see DraftDocumentService.send_draft''s docstring for the

        full choreography. Returns DocumentSendResponse, the same shape

        POST /api/v1/documents/send returns.'
      operationId: send_draft_api_documents_drafts__document_id__send_post
      security:
      - HTTPBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DashboardDraftSendRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentSendResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/documents/drafts/{document_id}/save-as-template:
    post:
      tags:
      - Drafts
      summary: Save Draft As Template
      description: 'Free. Copies the draft''s current bytes and parsed_fields into a new

        reusable template; the draft itself is left exactly as it was.'
      operationId: save_draft_as_template_api_documents_drafts__document_id__save_as_template_post
      security:
      - HTTPBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaveAsTemplateRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    EnvelopeLimitsOut:
      properties:
        max_documents:
          type: integer
          title: Max Documents
        max_file_bytes:
          type: integer
          title: Max File Bytes
        max_combined_bytes:
          type: integer
          title: Max Combined Bytes
      type: object
      required:
      - max_documents
      - max_file_bytes
      - max_combined_bytes
      title: EnvelopeLimitsOut
    FieldPosition:
      properties:
        page_number:
          type: integer
          minimum: 1.0
          title: Page Number
          description: Page number (1-indexed)
        file_position:
          type: integer
          minimum: 1.0
          title: File Position
          description: 1-based source PDF index in the envelope package. At most MAX_ENVELOPE_DOCUMENTS.
          default: 1
        x:
          type: number
          minimum: 0.0
          title: X
          description: X coordinate (top-left origin)
        y:
          type: number
          minimum: 0.0
          title: Y
          description: Y coordinate (top-left origin)
        width:
          type: number
          exclusiveMinimum: 0.0
          title: Width
          description: Field width
        height:
          type: number
          exclusiveMinimum: 0.0
          title: Height
          description: Field height
      type: object
      required:
      - page_number
      - x
      - y
      - width
      - height
      title: FieldPosition
      description: Position data for a field on the PDF
    SaveAsTemplateRequest:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
      type: object
      required:
      - name
      title: SaveAsTemplateRequest
      description: Body of POST /api/documents/drafts/{id}/save-as-template.
    DocumentSendResponse:
      properties:
        document_id:
          type: string
          format: uuid
          title: Document Id
        session_id:
          type: string
          format: uuid
          title: Session Id
        signing_urls:
          items:
            $ref: '#/components/schemas/SigningURL'
          type: array
          title: Signing Urls
        parsed_fields:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Parsed Fields
        filename:
          anyOf:
          - type: string
          - type: 'null'
          title: Filename
        documents:
          items:
            $ref: '#/components/schemas/PackageFileInfo'
          type: array
          title: Documents
        package_file_count:
          type: integer
          title: Package File Count
          default: 1
      type: object
      required:
      - document_id
      - session_id
      - signing_urls
      - parsed_fields
      title: DocumentSendResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DocumentOrderRequest:
      properties:
        order:
          items:
            type: string
            format: uuid
          type: array
          minItems: 1
          title: Order
        revision:
          anyOf:
          - type: integer
            minimum: 1.0
          - type: 'null'
          title: Revision
      type: object
      required:
      - order
      title: DocumentOrderRequest
    Body_create_draft_api_documents_drafts_post:
      properties:
        file:
          anyOf:
          - type: string
            contentMediaType: application/octet-stream
          - type: 'null'
          title: File
        files:
          anyOf:
          - items:
              type: string
              contentMediaType: application/octet-stream
            type: array
          - type: 'null'
          title: Files
        template_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Template Id
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        document_names:
          anyOf:
          - type: string
          - type: 'null'
          title: Document Names
      type: object
      title: Body_create_draft_api_documents_drafts_post
    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
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    DocumentRenameRequest:
      properties:
        name:
          type: string
          title: Name
        revision:
          anyOf:
          - type: integer
            minimum: 1.0
          - type: 'null'
          title: Revision
      type: object
      required:
      - name
      title: DocumentRenameRequest
    DraftField:
      properties:
        type:
          type: string
          enum:
          - signature
          - initials
          - text
          - date
          - checkbox
          - radio
          title: Type
        party:
          anyOf:
          - type: string
          - type: 'null'
          title: Party
        semantic_type:
          anyOf:
          - type: string
            const: full_name
          - type: 'null'
          title: Semantic Type
        label:
          anyOf:
          - type: string
            maxLength: 255
          - type: 'null'
          title: Label
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        required:
          type: boolean
          title: Required
          default: false
        position:
          $ref: '#/components/schemas/FieldPosition'
        document_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Document Id
        group:
          anyOf:
          - type: string
          - type: 'null'
          title: Group
        option_value:
          anyOf:
          - type: string
          - type: 'null'
          title: Option Value
        default_value:
          anyOf:
          - type: string
          - type: 'null'
          title: Default Value
        locked:
          type: boolean
          title: Locked
          default: false
      type: object
      required:
      - type
      - position
      title: DraftField
      description: One human-placed field, as the editor sends and receives it.
    DraftUpdateRequest:
      properties:
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        intended_recipients:
          anyOf:
          - items:
              $ref: '#/components/schemas/IntendedRecipientIn'
            type: array
          - type: 'null'
          title: Intended Recipients
        revision:
          anyOf:
          - type: integer
            minimum: 1.0
          - type: 'null'
          title: Revision
      type: object
      title: DraftUpdateRequest
    SigningURL:
      properties:
        recipient_email:
          type: string
          title: Recipient Email
        recipient_name:
          type: string
          title: Recipient Name
        signing_url:
          type: string
          title: Signing Url
        token:
          type: string
          title: Token
      type: object
      required:
      - recipient_email
      - recipient_name
      - signing_url
      - token
      title: SigningURL
    DashboardDraftSendRequest:
      properties:
        recipients:
          items:
            $ref: '#/components/schemas/RecipientData'
          type: array
          minItems: 1
          title: Recipients
        metadata:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Metadata
        send_invite:
          type: boolean
          title: Send Invite
          default: true
        send_completion_email:
          type: boolean
          title: Send Completion Email
          default: true
        sequential:
          type: boolean
          title: Sequential
          description: Whether recipients must sign in list order. Same flag as DocumentSendRequest.sequential. True (default) is one at a time; false is everyone at once.
          default: true
        prefill:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Prefill
          description: Per-send text values keyed by field "party:name". Sets or overrides each text field's default_value for this send only. Unknown or non-text keys are a 422 invalid_prefill_key.
      type: object
      required:
      - recipients
      title: DashboardDraftSendRequest
      description: 'Dashboard POST /api/documents/drafts/{id}/send requires recipients.


        v1 can omit them when they were stored at draft create. One shared

        model would publish the optional shape on both routes.'
    IntendedRecipientIn:
      properties:
        role:
          type: string
          title: Role
        name:
          type: string
          title: Name
          default: ''
        email:
          type: string
          title: Email
          default: ''
      type: object
      required:
      - role
      title: IntendedRecipientIn
    PackageFileInfo:
      properties:
        index:
          type: integer
          title: Index
        filename:
          type: string
          title: Filename
        pages:
          type: integer
          title: Pages
        sha256:
          type: string
          title: Sha256
        size:
          type: integer
          title: Size
      type: object
      required:
      - index
      - filename
      - pages
      - sha256
      - size
      title: PackageFileInfo
      description: 'One source PDF in a send/draft package. `index` is 1-based and

        matches field `file_position`.'
    Body_add_draft_document_api_documents_drafts__document_id__documents_post:
      properties:
        file:
          anyOf:
          - type: string
            contentMediaType: application/octet-stream
          - type: 'null'
          title: File
        template_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Template Id
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        role_mapping:
          anyOf:
          - type: string
          - type: 'null'
          title: Role Mapping
        revision:
          anyOf:
          - type: integer
          - type: 'null'
          title: Revision
      type: object
      title: Body_add_draft_document_api_documents_drafts__document_id__documents_post
    DraftFieldsRequest:
      properties:
        fields:
          items:
            $ref: '#/components/schemas/DraftField'
          type: array
          title: Fields
        intended_recipients:
          anyOf:
          - items:
              $ref: '#/components/schemas/IntendedRecipientIn'
            type: array
          - type: 'null'
          title: Intended Recipients
        revision:
          anyOf:
          - type: integer
            minimum: 1.0
          - type: 'null'
          title: Revision
      type: object
      required:
      - fields
      title: DraftFieldsRequest
      description: 'Body of PUT /api/documents/drafts/{id}/fields -- a whole-list

        replace, not per-field CRUD (see DraftDocumentService.replace_fields).'
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer