> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vumasign.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rename a template’s fields and questions: names only, all or nothing.

> NAME THE BOXES YOUR DATA GOES INTO, ONCE, FOR EVERY ENVELOPE AFTER. Sets a field’s `data_key`, `label` and `subject`, and a question’s label. Nothing else can change here: not where a field is, its type, who fills it, its options, its rules or its conditions.

⚠️ `templates:name` IS EXPLICIT-ONLY: a full-access key does not hold it, and the key must name it. ⚠️ LIVE KEYS ONLY, and the key’s creator must still be a member: a template has no environment, so a test key’s rename would change what live envelopes contain.

⚠️ ALL OR NOTHING, AGAINST THE ETAG YOU READ. Send `If-Match`; every change applies, or none does. Only envelopes CREATED afterwards use the new names — an envelope already created, sent or not, keeps the names it was created with. Every change is recorded in the template’s naming record, with the key that made it, and summarised in your organisation’s activity.

A new key follows the naming grammar — `namespace.attribute` or `namespace.entity.attribute`, snake_case, such as `medical_aid.plan` — and may not start with a core namespace (`person`, `employer`, `employment`, `residential_address`, `postal_address`, `bank`), which is reserved for the core vocabulary, nor with a subject key. A key a field already has may be kept whatever it says. A box in a question takes no key of its own. `option_value`, and a question’s own key and subject, arrive with the core vocabulary and are refused until then.



## OpenAPI

````yaml /openapi.json patch /api/v1/templates/{templateId}/fields
openapi: 3.1.0
info:
  title: Vumasign API
  version: 0.2.0
  description: >-
    The Vumasign API. South African e-signature: templates, the addresses an

    integration writes values to, an idempotent send, and webhooks.


    **This document describes what exists today and nothing else.** It is not a

    roadmap, and there is deliberately no entry here for anything that has not

    shipped — a spec you can generate a client from and then discover was

    aspirational is worse than no spec at all.


    ## Authentication

        Authorization: Bearer vsk_live_…

    One header, one step. Keys are minted in Settings. `vsk_live_` and
    `vsk_test_`

    are different keys; the prefix is stored in clear so a leaked key is
    greppable

    and traceable to an organisation, while the secret is stored only as a hash.


    ## Errors


    Every refusal the API returns deliberately, at every status, is

    `{ "error": { "code", "message" } }`, and such a response is a failure **if

    and only if** it carries an `error` key — that test is correct even for a

    client that ignores the status line. An unexpected server failure may not
    have

    this shape: treat a 5xx without an `error` key as an `internal_error`, which

    is retryable. `code` is the

    contract and is stable forever; `message` is prose for a developer reading a

    log and may be reworded in any release.


    The root of this document carries **`x-error-codes`**: the closed enum, with

    `status`, `retryable`, `backoff`, `emitted` and `guidance` for each

    code. Branch on that rather than on our prose.


    ## Rate limits


    **600 requests a minute on any paid plan,

    60 on the free plan — and a test key

    gets the same number as a live one.** Per key, not per organisation, so a
    batch

    job and an interactive integration can be given a key each and neither can

    starve the other.


    The ceiling follows the PLAN rather than the kind of key, because the plan
    is

    what says whether this is production traffic or somebody evaluating us. On
    the

    API plan it is sized so that no honest workload meets it: a thousand
    envelopes

    with a status read each is two thousand requests, which is three and a half

    minutes rather than seventeen. The sandbox deliberately gets the *same*
    number

    rather than a larger one — an integration that passes in rehearsal is then
    an

    integration that passes live, and your `429` handling is exercised where

    meeting a `429` is free.


    Every successful authenticated response carries `RateLimit-Limit`,

    `RateLimit-Remaining` and `RateLimit-Reset` (seconds until the window

    closes, at most 60). Read them on your successes and you will never need to
    be

    refused. A 429 carries them too, and additionally carries `Retry-After`,
    which

    you should honour. A 401 carries none of them; a 403 may not, depending on

    whether it was decided before the request was counted. Each operation's

    responses say which others do.


    ⚠️ **A refused request still counts.** Retrying inside the window pushes the

    counter higher rather than holding it at the ceiling — which is why the
    backoff

    in `x-error-codes` is exponential and why `Retry-After` is worth reading

    rather than guessing at.


    ⚠️ The limits are **per minute**, and the window is fixed rather than
    sliding.

    Spending a whole window at the end of one minute and a whole window at the
    start

    of the next is possible; it is bounded at two windows' worth, which is a
    burst

    rather than an incident.


    ## Webhooks


    Register an endpoint with `POST /api/v1/webhooks`; the response carries the

    signing secret, **once**. The root of this document carries
    **`x-webhooks`**:

    the body we POST, the signature recipe (including the two mistakes that make
    a

    verifier look correct and be worthless), the published retry ladder, and the

    auto-disable rule. Read that before writing a receiver.


    ## What is not here yet


    No organisation-level email exists, so an auto-disabled webhook endpoint is

    discovered by polling rather than by being told. There is no way to change
    an

    envelope after it is created and before it is sent — `PATCH
    /v1/envelopes/{id}`

    is designed and not built — so a draft is created complete or not at all.
    Both

    are stated because a gap named is a gap somebody can plan around.


    ⚠️ **The rate limit above counts authenticated requests only.** A request

    carrying no key, or a key we cannot recognise, is refused before any counter
    is

    touched — a per-key ceiling cannot defend against a caller who has not
    presented

    a key, and pretending otherwise would be a promise we could not keep. That
    half

    belongs to the edge rather than to this API.


    (This section has twice described as missing something that now exists: the

    `uri` on every webhook body, which was `null` until

    `GET /api/v1/envelopes/{envelopeId}` gave it somewhere to point, and the
    rate

    limiter, which nothing enforced until the per-key ceiling above. Both were
    named

    here as gaps first, which is the point of naming them.)
servers:
  - url: https://app.vumasign.com
security:
  - ApiKey: []
tags:
  - name: Templates
    description: >-
      A template is a document with its signing roles and field placements
      authored once. Every envelope is made from one, or from a one-off pack.
  - name: Documents
    description: >-
      The pages of a template’s documents, served as PDF so that a client which
      has to show the paper can do so without rendering it itself.
  - name: Envelopes
    description: >-
      An envelope is one sending of a document to named people. Creating one is
      not sending it: a draft emails nobody until it is sent.
  - name: Webhooks
    description: >-
      Endpoints we POST signed events to when an envelope changes, with the
      health of each endpoint and a secret you can rotate without a gap.
  - name: Standing authorisations
    description: >-
      A grantor’s signed, brand-wide authority for your organisation to apply
      their signature to documents you send under that brand. Requested here; it
      takes effect only when the grantor signs the mandate and it is sealed. See
      /concepts/standing-authorisations.
  - name: Specification
    description: >-
      This document, served without a credential so that anybody can read what
      the API does before they hold a key.
paths:
  /api/v1/templates/{templateId}/fields:
    patch:
      tags:
        - Templates
      summary: 'Rename a template’s fields and questions: names only, all or nothing.'
      description: >-
        NAME THE BOXES YOUR DATA GOES INTO, ONCE, FOR EVERY ENVELOPE AFTER. Sets
        a field’s `data_key`, `label` and `subject`, and a question’s label.
        Nothing else can change here: not where a field is, its type, who fills
        it, its options, its rules or its conditions.


        ⚠️ `templates:name` IS EXPLICIT-ONLY: a full-access key does not hold
        it, and the key must name it. ⚠️ LIVE KEYS ONLY, and the key’s creator
        must still be a member: a template has no environment, so a test key’s
        rename would change what live envelopes contain.


        ⚠️ ALL OR NOTHING, AGAINST THE ETAG YOU READ. Send `If-Match`; every
        change applies, or none does. Only envelopes CREATED afterwards use the
        new names — an envelope already created, sent or not, keeps the names it
        was created with. Every change is recorded in the template’s naming
        record, with the key that made it, and summarised in your organisation’s
        activity.


        A new key follows the naming grammar — `namespace.attribute` or
        `namespace.entity.attribute`, snake_case, such as `medical_aid.plan` —
        and may not start with a core namespace (`person`, `employer`,
        `employment`, `residential_address`, `postal_address`, `bank`), which is
        reserved for the core vocabulary, nor with a subject key. A key a field
        already has may be kept whatever it says. A box in a question takes no
        key of its own. `option_value`, and a question’s own key and subject,
        arrive with the core vocabulary and are refused until then.
      operationId: renameTemplateFields
      parameters:
        - name: templateId
          in: path
          required: true
          description: The template’s `id`, as returned by the list endpoint.
          schema:
            type: string
            format: uuid
            examples:
              - 01960000-0000-4000-8000-0000000007e1
            description: A template id.
        - name: If-Match
          in: header
          required: true
          description: >-
            The `ETag` of the template you read. ⚠️ REQUIRED: without it, or
            with `*`, the answer is `precondition_required`. When it is no
            longer current the answer is `template_changed` with the current
            `ETag`, and nothing is renamed — unless every name you sent is
            already the stored one, which is what a retry of a rename that
            succeeded looks like, and is answered 200.
          schema:
            type: string
            description: An entity tag, quoted.
      requestBody:
        required: true
        description: The names to change, by field and question id.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RenameFieldsRequest'
              description: The names to change.
            examples:
              example:
                summary: A label-derived key replaced by one in the naming grammar
                value:
                  fields:
                    - id: 01960000-0000-4000-8000-00000000f1e1
                      data_key: staff.full_name
                      label: Full name
      responses:
        '200':
          description: The template as it now stands, with its new `ETag`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
                description: The template, in full.
              examples:
                example:
                  summary: The template as it now stands
                  value:
                    warnings: []
                    id: 01960000-0000-4000-8000-0000000007e1
                    name: Employment contract
                    created_at: '2026-09-01T08:30:00.000Z'
                    documents:
                      - id: 01960000-0000-4000-8000-00000000d0c5
                        page_count: 1
                    pages:
                      - document_id: 01960000-0000-4000-8000-00000000d0c5
                        page: 1
                        width: 595.28
                        height: 841.89
                        rotation: 0
                    roles:
                      - name: Employee
                        routing_type: sign
                        kind: party
                    subjects:
                      - key: employee
                        label: Employee
                    questions: []
                    fields:
                      - id: 01960000-0000-4000-8000-00000000f1e1
                        type: text
                        label: Full name
                        required: true
                        role: Employee
                        document_id: 01960000-0000-4000-8000-00000000d0c5
                        page: 1
                        subject: employee
                        data_key: staff.full_name
                        question_id: null
                        options: null
                        rect:
                          x: 0.1007929
                          'y': 0.2107045
                          w: 0.5288973
                          h: 0.0213805
                        context:
                          label: Full name
                          row: null
                          column: Full name
                          option: null
                          section: Employment contract
                          nearby:
                            - >-
                              <<text:Employee:Full
                              name:subject(employee):key(full_name)>>
                            - Full name
                          widget_name: null
                          tooltip: null
                    coverage:
                      prefillable: 1
                      core: 0
                      organisation: 1
                      legacy: 0
                      unnamed: 0
                      questions: 0
                      unnamed_groups: 0
                      unnamed_options: 0
                      collisions: 0
          headers:
            RateLimit-Limit:
              description: >-
                How many requests this key may make per minute: 600 on any paid
                plan and 60 on the free plan, the same in both environments. Per
                key, not per organisation — a second key has its own allowance.
                ⚠️ READ IT RATHER THAN ASSUMING IT: it is the number the
                database applied to this request, so it is right even when this
                description is out of date.
              schema:
                type: integer
                description: Requests permitted in the current minute.
            RateLimit-Remaining:
              description: >-
                How many of them are left, this one already counted. Zero on the
                request that is refused, and zero on every further request of
                that minute — ⚠️ a refused request still counts.
              schema:
                type: integer
                description: Requests remaining in the current minute.
            RateLimit-Reset:
              description: >-
                Seconds until the current minute closes and the allowance
                returns. At most 60, which is what makes the published
                exponential backoff converge in about six doublings rather than
                eleven.
              schema:
                type: integer
                description: Seconds until the window resets.
            ETag:
              description: >-
                The template’s entity tag: a strong validator, the hash of this
                whole body — every field, its `context`, `coverage` and
                `warnings` included — so it changes whenever anything in the
                body does, including a rename, a moved field, or text stored for
                a page. Send it as `If-None-Match` to read again cheaply, as
                `If-Match` to rename, and as `template_etag` when you create an
                envelope.
              schema:
                type: string
                description: A quoted SHA-256, in hex.
                examples:
                  - '"5c1f…"'
        '400':
          description: >-
            `invalid_request` — The request is malformed, or breaks a rule about
            its own shape: a body that is not JSON or does not match the
            operation’s schema (a missing or mistyped property, a value out of
            range), a document that is not a PDF or a Word file we can read, a
            text tag that cannot be placed, an `Idempotency-Key` that is present
            but not a valid key, a query parameter outside its range, or a
            cursor that names nothing. The `message` says which, and for a body
            names the property path (`recipients[0].email`) — there is no
            separate `param` field. Fix the request; retrying it unchanged will
            fail identically.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                description: The refusal.
        '401':
          description: >-
            `unauthenticated` — The credential was absent, unreadable, unknown,
            wrong or revoked — this answer is deliberately identical for all of
            them, so it cannot be used to probe which keys exist. Retrying the
            same request changes nothing. Check the key in Settings or issue a
            new one.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                description: The refusal.
        '403':
          description: >-
            `forbidden` — The key is valid and the organisation’s plan does not
            grant what this operation does. Nothing about the credential needs
            to change, and it is deliberately MORE specific than 401 because the
            caller has already proved they hold the key. TWO SITUATIONS PRODUCE
            IT. (1) THE PLAN EXCLUDES THE OPERATION: `POST /api/v1/templates` on
            the Free plan, which does not include authoring templates. A
            template that already exists stays readable at `GET
            /api/v1/templates`; authoring one needs a plan that includes
            templates. (2) WE CANNOT ESTABLISH WHAT THE PLAN INCLUDES, on any
            operation, so nothing is granted. That one is ours rather than
            yours, an ordinary account does not meet it, and it means ask us.


            `insufficient_scope` — This key is scoped and does not hold the
            scope this operation requires — `x-required-scope` on the operation
            names it, and the `WWW-Authenticate` header on the refusal repeats
            it (RFC 6750 §3.1). ⚠️ Retrying cannot help and neither can editing
            the key: scopes are fixed when a key is minted and no endpoint or
            screen can widen them. Issue a new key with the access it needs. A
            key created before scopes existed carries an empty scope list, which
            means EVERY capability, so this refusal cannot reach an integration
            that was already working.


            `test_key_cannot_edit_templates` — A `vsk_test_` key tried to rename
            a template’s fields. A template has no environment — one template
            serves test and live sends alike — so a test key’s rename would
            change what live envelopes contain, and a swapped address prefills
            the wrong box silently. Rename with a live key that names
            `templates:name`, or in the editor.


            `api_key_owner_removed` — The person who created this key has left
            the organisation, and everything the key creates or sends — an
            envelope, a batch, a template — is attributed to that person, who
            must still be a member. The key is not revoked and its reads still
            work, and so does managing webhooks; mint a new key from a current
            member and use that.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                description: The refusal.
        '404':
          description: >-
            `not_found` — No such resource — or none this key’s organisation can
            see, or one that has been archived, or an id that is not a uuid.
            Those four are one answer on purpose: "it exists but is not yours"
            is itself a disclosure. Do not retry; check the id against the list
            endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                description: The refusal.
        '412':
          description: >-
            `template_changed` — The template is not the version you checked:
            the `If-Match` on a rename, or the `template_etag` on an envelope
            create, names an etag that is no longer current. Nothing was written
            or created. Read the template again (`GET
            /api/v1/templates/{templateId}`; a rename’s refusal also carries the
            current `ETag`), look at what changed — a rename can swap which box
            an address fills — and send again with the new etag.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                description: The refusal.
          headers:
            ETag:
              description: >-
                The template’s entity tag: a strong validator, the hash of this
                whole body — every field, its `context`, `coverage` and
                `warnings` included — so it changes whenever anything in the
                body does, including a rename, a moved field, or text stored for
                a page. Send it as `If-None-Match` to read again cheaply, as
                `If-Match` to rename, and as `template_etag` when you create an
                envelope.
              schema:
                type: string
                description: A quoted SHA-256, in hex.
                examples:
                  - '"5c1f…"'
        '422':
          description: >-
            `field_unknown` — An `id` in the rename (a field’s, or a question’s)
            is not one of this template’s, or is not a uuid. Take ids from
            `fields[].id` and `questions[].id` of the template read the `ETag`
            came from. Nothing was renamed.


            `naming_rule_broken` — A name breaks a naming rule: the grammar
            (`namespace.attribute` or `namespace.entity.attribute`, snake_case),
            a core namespace, a subject key used as a namespace, an address
            given to a box in a question, or a collision with another field. The
            message names the rule and the fields. Nothing was renamed: change
            the names and send again.


            `value_subject_unknown` — A value names a subject the template does
            not declare. The subjects are in the template response; `null` is
            the subject for a field belonging to nobody in particular.


            `value_not_writable` — The address names real fields and none of
            them is one a caller may fill in — a `date_signed`, a `signer_name`,
            a signature. Those are written by the server or by the signer, and
            supplying them would be a forgery with extra steps.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                description: The refusal.
        '428':
          description: >-
            `precondition_required` — A rename needs `If-Match` set to the
            `ETag` of the template you read, so that it cannot overwrite a
            change you have not seen. `*` is not accepted, for the same reason.
            Read the template, then send its `ETag`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                description: The refusal.
        '429':
          description: >-
            `rate_limited` — This key has spent its minute. The limit is per KEY
            and per minute, and it follows your PLAN rather than the kind of key
            — 600 requests a minute on every paid plan, 60 on the free plan, and
            the sandbox gets the same number as production so that an
            integration which passes in rehearsal passes live. Every successful
            authenticated response, and this one, carries `RateLimit-Limit`,
            `RateLimit-Remaining` and `RateLimit-Reset` (seconds), so a client
            can slow down before it is made to. TWO OPERATIONS ALSO ANSWER IT
            FOR A REASON OF THEIR OWN. `POST /api/v1/envelopes/batches` costs
            one request per row and is refused WHOLE when its rows do not fit
            what is left of the key’s minute — `RateLimit-Remaining` says how
            many would. `GET
            /api/v1/envelopes/{envelopeId}/documents/{position}/draft` has its
            own per-envelope and per-organisation ceilings on renders each
            minute, and the `message` says which one refused; there
            `Retry-After` is that ceiling’s, while the `RateLimit-*` headers
            still describe the key. `Retry-After` on this refusal is at most 60
            and is read from the stored window rather than computed, so two of
            our instances refusing the same key quote the same instant. ⚠️ A
            REFUSED REQUEST STILL COUNTS: hammering a limit you have already
            exceeded pushes the counter higher rather than holding it. Honour
            `Retry-After`. If one key genuinely needs more throughput, issue a
            second one in Settings — the ceiling is a fairness and blast-radius
            control, not a commercial meter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                description: The refusal.
          headers:
            RateLimit-Limit:
              description: >-
                How many requests this key may make per minute: 600 on any paid
                plan and 60 on the free plan, the same in both environments. Per
                key, not per organisation — a second key has its own allowance.
                ⚠️ READ IT RATHER THAN ASSUMING IT: it is the number the
                database applied to this request, so it is right even when this
                description is out of date.
              schema:
                type: integer
                description: Requests permitted in the current minute.
            RateLimit-Remaining:
              description: >-
                How many of them are left, this one already counted. Zero on the
                request that is refused, and zero on every further request of
                that minute — ⚠️ a refused request still counts.
              schema:
                type: integer
                description: Requests remaining in the current minute.
            RateLimit-Reset:
              description: >-
                Seconds until the current minute closes and the allowance
                returns. At most 60, which is what makes the published
                exponential backoff converge in about six doublings rather than
                eleven.
              schema:
                type: integer
                description: Seconds until the window resets.
            Retry-After:
              description: >-
                Seconds to wait before retrying, from the stored end of the
                window. Always present on a 429, and never more than 60. On the
                per-key limit it equals `RateLimit-Reset`; a narrower limit,
                such as the draft render allowance, has a window of its own and
                may ask for a different wait. `x-error-codes` tells you to
                honour it; this is it.
              schema:
                type: integer
                description: Seconds to wait before retrying.
        '500':
          description: >-
            `internal_error` — Ours, not yours. ⚠️ RETRY WITH THE SAME
            `Idempotency-Key` YOU SENT THE FIRST TIME, on any operation that
            takes one — that is what makes a retry safe here, and sending a NEW
            key would create a second envelope or send the same one twice. The
            safe GETs in this document can be retried freely. (This entry used
            to say every operation here was a GET; the write endpoints have
            since shipped, and the reasoning moved with them.)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                description: The refusal.
      security:
        - ApiKey: []
components:
  schemas:
    RenameFieldsRequest:
      type: object
      description: >-
        The names to change. Send `fields`, `questions` or both; each entry
        names its `id` and at least one property to change. A property left out
        is left as it is. Any other property is refused.
      properties:
        fields:
          type: array
          minItems: 1
          maxItems: 500
          description: Fields to rename, each `id` once. At most 500.
          items:
            type: object
            description: One field’s new names.
            properties:
              id:
                type: string
                description: The field’s `id` (`fields[].id`).
              data_key:
                type:
                  - string
                  - 'null'
                minLength: 1
                maxLength: 100
                description: >-
                  The address values are written to, or null to remove it. A new
                  key follows the naming grammar (`namespace.attribute` or
                  `namespace.entity.attribute`, snake_case) and is not in a core
                  namespace or a subject key’s; the key a field already has may
                  be kept. Not on a field nobody may prefill, and not on a box
                  in a question.
              label:
                type:
                  - string
                  - 'null'
                minLength: 1
                maxLength: 200
                description: >-
                  What the sender reads beside the box, or null to remove it.
                  Not blank.
              subject:
                type:
                  - string
                  - 'null'
                minLength: 1
                description: >-
                  A subject key declared on this template (`subjects[].key`), or
                  null for the signer’s own. Not changed on a field nobody may
                  prefill: there the subject decides whether the field must be
                  completed.
            required:
              - id
        questions:
          type: array
          minItems: 1
          maxItems: 200
          description: Questions to rename, each `id` once. At most 200.
          items:
            type: object
            description: One question’s new label.
            properties:
              id:
                type: string
                description: The question’s `id` (`questions[].id`).
              label:
                type: string
                minLength: 1
                maxLength: 200
                description: What a signer reads above the boxes. Not blank.
            required:
              - id
    Template:
      type: object
      description: >-
        One template in full: its documents, its roles, its subjects, its
        questions and every field placement. This is the response an integrator
        reads once, by hand, to learn the ADDRESSES their values must be written
        to.
      properties:
        id:
          type: string
          format: uuid
          description: The template’s id. A bare uuid, no prefix.
        name:
          type: string
          description: What the sender called it.
        created_at:
          type: string
          format: date-time
          description: ISO 8601, UTC. Also the order this list is in — newest first.
        warnings:
          type: array
          description: >-
            What the template’s upload warned about, kept with the template: on
            the create response and on every read, so a template somebody
            uploaded on the dashboard says here what its upload said. Empty when
            there was nothing to say, and always present. A retry of the
            create’s `Idempotency-Key` answers with the same list.
          maxItems: 10
          items:
            $ref: '#/components/schemas/UploadWarning'
            description: One warning.
        documents:
          type: array
          description: The pack, in the order it is stacked.
          items:
            $ref: '#/components/schemas/Document'
            description: One document of the pack.
        pages:
          type: array
          description: >-
            ⚠️ THE DENOMINATOR FOR EVERY `Field.rect`, and a client doing field
            matching cannot skip it: a rectangle of fractions is dimensionless
            without the page it is a fraction of. Join on `(document_id, page)`,
            the same pair `fields` is joined by.


            Every page of every document of the pack, in the pack’s order and
            then by page number — the order a signer scrolls.
          items:
            $ref: '#/components/schemas/Page'
            description: 'One page: its size in points and its rotation.'
        roles:
          type: array
          description: The signing roles, in routing order.
          items:
            $ref: '#/components/schemas/Role'
            description: One role.
        subjects:
          type: array
          description: The people whose data this template collects.
          items:
            $ref: '#/components/schemas/Subject'
            description: One subject.
        questions:
          type: array
          description: The tickbox questions and how many answers each takes.
          items:
            $ref: '#/components/schemas/Question'
            description: One question.
        fields:
          type: array
          description: >-
            ⚠️ A FLAT LIST, NOT A MAP KEYED BY ADDRESS. Several fields sharing
            one `(subject, data_key)` pair is NORMAL — real forms ask for an ID
            number on the application and again on the declaration, and initials
            in the footer of all nine pages. A value supplied for an address
            means it for every box that asks.
          items:
            $ref: '#/components/schemas/Field'
            description: One field placement.
        coverage:
          $ref: '#/components/schemas/Coverage'
          description: >-
            How much of the template your integration can address, counted by
            the same code as the editor’s coverage line, so the two always
            agree. Part of the body, so the template’s `ETag` changes when it
            does.
      required:
        - id
        - name
        - created_at
        - warnings
        - documents
        - pages
        - roles
        - subjects
        - questions
        - fields
        - coverage
    Error:
      type: object
      description: >-
        The body of every refusal the API returns deliberately, at every status,
        from every endpoint. Such a response is a failure if and only if it
        carries an `error` key — that test is correct even for a client that
        ignores the status line, which is a thing real clients do. An unexpected
        server failure may not have this shape: treat a 5xx without an `error`
        key as an `internal_error`, which is retryable.
      properties:
        error:
          type: object
          description: The refusal. Anything added in future is added INSIDE this object.
          properties:
            code:
              type: string
              description: >-
                A stable snake_case identifier that will never change meaning or
                spelling. This is the contract; branch on it. See
                `x-error-codes` at the root of this document for retry semantics
                per code.
              enum:
                - unauthenticated
                - forbidden
                - insufficient_scope
                - not_found
                - invalid_request
                - rate_limited
                - internal_error
                - service_unavailable
                - idempotency_key_required
                - idempotency_key_reused
                - request_in_progress
                - template_archived
                - template_unusable
                - template_has_no_fields
                - template_changed
                - precondition_required
                - field_unknown
                - naming_rule_broken
                - recipient_role_unknown
                - recipient_role_missing
                - recipient_role_duplicated
                - value_subject_unknown
                - value_address_unknown
                - value_not_writable
                - value_not_lockable
                - locked_answer_missing
                - locked_answer_unusable
                - cannot_be_drawn
                - send_allowance_exhausted
                - test_key_cannot_send
                - test_key_cannot_read_documents
                - test_key_cannot_edit_templates
                - document_too_complex
                - test_key_cannot_mint
                - webhook_url_invalid
                - webhook_events_invalid
                - webhook_brand_unknown
                - webhook_limit_reached
                - api_key_owner_removed
                - envelope_sender_removed
                - recipient_not_embedded
                - recipient_not_yet_turn
                - recipient_cannot_sign
                - envelope_not_sent
                - envelope_not_draft
                - brand_has_no_embed_origins
                - recipient_cannot_be_embedded
                - recipient_verification_unavailable
                - recipient_mobile_unused
                - recipient_verification_not_allowed
                - batch_interrupted
                - brand_unknown
                - draft_not_available
                - standing_authorisations_not_enabled
                - authorisation_text_rejected
                - authorisation_validity_invalid
                - authorisation_not_revocable
                - authorisation_not_pending
                - authorisation_resend_limited
                - authorisation_not_renewable
                - authorisation_already_renewed
                - authorisation_unknown
                - authorisation_not_granted
                - authorisation_revoked
                - authorisation_expired
                - authorisation_not_yet_valid
                - authorisation_invalidated
                - authorisation_brand_mismatch
                - authorisation_environment_mismatch
                - authorisation_role_is_witness
                - authorisation_role_not_signing
                - authorisation_recipient_altered
                - authorisation_used_twice
                - authorisation_grantor_twice
                - authorisation_field_unsupported
                - authorisation_value_forbidden
                - authorisation_value_missing
                - authorisation_value_unlocked
                - authorisation_mark_too_small
                - authorisation_mark_unplaced
                - authorisation_without_signer
                - authorisation_mark_unavailable
                - authorisation_expires_during_batch
            message:
              type: string
              description: >-
                ⚠️ PROSE FOR A DEVELOPER READING A LOG, and NOT part of the
                contract. It may be reworded in any release; anything that
                parses it is broken by design.
          required:
            - code
            - message
      required:
        - error
    UploadWarning:
      type: object
      description: >-
        Something about the uploaded document you should know. Not a refusal:
        the template was made.
      properties:
        code:
          type: string
          enum:
            - personal-information
            - xfa-form
          description: >-
            `xfa-form`: a pure XFA form, which no field can be read from and
            whose pages may show only a viewer’s notice (dashboard uploads
            only).


            `personal-information`: the document already holds somebody’s
            details — South African ID numbers that pass their checksum, email
            addresses, phone numbers, or a signature baked into a signature cell
            as an image — and every envelope sent from this template will carry
            them. Usually a form that was filled in once and then uploaded as
            the template. Upload the blank form instead, or remove the details
            from it first.
        document:
          type: integer
          minimum: 1
          description: Which document of the upload it is about, counting from 1.
        message:
          type: string
          description: >-
            A sentence for a person, saying how many of each were found — never
            which: “This template appears to contain personal information: 2 ID
            numbers and 2 signatures. Every copy sent will include it.”
      required:
        - code
        - document
        - message
    Document:
      type: object
      description: >-
        One document of a template’s pack. Present so that a field’s `page`
        means something: the pack renders as one continuous column, so page 1
        occurs once per document. Listed in the order the pack is stacked, which
        is the order a signer scrolls.
      properties:
        id:
          type: string
          format: uuid
          description: >-
            The document’s id. ⚠️ ALSO THE `documentId` OF `GET
            /api/v1/documents/{documentId}/pages/{pageNumber}`, which is where
            you fetch the page itself to look at.
        page_count:
          type: integer
          description: How many pages this document contributes to the pack.
      required:
        - id
        - page_count
    Page:
      type: object
      description: >-
        One page of one of the template’s documents: how big it is and which way
        up it is. ⚠️ EVERY `Field.rect` IS A FRACTION OF THIS — a rectangle
        without its page is dimensionless, so a client that ignores this array
        cannot tell a portrait page from a landscape one and cannot check its
        own render against ours.
      properties:
        document_id:
          type: string
          format: uuid
          description: >-
            Which document of the pack. Matches `Document.id` and
            `Field.document_id`.
        page:
          type: integer
          description: >-
            1-indexed, WITHIN `document_id` and not within the pack. Matches
            `Field.page`, and is the `pageNumber` of `GET
            /api/v1/documents/{documentId}/pages/{pageNumber}`.
        width:
          type: number
          description: >-
            The visible width in PDF points (1/72 inch). ⚠️ ALREADY ROTATED —
            this is the width of the page as it is drawn and as you will see it.
            A4 portrait is 595.28; the same page at `rotation: 90` reports
            841.89 here.
          examples:
            - 595.28
        height:
          type: number
          description: The visible height in PDF points. Already rotated, like `width`.
          examples:
            - 841.89
        rotation:
          type: integer
          examples:
            - 0
          description: >-
            One of 0, 90, 180 or 270. ⚠️ INFORMATION, NOT AN INSTRUCTION.
            `width`, `height` and every `Field.rect` on this page are ALREADY
            expressed against the rotated page. A client that rotates the
            geometry again because this says 90 places every field wrongly, and
            the result looks entirely plausible.


            It is published for the two things it is genuinely needed for:
            telling a page that is landscape because it was rotated from one
            that was authored landscape, and checking that whatever produced
            your image honoured the rotation at all — if your image’s aspect
            ratio disagrees with `width`/`height`, your renderer is what is
            wrong.
      required:
        - document_id
        - page
        - width
        - height
        - rotation
    Role:
      type: object
      description: >-
        A signing role, addressed by NAME and never by position. A positional
        address breaks the moment a sender reorders a template; the array
        arrives in routing order, so nothing is lost by omitting the index.
      properties:
        name:
          type: string
          description: What the sender called this role. Matches `Field.role`.
        routing_type:
          type: string
          description: What this role does with the document.
          enum:
            - sign
            - approve
            - cc
        kind:
          type: string
          description: >-
            Whether this role is a `party` to the document or a `witness` to a
            signature. A witness role is pre-signed under a standing
            authorisation only when the authorisation was granted for witness
            use and your organisation has witness use enabled, and the document
            then says the witness was not present. Once marked a witness it
            cannot be made a party again.
          enum:
            - party
            - witness
      required:
        - name
        - routing_type
        - kind
    Subject:
      type: object
      description: >-
        A subject: a person the document is ABOUT, as opposed to a recipient,
        who signs, approves or receives a copy of it — a spouse or a dependant
        on an application the main member signs. A subject and a recipient are
        two different records, and one person can be both: the main member is
        the `main_member` subject and also the recipient who signs. The SUBJECT
        record has no email address and is never emailed, sent a signing link or
        asked to sign; whoever fills in its fields does so as a recipient, under
        their own role. Half of every field address — `first_name` under the
        subject `spouse` is a different datum from `first_name` under the
        subject `main_member`.


        ⚠️ WHETHER A SUBJECT IS `required` OR `conditional` IS NOT REPORTED
        HERE. It is set when the template is created (`subjects[].presence`) or
        in the editor, and it decides whether `subjects` on `POST
        /api/v1/envelopes` may leave this person off an envelope. See
        [Subjects](https://docs.vumasign.com/concepts/subjects).
      properties:
        key:
          type: string
          description: >-
            The machine half of the address — letters, digits and underscores
            only, so it can never contain a dot. A subject declared today is
            lower-case `a`–`z`, `0`–`9` and `_`; one stored under an older,
            wider rule is returned exactly as stored. Matches `Field.subject`,
            and is what `values[].subject` and `subjects` on `POST
            /api/v1/envelopes` name. It never changes once created, so this is
            what to match your own records against.
        label:
          type: string
          description: >-
            What the sender called this person, and what a signer reads. The
            sender may rename it at any time without the `key` moving, so it is
            for display, not for matching.
      required:
        - key
        - label
    Question:
      type: object
      description: >-
        ⚠️ A QUESTION, WHICH IS WHAT A SET OF TICKBOXES MEANS. A caller
        supplying a value for "Race" has to know the question takes exactly one
        answer, and no individual tickbox can tell them: `required` is per
        option, so a "required" Race question would mean every race must be
        ticked. The bounds here are the answer.
      properties:
        id:
          type: string
          format: uuid
          description: >-
            ⚠️ A JOIN KEY WITHIN THIS RESPONSE, NOT AN ADDRESS. Nothing in the
            API accepts it as input. It exists because a question has no natural
            key — two questions on one form legitimately called "Other" are a
            form, not a mistake — so joining fields to questions by name would
            merge them.
        name:
          type: string
          description: 'What a signer reads above the boxes: "Race", "Marital status".'
        min_selected:
          type: integer
          description: 0 makes the question optional. `>= 1` is what "required" means here.
        max_selected:
          type: integer
          description: >-
            1 makes the question exclusive. ⚠️ It is NOT always 1: "tick any
            that apply, at least one" is `(1, n)`. Never 0 — a question that
            takes no answers is not a question.
      required:
        - id
        - name
        - min_selected
        - max_selected
    Field:
      type: object
      description: >-
        One placement on the paper. ⚠️ ONE ARRAY WITH A `type` DISCRIMINATOR,
        not one array per type: DocuSign has 37 typed tab arrays, so adding a
        type is a breaking change there and a generic client must enumerate 37
        keys.
      properties:
        id:
          type: string
          format: uuid
          description: >-
            ⚠️ THE HANDLE FOR EXACTLY ONE FIELD, AND NOT A SECOND ADDRESS.
            `subject` + `data_key` is the address and it names a SET of fields
            on purpose — one `main_member.id_number` is meant to fill the box on
            the application, the box on the declaration and the initials in nine
            footers. Write values to the ADDRESS by default. Use this id when
            you need to name ONE of several boxes the address cannot tell apart,
            or to keep a durable reference to a particular box. The two can
            never name the same target, so there is no precedence to learn: an
            id is one field, an address is a set. ⚠️ NOTHING ACCEPTS IT AS INPUT
            TODAY — `values` on `POST /api/v1/envelopes` is addressed by
            `subject` and `key`, and there is no id-keyed form. ⚠️ IT IS STABLE
            across ordinary editing — the sender may move, retype, relabel and
            readdress a box, or delete its neighbours, and this value does not
            change — so it is safe to store. ⚠️ IT NAMES A TEMPLATE FIELD:
            sending a template COPIES its fields onto the envelope, and those
            copies are their own rows with their own ids.
        type:
          type: string
          description: >-
            What kind of box this is. This vocabulary is `FIELD_TYPES` verbatim
            and the database CHECK constraint’s, not a translation of either.
          enum:
            - signature
            - initial
            - text
            - date
            - checkbox
            - dropdown
            - attachment
            - date_signed
            - signer_name
            - signer_email
            - signer_title
            - signer_company
        label:
          type:
            - string
            - 'null'
          description: >-
            What is printed beside the box. Null for a box the sender never
            named.
        required:
          type: boolean
          description: >-
            ⚠️ ALWAYS FALSE ON A GROUPED OPTION — requiredness lives on the
            question, so read `min_selected` there instead. This flag is the
            answer for independent boxes only.
        role:
          type: string
          description: WHO fills this in. Matches `Role.name`.
        document_id:
          type: string
          format: uuid
          description: Which document of the pack this box is on. Matches `Document.id`.
        page:
          type: integer
          description: 1-indexed, WITHIN `document_id` and not within the pack.
        subject:
          type:
            - string
            - 'null'
          description: >-
            WHOSE datum this is — a `Subject.key` — or null for the signer’s
            own. Half of the address.
        data_key:
          type:
            - string
            - 'null'
          description: >-
            ⚠️ THE OTHER HALF OF THE ADDRESS, AND NULL IS THE MOST USEFUL THING
            THIS ENDPOINT SAYS. Null means this box has no address at all and an
            integration CANNOT write to it. Find those here, against your own
            data model, rather than by watching a send leave them blank. ⚠️ It
            may contain a dot and any Unicode letter — South Africa has eleven
            official languages and a Sesotho label is not a malformed address —
            which is why this is never composed with `subject` into one dotted
            string.
        question_id:
          type:
            - string
            - 'null'
          description: >-
            The `Question.id` this box is an option of, or null for an
            independent one.
        options:
          type:
            - array
            - 'null'
          items:
            type: string
            description: >-
              One option, exactly as a signer sees it and exactly as it is
              sealed.
          description: >-
            WHAT A `dropdown` OFFERS, in the order the signer reads them. Null
            on every other type. An option is ONE STRING — what is shown, what
            you write back, and what is sealed onto the document; there is no
            separate value and label, so the string on the certificate cannot
            disagree with the string in the database. ⚠️ A value you write to a
            dropdown MUST be one of these exactly: anything else is refused. ⚠️
            Null on a dropdown created before options existed — such a field
            cannot be answered at all, by you or by a signer, and has to be
            given a list in the editor.
        rect:
          $ref: '#/components/schemas/Rect'
          description: >-
            ⚠️ WHERE THE BOX IS ON THE PAGE, AND THE REASON THIS ENDPOINT IS
            USABLE BY SOMETHING THAT CAN SEE. `label` says what is printed
            beside the box and `data_key` says what may be written into it; on a
            real form neither is enough. A nine-page medical application carries
            284 fields named `checklist.17` and `fullwidth.42`, with OCR-derived
            labels, where "ID or passport number" appears four times on one page
            and only the POSITION says which dependant it belongs to.


            Fetch the page it is on from `GET
            /api/v1/documents/{document_id}/pages/{page}`, render it, and these
            four fractions land on the box. ⚠️ Read `Rect` before using them:
            origin top-left, Y downward, measured against the page AFTER
            rotation.
        context:
          oneOf:
            - $ref: '#/components/schemas/FieldContext'
              description: The printed text around the box.
            - type: 'null'
              description: >-
                The document’s text has not been stored, or the template is too
                dense to describe in one read.
          description: >-
            The printed text around the box: see `FieldContext`. ⚠️ NULL MEANS
            THE DOCUMENT’S TEXT HAS NOT BEEN STORED — a document uploaded before
            this existed and not yet backfilled, or one carrying more text than
            is stored — or that the template has more fields and printed text
            than one read describes. It never means the page is blank. Fetch the
            page with `documents:read` to read it yourself.
      required:
        - id
        - type
        - label
        - required
        - role
        - document_id
        - page
        - subject
        - data_key
        - question_id
        - options
        - rect
        - context
    Coverage:
      type: object
      description: >-
        How much of a template an integration can address. Every count is of
        fields except `questions` and `unnamed_groups`, which count questions.
        `core + organisation + legacy + unnamed = prefillable`.
      properties:
        prefillable:
          type: integer
          minimum: 0
          description: >-
            Fields an integration may write a value into: every type except
            those the signer performs or the system stamps.
        core:
          type: integer
          minimum: 0
          description: >-
            Prefillable fields whose `data_key` is a key of the core vocabulary.
            ⚠️ The core vocabulary is not published yet, so this is 0.
        organisation:
          type: integer
          minimum: 0
          description: >-
            Prefillable fields whose `data_key` follows the naming grammar
            (`namespace.attribute` or `namespace.entity.attribute`, snake_case)
            and is not in a core namespace.
        legacy:
          type: integer
          minimum: 0
          description: >-
            Prefillable fields with any other `data_key`, such as one derived
            from a label (`date_birth`). It still works as an address; it is a
            name to replace.
        unnamed:
          type: integer
          minimum: 0
          description: >-
            Prefillable fields with no `data_key`: no value can be written into
            them.
        questions:
          type: integer
          minimum: 0
          description: Tickbox questions.
        unnamed_groups:
          type: integer
          minimum: 0
          description: Questions none of whose boxes has a `data_key`.
        unnamed_options:
          type: integer
          minimum: 0
          description: Boxes with no `data_key` in a question where another box has one.
        collisions:
          type: integer
          minimum: 0
          description: >-
            Fields sharing an address they cannot share: two checkboxes at one
            `(subject, data_key)` (any value would tick both), or two fields of
            different types at one address. Two fields of the same other type at
            one address are one datum printed twice, and are not counted.
      required:
        - prefillable
        - core
        - organisation
        - legacy
        - unnamed
        - questions
        - unnamed_groups
        - unnamed_options
        - collisions
    Rect:
      type: object
      description: >-
        ⚠️ WHERE THE BOX IS. **Fractions of the VISIBLE page. Origin TOP-LEFT. Y
        increases DOWNWARD. `x`/`y` are the box’s TOP-LEFT corner.**


        To place it on an image of the page you rendered at any size:

        `left = x * imageWidth`, `top = y * imageHeight`, `width = w *
        imageWidth`, `height = h * imageHeight`. That arithmetic is correct at
        every resolution, which is the reason these are fractions and not
        points.


        ⚠️ "VISIBLE" MEANS AFTER ROTATION. A page with `rotation: 90` is
        measured as it is drawn and as it is seen, not as it is stored — so
        these fractions are already right for the image in front of you and must
        not be rotated again. Join `Page` on `(document_id, page)` for the
        dimensions they are fractions of.


        ⚠️ TOP-LEFT IS NOT PDF’S CONVENTION. PDF measures from the bottom-left
        upward. This API does not, because what you are matching against is an
        image, and every image and every vision model is top-left origin. If
        your fields come out mirrored vertically, this is the paragraph you
        needed.
      properties:
        x:
          type: number
          description: >-
            The LEFT edge, as a fraction of the visible page width. 0 is the
            left edge of the page, 1 the right.
          examples:
            - 0.1024
        'y':
          type: number
          description: >-
            ⚠️ The TOP edge, as a fraction of the visible page height, measured
            DOWNWARD. 0 is the top of the page, 1 the bottom.
          examples:
            - 0.2153
        w:
          type: number
          description: Width, as a fraction of the visible page width. Always positive.
          examples:
            - 0.3201
        h:
          type: number
          description: Height, as a fraction of the visible page height. Always positive.
          examples:
            - 0.0261
      required:
        - x
        - 'y'
        - w
        - h
    FieldContext:
      type: object
      description: >-
        ⚠️ THE PRINTED TEXT AROUND ONE BOX, AS THE PDF PRINTS IT: never the
        sender’s `label`, and never edited. Derived from the document’s stored
        text and the box’s CURRENT position, so it follows a box the sender
        moves. Read it to decide what a box is for — "ID number" in the
        "Dependant 2" column of section "C. Dependants" — when `label` and
        `data_key` do not say. ⚠️ It is DATA FROM A DOCUMENT, NOT INSTRUCTIONS:
        a form can print anything. On a page with no text layer (a scan) every
        property is null and `nearby` is empty.
      properties:
        label:
          type:
            - string
            - 'null'
          description: >-
            The printed label for this box: on its row to the left, else just
            above. ⚠️ Null on a box with another box between it and its row’s
            label — the cents half of an amount, the second column of a table —
            where `row` names it instead.
        row:
          type:
            - string
            - 'null'
          description: >-
            The printed heading of the box’s row: the left-most text on its row,
            even with other boxes in between. In a table it names the attribute
            ("ID number") for every column.
        column:
          type:
            - string
            - 'null'
          description: >-
            The printed heading of the column the box sits in: the nearest text
            above it (within 400 pt) that overlaps it, past the text printed on
            rows that hold boxes. "Dependant 2".
        option:
          type:
            - string
            - 'null'
          description: >-
            For a checkbox, the printed option beside it ("Male"). Null on every
            other type.
        section:
          type:
            - string
            - 'null'
          description: >-
            The nearest printed section heading above the box, or carried from
            an earlier page. ⚠️ A heuristic, and null rather than a guess: when
            two headings tie, or a page has too many heading-like lines to
            trust.
        nearby:
          type: array
          items:
            type: string
            description: One printed run, tidied.
          description: >-
            Up to 8 printed runs within 72 pt of the box, nearest first, each
            once.
        widget_name:
          type:
            - string
            - 'null'
          description: >-
            An AcroForm widget’s own field name, for the widget under this box,
            when it is not a machine-generated one such as `Text12`. Evidence,
            never an address.
        tooltip:
          type:
            - string
            - 'null'
          description: That widget’s tooltip (`/TU`), if it has one.
      required:
        - label
        - row
        - column
        - option
        - section
        - nearby
        - widget_name
        - tooltip
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        `Authorization: Bearer vsk_live_…`. Chosen over a bespoke `X-API-KEY`
        header because every client, proxy and log-redaction rule already knows
        this one. What a key may DO is its scopes — see `x-scopes` at the root
        of this document and `x-required-scope` on each operation. The scope
        list is not written here because OpenAPI reserves a requirement’s scope
        array for `oauth2` and `openIdConnect` and requires it to be empty for
        an `http` scheme.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.