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

# Complete a document before every party has signed

> Complete a sent document now and seal it with the signatures it has. Use it when a party will never sign and the signatures already collected are enough. It can't be undone.

**Status Requirements:**
- Document must be in `PENDING` or `EXPIRED` status, and at least one party must have signed. Otherwise it returns `409 INVALID_STATE`.

**Permissions:**
- Requires the `FORCE_COMPLETE_DOCUMENT` workspace permission.

**Request Body:**
- `reason` (optional) - Free-text reason, stored on the audit log.

**What happens when you complete:**
1. Pending reminders are cancelled
2. The document is sealed in the background with the signatures it has
3. Each party that didn't sign is emailed that the document was completed without them
4. The `document.completed` webhook is triggered once the document is sealed

**Response:** Returns the document in the same shape as `GET /api/v1/documents/{id}`, without `fields`. Sealing runs in the background, so the status is still `PENDING` or `EXPIRED` until `document.completed` arrives.



## OpenAPI

````yaml /api/openapi.json post /api/v1/documents/{id}/complete
openapi: 3.1.0
info:
  title: sajn API
  version: 2026-10
  description: >-
    # sajn - API v1


    With the sajn REST API, you can add digital document signing to your own
    applications.


    ## Overview


    sajn is a Swedish digital document signing platform. With the API, you can:

    - Create and manage documents and templates

    - Add the parties who sign, review, or organize a document

    - Send documents for signing by email or SMS

    - Track document status and signatures

    - Manage contacts and companies

    - Organize documents with tags and custom fields

    - Verify identities with sajn ID, through BankID and other eIDs


    ## Authentication


    Every endpoint (except the health check) requires a bearer token in the
    Authorization header:


    ```

    Authorization: Bearer YOUR_TOKEN

    ```


    Two kinds of token are accepted:


    - **API key** (`sajn_sk_...`) — generated in the developer settings. A key
    belongs to a person or to a service account, a non-human account the
    organization owns, and can reach any endpoint that account's workspace role
    permits. Service-account keys keep working when the person who created them
    leaves.

    - **OAuth 2.0 access token** — issued via the authorization-code flow (PKCE
    for public clients) to a connected application. Bound to one workspace and
    limited to the **scopes** the user granted at consent — effective access is
    *workspace role ∩ granted scopes*.


    An API key acts in its default workspace. To act in another workspace the
    key's account is a member of, send its ID in the `Sajn-Workspace` header:


    ```

    Sajn-Workspace: WORKSPACE_ID

    ```


    `GET /api/v1/workspaces` lists the workspaces the token can reach. A
    workspace that doesn't exist and one the key can't reach both return `403
    WORKSPACE_ACCESS_DENIED`, and a header that isn't a single workspace ID
    returns `400 VALIDATION_FAILED`; the key's default workspace is never used
    instead.


    Each operation lists the OAuth scopes it requires in its security section.
    The scopes are coarse and resource-oriented (e.g. `documents:read`,
    `documents:write`, `documents:delete`, `contacts:read`). Personal API keys
    are not scope-limited; OAuth tokens are.


    ## Rate Limiting


    Limits apply per organization and scale with the plan:


    | Plan | Per minute |

    |---|---|

    | Basic | 60 |

    | Solo | 120 |

    | Team | 600 |

    | Enterprise | 2 000 |

    | Sandbox | 60 |


    Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and
    `X-RateLimit-Reset` for the minute window. A `429` response includes
    `Retry-After` in seconds.


    ## Query parameters


    Query parameters are plain strings, such as
    `?externalId=12345&archived=false`:

    - Booleans are `true` or `false`.

    - Dates are ISO 8601 dates (`2026-10-01`) or date-times
    (`2026-10-01T08:00:00Z`). A date-time without an offset is UTC.

    - Filters that take several values accept a comma-separated list
    (`status=PENDING,COMPLETED`) or a repeated parameter
    (`status=PENDING&status=COMPLETED`).


    An unknown query parameter returns `400`, so a misspelled filter never
    silently returns everything.


    ## Pagination


    Every list returns `{ data, hasMore, nextCursor }`. To walk a list, pass
    `nextCursor` as `cursor` on the next request, keep the other parameters
    unchanged, and stop when `hasMore` is `false`. `limit` sets the page size,
    from 1 to 100, with a default of 25. To get the number of items that match
    the filters, pass `include=total`, and the response adds `total`.


    Lists sort newest first. To sort another way, pass `orderBy` and
    `orderDirection` where the list takes them. A list bounded by its parent,
    such as a document's parties, returns every item in one response, with
    `hasMore` set to `false` and `nextCursor` set to `null`.


    On the documents list, the cursor is keyset-based: it stays correct while
    documents are created and updated between requests. To mirror documents into
    your own system, sort by `updatedAt` and use the `updatedAfter` filter.


    ## Idempotent requests


    Send an `Idempotency-Key` header (any unique string up to 255 characters,
    for example a UUID) on `POST`, `PATCH` or `DELETE` requests to make retries
    safe. The first request runs normally and its response is stored for 24
    hours, errors included. A retry with the same key and the same method, path
    and body returns the stored response with the header `Idempotent-Replayed:
    true`. Reusing a key with a different request returns `400
    IDEMPOTENCY_KEY_REUSED`; retrying while the first request is still running
    returns `409 IDEMPOTENCY_KEY_IN_USE` with `Retry-After`. Responses with a
    `429` or `5xx` status aren't stored, so the retry runs again. Keys are
    scoped to the workspace.


    ## Versioning


    The API is versioned by date (`YYYY-MM`), and this reference documents
    version `2026-10`. To choose the version for a request, send the
    `Sajn-Version` header:


    ```

    Sajn-Version: 2026-10

    ```


    Without the header, a request uses your organization's default version. An
    organization without a default is pinned to the latest version by its first
    request. Every response returns the version that served it in
    `Sajn-Version`. On a deprecated version, responses also carry `Deprecation`
    and `Sunset` headers, and from the sunset date its requests return `400`.
    For details, see https://docs.sajn.se/api-reference/versioning.


    ## Webhooks


    Each webhook endpoint has its own API version, set when you create it, that
    decides the payload shape. Deliveries carry it in the `Sajn-Version` header.


    The delivery body is the event, `{ id, type, createdAt, apiVersion,
    workspaceId, environment, actor, data }`, signed according to [Standard
    Webhooks](https://www.standardwebhooks.com) in the `webhook-id`,
    `webhook-timestamp` and `webhook-signature` headers. Common document events:

    - `document.created` - A document is created.

    - `document.sent` - A document is sent for signing.

    - `document.party.opened` - A party opens the document.

    - `document.party.signed` - A party signs the document.

    - `document.fully_signed` - Every signer has signed, before the document is
    sealed.

    - `document.completed` - The document is sealed and complete.

    - `document.rejected` - A party rejects the document.


    For every event type, see `POST /api/v1/webhooks`.


    ## Error Handling


    Every error response has the same JSON shape:


    ```json

    {
      "code": "NOT_FOUND",
      "message": "Document not found",
      "userMessage": "Dokumentet hittades inte.",
      "requestId": "req_V1StGXR8Z5jdHi6BmyT2",
      "resource": "document"
    }

    ```


    - `code` is always present and comes from the closed list in the following
    table. Branch on it, not on the status or the message.

    - `message` is English text for developers. When the operation has no more
    specific text, it's the meaning of `code` from the following table. Its
    wording can change, so don't parse it.

    - `userMessage` is always present. It's text that is safe to show your
    users, usually in Swedish.

    - `requestId` identifies the request and matches the `Sajn-Request-Id`
    header, which every response carries. Quote it when you contact support. On
    a replayed idempotent response, it identifies the original request.


    A `400 VALIDATION_FAILED` lists every problem in `issues`: `[{ "path":
    "parties.0.email", "code": "INVALID_FORMAT", "message": "Invalid email
    address" }]`. An issue `code` is one of `INVALID_TYPE`, `INVALID_FORMAT`,
    `INVALID_VALUE`, `TOO_SMALL`, `TOO_BIG` or `UNRECOGNIZED_KEY`, and an issue
    that no single input caused has an empty `path`. A `404 NOT_FOUND` names the
    type of the missing resource in `resource`, such as `document` or `party`,
    or `null` when the API can't tell. A `403 INSUFFICIENT_SCOPE` includes
    `requiredScopes` and `grantedScopes`.


    A `401` always means the credential itself is the problem: `UNAUTHORIZED`
    when it's missing, invalid or revoked, `API_KEY_EXPIRED` when the key has
    expired. A valid token that isn't allowed to do something gets a `403`. A
    `409 INVALID_STATE` means the resource's state doesn't allow the operation;
    change the state first, then retry. A `503 UPSTREAM_UNAVAILABLE` is safe to
    retry with exponential backoff, and so is a `429` after `Retry-After`
    seconds.


    The API returns the following codes:


    | Code | Status | Meaning |

    |---|---|---|

    | `VALIDATION_FAILED` | 400 | The request failed validation. `issues` lists
    every problem. |

    | `INVALID_JSON` | 400 | The request body isn't valid JSON. |

    | `EXPIRED` | 400 | The link, code or resource has expired. |

    | `IDEMPOTENCY_KEY_REUSED` | 400 | The `Idempotency-Key` was already used
    with a different request. |

    | `WORKSPACE_REQUIRED` | 400 | The API key has no default workspace. Name
    one with the `Sajn-Workspace` header. |

    | `INVALID_API_VERSION` | 400 | The `Sajn-Version` header names a version
    that doesn't exist. |

    | `API_VERSION_SUNSET` | 400 | The requested version, or your organization's
    default, is past its sunset date. |

    | `UNAUTHORIZED` | 401 | The API token is missing, invalid or revoked. |

    | `API_KEY_EXPIRED` | 401 | The API key has passed its expiry date. Create a
    new key. |

    | `PERMISSION_DENIED` | 403 | The token's user isn't allowed to perform the
    operation, for example because their workspace role lacks a permission. |

    | `WORKSPACE_ACCESS_DENIED` | 403 | The workspace named by the
    `Sajn-Workspace` header doesn't exist, or the token can't act in it. |

    | `INSUFFICIENT_SCOPE` | 403 | The OAuth token wasn't granted a scope the
    operation requires. See `requiredScopes` and `grantedScopes`. |

    | `PLAN_REQUIRED` | 403 | The organization's plan doesn't include API access
    or the feature. |

    | `ACCOUNT_INACTIVE` | 403 | The organization, user or membership behind the
    token is deactivated or suspended. |

    | `ACCOUNT_SETUP_REQUIRED` | 403 | The organization must finish its setup,
    such as verifying an accountable person, first. |

    | `LIMIT_EXCEEDED` | 403 | A plan limit was reached, such as the monthly
    number of sent documents. |

    | `DOCUMENT_NOT_READY` | 409 | The document can't be sent yet. `readiness`
    lists what blocks it, the same list `GET /api/v1/documents/:id/readiness`
    returns. |

    | `APPROVAL_REQUIRED` | 409 | The operation needs an approval first, such as
    sending a document that the workspace requires an approval for. Request one
    with `POST /api/v1/approval-requests`. |

    | `NOT_FOUND` | 404 | The resource doesn't exist, or the token can't access
    it. `resource` names its type, such as `document`, or is `null` when the API
    can't tell. |

    | `ROUTE_NOT_FOUND` | 404 | No endpoint matches the method and path in the
    requested API version. |

    | `INVALID_STATE` | 409 | The resource's current state doesn't allow the
    operation, such as editing a document that was already sent or downloading a
    file that isn't produced yet. |

    | `ALREADY_EXISTS` | 409 | A resource with the same unique value, such as
    `externalId`, already exists. |

    | `IDEMPOTENCY_KEY_IN_USE` | 409 | A request with the same `Idempotency-Key`
    is still running. Retry after `Retry-After` seconds. |

    | `RATE_LIMITED` | 429 | The per-minute rate limit was reached. Retry after
    `Retry-After` seconds. |

    | `INTERNAL_ERROR` | 500 | Something went wrong on sajn's side. Quote
    `requestId` when you contact support. |

    | `UPSTREAM_UNAVAILABLE` | 503 | A service the operation depends on, such as
    an eID provider or a connected integration, failed or is unavailable. Retry
    with exponential backoff. |


    ## Support


    For API support, documentation, or questions:

    - Email: dev@sajn.se

    - Documentation: https://docs.sajn.se

    - Status: https://status.sajn.se
  contact:
    name: sajn Support
    email: dev@sajn.se
    url: https://www.sajn.se/support
  license:
    name: Policy
    url: https://www.sajn.se/allmanna-villkor
servers:
  - url: https://app.sajn.se
    description: Production server
security: []
tags:
  - name: Health
    description: API health and version information
  - name: Documents
    description: Create, manage, and send documents for signing
  - name: Templates
    description: Create and manage templates that can be used to spin up new documents
  - name: Parties
    description: Manage document parties (signers and other participants)
  - name: Bundles
    description: >-
      Send several documents as one invitation, so each person signs all of
      theirs in one action
  - name: Contacts
    description: Manage contacts and contact information
  - name: Companies
    description: Manage companies and organizations
  - name: Fields
    description: Manage document fields and sections
  - name: Tags
    description: Organize documents with tags
  - name: Custom Fields
    description: Define and manage custom fields for documents
  - name: sajn ID
    description: Identity verification with Swedish BankID
  - name: Files
    description: >-
      Upload and manage files. `POST /api/v1/files` returns a presigned URL that
      you upload the bytes to.
  - name: Folders
    description: Organize documents and templates into hierarchical folders
  - name: Comments
    description: Thread-based discussion on documents
  - name: Reminders
    description: Send and inspect signing reminders on a document
  - name: Helpers
    description: 'Reference data: languages, countries, currencies, timezones'
  - name: Organization
    description: Authenticated organization metadata and branding
  - name: Webhook Deliveries
    description: Inspect and retry past webhook deliveries
  - name: Delegations
    description: Read-only access to signer delegation events on a document
  - name: Blocks
    description: Reusable library blocks for templates
paths:
  /api/v1/documents/{id}/complete:
    post:
      summary: Complete a document before every party has signed
      description: >-
        Complete a sent document now and seal it with the signatures it has. Use
        it when a party will never sign and the signatures already collected are
        enough. It can't be undone.


        **Status Requirements:**

        - Document must be in `PENDING` or `EXPIRED` status, and at least one
        party must have signed. Otherwise it returns `409 INVALID_STATE`.


        **Permissions:**

        - Requires the `FORCE_COMPLETE_DOCUMENT` workspace permission.


        **Request Body:**

        - `reason` (optional) - Free-text reason, stored on the audit log.


        **What happens when you complete:**

        1. Pending reminders are cancelled

        2. The document is sealed in the background with the signatures it has

        3. Each party that didn't sign is emailed that the document was
        completed without them

        4. The `document.completed` webhook is triggered once the document is
        sealed


        **Response:** Returns the document in the same shape as `GET
        /api/v1/documents/{id}`, without `fields`. Sealing runs in the
        background, so the status is still `PENDING` or `EXPIRED` until
        `document.completed` arrives.
      operationId: completeDocument
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The document ID.
          example: cm4k2x9p10003abcd1234efgh
        - name: Sajn-Version
          in: header
          required: false
          schema:
            type: string
            enum:
              - 2026-09
              - 2026-10
          description: >-
            API version for this request. Without it, the request uses the
            organization's default version; an organization without a default is
            pinned to the latest version by its first request.
        - name: Sajn-Workspace
          in: header
          required: false
          schema:
            type: string
          description: >-
            ID of the workspace this request acts in, from `GET
            /api/v1/workspaces`. Without it, an API key acts in its default
            workspace. The token's user must be a member of the workspace; an
            OAuth token only accepts the workspace it was granted for. A
            workspace that doesn't exist or can't be reached returns `403
            WORKSPACE_ACCESS_DENIED`.
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            maxLength: 255
          description: >-
            Makes retries safe. A retry with the same key and the same request
            replays the stored response for 24 hours (header
            `Idempotent-Replayed: true`); the same key with a different request
            returns 400.
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  description: >-
                    Optional reason for completing the document before every
                    party has signed. Stored on the audit log.
                  type: string
              description: >-
                Complete a PENDING or EXPIRED document before every party has
                signed. Seals it with the signatures it has.
            example:
              reason: Motparten har lämnat bolaget.
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique document identifier
                  externalId:
                    description: Your external reference ID for this document
                    type:
                      - string
                      - 'null'
                  expiresAt:
                    description: Date and time when the document expires
                    type:
                      - string
                      - 'null'
                    format: date-time
                  name:
                    type: string
                    description: Document name/title
                  status:
                    type: string
                    enum:
                      - DRAFT
                      - PENDING_APPROVAL
                      - PENDING
                      - COMPLETED
                      - EXPIRED
                      - CANCELLED
                      - REJECTED
                      - IMPORTED
                    description: Document status
                  documentMeta:
                    description: >-
                      Document metadata including subject, message, signing
                      order, etc.
                    type:
                      - object
                      - 'null'
                    properties:
                      subject:
                        description: Email subject line when sending document
                        type:
                          - string
                          - 'null'
                      message:
                        description: Custom message included in signing invitation
                        type:
                          - string
                          - 'null'
                      signingMode:
                        description: >-
                          How the parties sign: PARALLEL, all at once, or
                          SEQUENTIAL, one at a time in the order of each party's
                          `signingOrder`
                        type:
                          - string
                          - 'null'
                        enum:
                          - PARALLEL
                          - SEQUENTIAL
                          - null
                      forceReadFullDocument:
                        description: >-
                          Whether signers must read the entire document before
                          signing
                        type:
                          - boolean
                          - 'null'
                      showChatToSigners:
                        description: Whether to show document chat to signers
                        type:
                          - boolean
                          - 'null'
                      language:
                        description: >-
                          Language of the signing page and the emails to the
                          parties, an ISO 639-1 code such as `sv`
                        type:
                          - string
                          - 'null'
                        enum:
                          - sv
                          - en
                          - 'no'
                          - da
                          - fi
                          - de
                          - is
                          - es
                          - fr
                          - it
                          - null
                      value:
                        description: >-
                          The document's value, such as a contract amount, as
                          free text. It isn't an amount of money in minor units.
                        type:
                          - string
                          - 'null'
                      redirectUrl:
                        description: >-
                          URL to redirect signers to after signing is complete.
                          New values must be http(s); legacy values are returned
                          as stored.
                        type:
                          - string
                          - 'null'
                      redirectEnabled:
                        description: Whether redirect after signing is enabled
                        type:
                          - boolean
                          - 'null'
                      internalRecipients:
                        description: >-
                          Email addresses that receive a copy of the sealed PDF
                          once the document is completed
                        type:
                          - array
                          - 'null'
                        items:
                          type: string
                      signableAfterExpired:
                        description: >-
                          Whether the document remains signable after its
                          expiration date
                        type:
                          - boolean
                          - 'null'
                      sendPlainTextEmailOnly:
                        description: >-
                          Send plain text email invitations only (no HTML). null
                          inherits the workspace default.
                        type:
                          - boolean
                          - 'null'
                      reminderIntervalDays:
                        description: >-
                          Days between automatic reminders. `0` turns them off,
                          and null uses the default of 3.
                        type:
                          - integer
                          - 'null'
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      allowDelegation:
                        description: Whether signers may delegate signing to another person
                        type:
                          - boolean
                          - 'null'
                      openVerification:
                        description: >-
                          Verification every party passes before the document
                          opens: `PIN`, `SMS`, `EMAIL`, or an eID such as
                          `SE_BANKID`. null means none. A party's own
                          `openVerification` overrides it.
                        type:
                          - string
                          - 'null'
                        enum:
                          - PIN
                          - SMS
                          - EMAIL
                          - SE_BANKID
                          - NO_BANKID_BIOMETRIC
                          - NO_BANKID_HIGH
                          - DK_MITID
                          - DK_MITID_ERHVERV
                          - FI_FTN
                          - NL_IDIN
                          - null
                      aiChatEnabled:
                        description: >-
                          Whether the signer-facing AI chat is enabled. null
                          inherits the workspace default.
                        type:
                          - boolean
                          - 'null'
                      nationalIdDisplayMode:
                        description: >-
                          How national identity numbers are displayed to
                          signers: FULL, PARTIAL, or NONE. null inherits the
                          workspace default.
                        type:
                          - string
                          - 'null'
                        enum:
                          - FULL
                          - PARTIAL
                          - NONE
                          - null
                      sameDeviceSigning:
                        description: Whether all parties sign in sequence on one device
                        type:
                          - boolean
                          - 'null'
                      documentCategoryId:
                        description: >-
                          Document category (Dokumenttyp) scoping which custom
                          fields apply. See GET /api/v1/document-categories.
                        type:
                          - string
                          - 'null'
                    required:
                      - subject
                      - message
                      - signingMode
                      - forceReadFullDocument
                      - showChatToSigners
                      - language
                      - value
                      - redirectUrl
                      - redirectEnabled
                      - internalRecipients
                      - signableAfterExpired
                      - sendPlainTextEmailOnly
                      - reminderIntervalDays
                      - allowDelegation
                      - openVerification
                      - aiChatEnabled
                      - nationalIdDisplayMode
                      - sameDeviceSigning
                      - documentCategoryId
                    additionalProperties: false
                  createdAt:
                    description: Date and time when the document was created
                    type: string
                    format: date-time
                  updatedAt:
                    description: Date and time when the document was last updated
                    type: string
                    format: date-time
                  completedAt:
                    description: Date and time when all signers completed signing
                    type:
                      - string
                      - 'null'
                    format: date-time
                  deletedAt:
                    description: >-
                      Date and time when the document moved to the trash, or
                      null when it isn't in the trash
                    type:
                      - string
                      - 'null'
                    format: date-time
                  templateId:
                    description: ID of the template the document was created from, or null
                    type:
                      - string
                      - 'null'
                  folderId:
                    description: >-
                      ID of the folder that holds the document, or null at the
                      top level
                    type:
                      - string
                      - 'null'
                  responsibleUserId:
                    description: ID of the workspace member responsible for the document
                    type:
                      - string
                      - 'null'
                  parties:
                    description: >-
                      Array of document parties (signers and other
                      participants).
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: The party ID
                        documentId:
                          type: string
                          description: The ID of the document the party belongs to
                        email:
                          description: Signer email address
                          type:
                            - string
                            - 'null'
                          format: email
                          pattern: >-
                            ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                        name:
                          type: string
                          description: Signer full name
                        phone:
                          description: Signer phone number (for SMS notifications)
                          type:
                            - string
                            - 'null'
                        type:
                          type: string
                          enum:
                            - INDIVIDUAL
                            - COMPANY
                          description: 'Party type: INDIVIDUAL or COMPANY'
                        company:
                          description: >-
                            The company the party signs for, or null for a
                            private individual
                          type:
                            - object
                            - 'null'
                          properties:
                            id:
                              description: ID of the linked company in your workspace
                              type:
                                - string
                                - 'null'
                            name:
                              description: Company name
                              type:
                                - string
                                - 'null'
                            orgNumber:
                              description: Company organization number
                              type:
                                - string
                                - 'null'
                            role:
                              description: The party's role or title at the company
                              type:
                                - string
                                - 'null'
                          required:
                            - id
                            - name
                            - orgNumber
                            - role
                          additionalProperties: false
                        externalId:
                          description: Your external reference ID for this signer
                          type:
                            - string
                            - 'null'
                        contactId:
                          description: >-
                            ID of the contact this party was created from, if
                            any
                          type:
                            - string
                            - 'null'
                        nationalId:
                          description: >-
                            National identity number supplied by the sender when
                            creating the document. Optional — BankID works
                            without it, falling back to a name check. This is
                            input and is never overwritten with what the eID
                            verified: read the verified identity from GET
                            /api/v1/documents/{id}/signatures.
                          type:
                            - string
                            - 'null'
                        country:
                          description: >-
                            ISO 3166-1 alpha-2 country code of the party, such
                            as SE
                          type:
                            - string
                            - 'null'
                        role:
                          type: string
                          enum:
                            - SIGNER
                            - ORGANIZER
                            - REVIEWER
                          description: 'Signer role: SIGNER, ORGANIZER, or REVIEWER'
                        signingOrder:
                          description: Order for sequential signing (null for parallel)
                          type:
                            - number
                            - 'null'
                        signedAt:
                          description: >-
                            Date and time when the signer signed (null if not
                            signed)
                          type:
                            - string
                            - 'null'
                          format: date-time
                        readStatus:
                          type: string
                          enum:
                            - NOT_OPENED
                            - OPENED
                            - READ
                          description: 'Read status: NOT_OPENED, OPENED, or READ'
                        signingStatus:
                          type: string
                          enum:
                            - NOT_SIGNED
                            - SIGNED
                            - REJECTED
                          description: 'Signing status: NOT_SIGNED, SIGNED, or REJECTED'
                        delivery:
                          type: array
                          items:
                            type: string
                            enum:
                              - EMAIL
                              - SMS
                              - IN_APP
                          description: >-
                            How the party gets the invitation: `["EMAIL"]`,
                            `["SMS"]`, `["EMAIL", "SMS"]` for both, or
                            `["IN_APP"]` to sign in person on your device. `[]`
                            sends nothing, so you share the signing URL
                            yourself. Each channel needs the matching contact
                            detail.
                        signatureMethod:
                          description: >-
                            How the party signs: DRAWING, SE_BANKID,
                            CLICK_TO_SIGN, or another eID.
                          type:
                            - string
                            - 'null'
                          enum:
                            - NONE
                            - DRAWING
                            - SE_BANKID
                            - MANUAL
                            - CLICK_TO_SIGN
                            - NO_BANKID_BIOMETRIC
                            - NO_BANKID_HIGH
                            - NO_QES
                            - DK_MITID
                            - DK_MITID_ERHVERV
                            - FI_FTN
                            - NL_IDIN
                            - ZEALID_QES
                            - null
                        signVerification:
                          description: >-
                            Verification the party passes before signing: `PIN`,
                            `SMS`, `EMAIL`, or an eID such as `SE_BANKID`. null
                            means none. Call `GET
                            /api/v1/helpers/two-step-verifications` for the
                            methods your account can use.
                          type:
                            - string
                            - 'null'
                          enum:
                            - PIN
                            - SMS
                            - EMAIL
                            - SE_BANKID
                            - NO_BANKID_BIOMETRIC
                            - NO_BANKID_HIGH
                            - DK_MITID
                            - DK_MITID_ERHVERV
                            - FI_FTN
                            - NL_IDIN
                            - null
                        openVerification:
                          description: >-
                            Verification this party passes before the document
                            opens, in place of the document's
                            `openVerification`: `SMS`, `EMAIL`, or an eID such
                            as `SE_BANKID`. null uses the document's. `PIN` only
                            gates signing, so it isn't accepted here.
                          type:
                            - string
                            - 'null'
                          enum:
                            - PIN
                            - SMS
                            - EMAIL
                            - SE_BANKID
                            - NO_BANKID_BIOMETRIC
                            - NO_BANKID_HIGH
                            - DK_MITID
                            - DK_MITID_ERHVERV
                            - FI_FTN
                            - NL_IDIN
                            - null
                        sendStatus:
                          description: >-
                            Send status: NOT_SENT, SENT, DELIVERED, BOUNCED, or
                            FAILED
                          type:
                            - string
                            - 'null'
                          enum:
                            - NOT_SENT
                            - SENT
                            - DELIVERED
                            - BOUNCED
                            - FAILED
                            - null
                        identityVerified:
                          type: boolean
                          description: >-
                            True when an eID verified this signer — either by
                            signing with one or by passing an eID verification
                            gate.
                        identityMismatch:
                          type: boolean
                          description: >-
                            True when an eID completed, the identity did not
                            match the intended signer, and the signature was
                            still recorded — read GET
                            /api/v1/documents/{id}/signatures to see what
                            differed. Stays false when the workspace requires a
                            national ID match to sign and the attempt was
                            refused, because no signature exists; those attempts
                            appear only in the document audit trail.
                        createdAt:
                          description: When the party was added to the document
                          type: string
                          format: date-time
                      required:
                        - id
                        - documentId
                        - email
                        - name
                        - phone
                        - type
                        - company
                        - externalId
                        - contactId
                        - nationalId
                        - country
                        - role
                        - signingOrder
                        - signedAt
                        - readStatus
                        - signingStatus
                        - delivery
                        - signatureMethod
                        - signVerification
                        - openVerification
                        - sendStatus
                        - identityVerified
                        - identityMismatch
                        - createdAt
                      additionalProperties: false
                  tags:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: The tag ID.
                        name:
                          type: string
                        color:
                          type: string
                      required:
                        - id
                        - name
                        - color
                      additionalProperties: false
                  customFields:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: The custom field ID.
                        name:
                          type: string
                        type:
                          type: string
                          enum:
                            - TEXT
                            - NUMBER
                            - DATE
                            - EMAIL
                            - PHONE
                            - URL
                            - BOOLEAN
                            - SELECT
                            - JSON
                            - TEXTAREA
                        value:
                          type:
                            - string
                            - 'null'
                      required:
                        - id
                        - name
                        - type
                        - value
                      additionalProperties: false
                  content:
                    description: >-
                      Content blocks in position order when you pass
                      `expand=content`, and null otherwise. See the content
                      endpoints for the per-type shapes.
                    type:
                      - array
                      - 'null'
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Unique field identifier
                        documentId:
                          description: Document this field belongs to
                          type:
                            - string
                            - 'null'
                        templateId:
                          description: Template this field belongs to
                          type:
                            - string
                            - 'null'
                        type:
                          type: string
                          enum:
                            - TEXT
                            - HTML
                            - FORM
                            - PDF
                            - PRODUCT_TABLE
                            - TABLE
                            - SPACER
                            - PAGE_BREAK
                            - DURATION
                          description: Field type
                        position:
                          type: number
                          description: >-
                            0-based order of the field among the document's
                            content blocks
                        fieldMeta:
                          anyOf:
                            - oneOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - TEXT
                                    content:
                                      type: string
                                    locked:
                                      type: boolean
                                    sectionStyle:
                                      type: object
                                      properties:
                                        background:
                                          type: string
                                          enum:
                                            - NONE
                                            - MUTED
                                            - TINT
                                            - ACCENT
                                            - DARK
                                        padding:
                                          type: string
                                          enum:
                                            - NONE
                                            - SM
                                            - MD
                                            - LG
                                        bleed:
                                          type: boolean
                                        border:
                                          type: boolean
                                      additionalProperties: false
                                    visibilityRule:
                                      type: object
                                      properties:
                                        customFieldId:
                                          type: string
                                          minLength: 1
                                        equals:
                                          type: string
                                        mode:
                                          type: string
                                          enum:
                                            - SHOW_WHEN
                                            - HIDE_WHEN
                                      required:
                                        - customFieldId
                                        - equals
                                        - mode
                                      additionalProperties: false
                                    hidden:
                                      type: boolean
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - HTML
                                    content:
                                      type: string
                                    locked:
                                      type: boolean
                                    sectionStyle:
                                      type: object
                                      properties:
                                        background:
                                          type: string
                                          enum:
                                            - NONE
                                            - MUTED
                                            - TINT
                                            - ACCENT
                                            - DARK
                                        padding:
                                          type: string
                                          enum:
                                            - NONE
                                            - SM
                                            - MD
                                            - LG
                                        bleed:
                                          type: boolean
                                        border:
                                          type: boolean
                                      additionalProperties: false
                                    visibilityRule:
                                      type: object
                                      properties:
                                        customFieldId:
                                          type: string
                                          minLength: 1
                                        equals:
                                          type: string
                                        mode:
                                          type: string
                                          enum:
                                            - SHOW_WHEN
                                            - HIDE_WHEN
                                      required:
                                        - customFieldId
                                        - equals
                                        - mode
                                      additionalProperties: false
                                    hidden:
                                      type: boolean
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - PDF
                                    value:
                                      type: string
                                    numPages:
                                      type: number
                                    pageIndex:
                                      type: integer
                                      minimum: 0
                                      maximum: 9007199254740991
                                    instruction:
                                      type: string
                                    formFields:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          name:
                                            type: string
                                          type:
                                            type: string
                                            enum:
                                              - TEXT
                                              - CHECKBOX
                                              - DROPDOWN
                                              - RADIO
                                          page:
                                            type: integer
                                            minimum: 1
                                            maximum: 9007199254740991
                                            description: The page the box is on, counted from 1.
                                          rect:
                                            type: object
                                            properties:
                                              x:
                                                type: number
                                              'y':
                                                type: number
                                              width:
                                                type: number
                                                exclusiveMinimum: 0
                                              height:
                                                type: number
                                                exclusiveMinimum: 0
                                            required:
                                              - x
                                              - 'y'
                                              - width
                                              - height
                                            additionalProperties: false
                                            description: >-
                                              Position and size of the box. Responses
                                              give fractions of the page from 0 to 1,
                                              measured from its top-left corner.
                                          pageWidth:
                                            type: number
                                            exclusiveMinimum: 0
                                          pageHeight:
                                            type: number
                                            exclusiveMinimum: 0
                                          pageRotation:
                                            anyOf:
                                              - type: number
                                                enum:
                                                  - 0
                                              - type: number
                                                enum:
                                                  - 90
                                              - type: number
                                                enum:
                                                  - 180
                                              - type: number
                                                enum:
                                                  - 270
                                          options:
                                            type: array
                                            items:
                                              type: string
                                          required:
                                            type: boolean
                                          readOnly:
                                            type: boolean
                                          multiline:
                                            type: boolean
                                          exportValue:
                                            type: string
                                        required:
                                          - name
                                          - type
                                          - page
                                          - rect
                                          - pageWidth
                                          - pageHeight
                                        additionalProperties: {}
                                    formValues:
                                      type: object
                                      additionalProperties:
                                        anyOf:
                                          - type: string
                                          - type: boolean
                                    placedFields:
                                      type: array
                                      items:
                                        oneOf:
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                minLength: 1
                                              page:
                                                type: integer
                                                minimum: 1
                                                maximum: 9007199254740991
                                                description: The page the box is on, counted from 1.
                                              rect:
                                                type: object
                                                properties:
                                                  x:
                                                    type: number
                                                  'y':
                                                    type: number
                                                  width:
                                                    type: number
                                                    exclusiveMinimum: 0
                                                  height:
                                                    type: number
                                                    exclusiveMinimum: 0
                                                required:
                                                  - x
                                                  - 'y'
                                                  - width
                                                  - height
                                                additionalProperties: false
                                                description: >-
                                                  Position and size of the box. Responses
                                                  give fractions of the page from 0 to 1,
                                                  measured from its top-left corner.
                                              pageWidth:
                                                type: number
                                                exclusiveMinimum: 0
                                              pageHeight:
                                                type: number
                                                exclusiveMinimum: 0
                                              pageRotation:
                                                anyOf:
                                                  - type: number
                                                    enum:
                                                      - 0
                                                  - type: number
                                                    enum:
                                                      - 90
                                                  - type: number
                                                    enum:
                                                      - 180
                                                  - type: number
                                                    enum:
                                                      - 270
                                              name:
                                                type: string
                                              key:
                                                type: string
                                                pattern: ^[a-z0-9_-]*$
                                              locked:
                                                type: boolean
                                              style:
                                                type: object
                                                properties:
                                                  fontSize:
                                                    type: number
                                                    minimum: 6
                                                    maximum: 72
                                                  color:
                                                    type: string
                                                    pattern: ^#[0-9a-fA-F]{6}$
                                                  bold:
                                                    type: boolean
                                                  italic:
                                                    type: boolean
                                                  align:
                                                    type: string
                                                    enum:
                                                      - LEFT
                                                      - CENTER
                                                      - RIGHT
                                                additionalProperties: false
                                              kind:
                                                type: string
                                                enum:
                                                  - INPUT
                                              inputType:
                                                type: string
                                                enum:
                                                  - TEXT
                                                  - DATE
                                                  - CHECKBOX
                                                  - SELECT
                                                  - DRAW
                                                  - SIGNATURE
                                                  - INITIALS
                                              label:
                                                type: string
                                              fillSource:
                                                type: string
                                                enum:
                                                  - SIGNER
                                                  - FIXED
                                                  - NONE
                                                  - VARIABLE
                                              partyId:
                                                type: string
                                              variableId:
                                                type: string
                                              identity:
                                                type: string
                                                enum:
                                                  - name
                                                  - ssn
                                              drawn:
                                                type: boolean
                                              required:
                                                type: boolean
                                              options:
                                                type: array
                                                items:
                                                  type: string
                                              multiline:
                                                type: boolean
                                              format:
                                                type: string
                                                enum:
                                                  - email
                                                  - phone
                                                  - personnummer
                                                  - orgnr
                                                  - number
                                              min:
                                                type: number
                                              max:
                                                type: number
                                              decimals:
                                                type: integer
                                                minimum: 0
                                                maximum: 6
                                              step:
                                                type: number
                                                exclusiveMinimum: 0
                                            required:
                                              - id
                                              - page
                                              - rect
                                              - pageWidth
                                              - pageHeight
                                              - kind
                                              - inputType
                                            additionalProperties: {}
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                minLength: 1
                                              page:
                                                type: integer
                                                minimum: 1
                                                maximum: 9007199254740991
                                                description: The page the box is on, counted from 1.
                                              rect:
                                                type: object
                                                properties:
                                                  x:
                                                    type: number
                                                  'y':
                                                    type: number
                                                  width:
                                                    type: number
                                                    exclusiveMinimum: 0
                                                  height:
                                                    type: number
                                                    exclusiveMinimum: 0
                                                required:
                                                  - x
                                                  - 'y'
                                                  - width
                                                  - height
                                                additionalProperties: false
                                                description: >-
                                                  Position and size of the box. Responses
                                                  give fractions of the page from 0 to 1,
                                                  measured from its top-left corner.
                                              pageWidth:
                                                type: number
                                                exclusiveMinimum: 0
                                              pageHeight:
                                                type: number
                                                exclusiveMinimum: 0
                                              pageRotation:
                                                anyOf:
                                                  - type: number
                                                    enum:
                                                      - 0
                                                  - type: number
                                                    enum:
                                                      - 90
                                                  - type: number
                                                    enum:
                                                      - 180
                                                  - type: number
                                                    enum:
                                                      - 270
                                              name:
                                                type: string
                                              key:
                                                type: string
                                                pattern: ^[a-z0-9_-]*$
                                              locked:
                                                type: boolean
                                              style:
                                                type: object
                                                properties:
                                                  fontSize:
                                                    type: number
                                                    minimum: 6
                                                    maximum: 72
                                                  color:
                                                    type: string
                                                    pattern: ^#[0-9a-fA-F]{6}$
                                                  bold:
                                                    type: boolean
                                                  italic:
                                                    type: boolean
                                                  align:
                                                    type: string
                                                    enum:
                                                      - LEFT
                                                      - CENTER
                                                      - RIGHT
                                                additionalProperties: false
                                              kind:
                                                type: string
                                                enum:
                                                  - STATIC
                                              content:
                                                type: string
                                              text:
                                                type: string
                                            required:
                                              - id
                                              - page
                                              - rect
                                              - pageWidth
                                              - pageHeight
                                              - kind
                                            additionalProperties: {}
                                    locked:
                                      type: boolean
                                    visibilityRule:
                                      type: object
                                      properties:
                                        customFieldId:
                                          type: string
                                          minLength: 1
                                        equals:
                                          type: string
                                        mode:
                                          type: string
                                          enum:
                                            - SHOW_WHEN
                                            - HIDE_WHEN
                                      required:
                                        - customFieldId
                                        - equals
                                        - mode
                                      additionalProperties: false
                                    hidden:
                                      type: boolean
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - FORM
                                    columns:
                                      type: number
                                      minimum: 1
                                    fields:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            minLength: 1
                                          key:
                                            type: string
                                            pattern: ^[a-z0-9_-]*$
                                          type:
                                            type: string
                                            enum:
                                              - INPUT
                                              - TEXT
                                              - SELECT
                                              - DATEPICKER
                                              - RADIO
                                              - CHECKBOX
                                              - NUMBER
                                              - ATTACHMENT
                                          row:
                                            type: number
                                            minimum: 0
                                          column:
                                            type: number
                                            minimum: 0
                                          colSpan:
                                            type: integer
                                            exclusiveMinimum: 0
                                            maximum: 9007199254740991
                                          fieldMeta:
                                            oneOf:
                                              - type: object
                                                properties:
                                                  label:
                                                    type: string
                                                  placeholder:
                                                    type: string
                                                  description:
                                                    type: string
                                                  partyId:
                                                    type:
                                                      - string
                                                      - 'null'
                                                  required:
                                                    type: boolean
                                                  type:
                                                    type: string
                                                    enum:
                                                      - INPUT
                                                  value:
                                                    type: string
                                                  format:
                                                    type: string
                                                    enum:
                                                      - email
                                                      - phone
                                                      - personnummer
                                                      - orgnr
                                                  identity:
                                                    type: string
                                                    enum:
                                                      - name
                                                      - ssn
                                                  maxLength:
                                                    type: integer
                                                    exclusiveMinimum: 0
                                                    maximum: 10000
                                                required:
                                                  - type
                                                additionalProperties: false
                                              - type: object
                                                properties:
                                                  label:
                                                    type: string
                                                  placeholder:
                                                    type: string
                                                  description:
                                                    type: string
                                                  partyId:
                                                    type:
                                                      - string
                                                      - 'null'
                                                  required:
                                                    type: boolean
                                                  type:
                                                    type: string
                                                    enum:
                                                      - TEXT
                                                  value:
                                                    type: string
                                                  rows:
                                                    type: integer
                                                    minimum: 2
                                                    maximum: 20
                                                  maxLength:
                                                    type: integer
                                                    exclusiveMinimum: 0
                                                    maximum: 10000
                                                required:
                                                  - type
                                                additionalProperties: false
                                              - type: object
                                                properties:
                                                  label:
                                                    type: string
                                                  placeholder:
                                                    type: string
                                                  description:
                                                    type: string
                                                  partyId:
                                                    type:
                                                      - string
                                                      - 'null'
                                                  required:
                                                    type: boolean
                                                  type:
                                                    type: string
                                                    enum:
                                                      - SELECT
                                                  options:
                                                    type: array
                                                    items:
                                                      type: object
                                                      properties:
                                                        value:
                                                          type: string
                                                      required:
                                                        - value
                                                      additionalProperties: false
                                                  defaultValue:
                                                    type: string
                                                required:
                                                  - type
                                                additionalProperties: false
                                              - type: object
                                                properties:
                                                  label:
                                                    type: string
                                                  placeholder:
                                                    type: string
                                                  description:
                                                    type: string
                                                  partyId:
                                                    type:
                                                      - string
                                                      - 'null'
                                                  required:
                                                    type: boolean
                                                  type:
                                                    type: string
                                                    enum:
                                                      - DATEPICKER
                                                  value:
                                                    type: string
                                                required:
                                                  - type
                                                additionalProperties: false
                                              - type: object
                                                properties:
                                                  label:
                                                    type: string
                                                  placeholder:
                                                    type: string
                                                  description:
                                                    type: string
                                                  partyId:
                                                    type:
                                                      - string
                                                      - 'null'
                                                  required:
                                                    type: boolean
                                                  type:
                                                    type: string
                                                    enum:
                                                      - RADIO
                                                  options:
                                                    type: array
                                                    items:
                                                      type: object
                                                      properties:
                                                        value:
                                                          type: string
                                                      required:
                                                        - value
                                                      additionalProperties: false
                                                  value:
                                                    type: string
                                                required:
                                                  - type
                                                additionalProperties: false
                                              - type: object
                                                properties:
                                                  label:
                                                    type: string
                                                  placeholder:
                                                    type: string
                                                  description:
                                                    type: string
                                                  partyId:
                                                    type:
                                                      - string
                                                      - 'null'
                                                  required:
                                                    type: boolean
                                                  type:
                                                    type: string
                                                    enum:
                                                      - CHECKBOX
                                                  options:
                                                    type: array
                                                    items:
                                                      type: object
                                                      properties:
                                                        value:
                                                          type: string
                                                      required:
                                                        - value
                                                      additionalProperties: false
                                                  values:
                                                    type: array
                                                    items:
                                                      type: string
                                                required:
                                                  - type
                                                additionalProperties: false
                                              - type: object
                                                properties:
                                                  label:
                                                    type: string
                                                  placeholder:
                                                    type: string
                                                  description:
                                                    type: string
                                                  partyId:
                                                    type:
                                                      - string
                                                      - 'null'
                                                  required:
                                                    type: boolean
                                                  type:
                                                    type: string
                                                    enum:
                                                      - NUMBER
                                                  value:
                                                    type: string
                                                  min:
                                                    type: number
                                                  max:
                                                    type: number
                                                  decimals:
                                                    type: integer
                                                    minimum: 0
                                                    maximum: 6
                                                  step:
                                                    type: number
                                                    exclusiveMinimum: 0
                                                  unit:
                                                    type: string
                                                    maxLength: 12
                                                required:
                                                  - type
                                                additionalProperties: false
                                              - type: object
                                                properties:
                                                  label:
                                                    type: string
                                                  placeholder:
                                                    type: string
                                                  description:
                                                    type: string
                                                  partyId:
                                                    type:
                                                      - string
                                                      - 'null'
                                                  required:
                                                    type: boolean
                                                  type:
                                                    type: string
                                                    enum:
                                                      - ATTACHMENT
                                                  appendixLabel:
                                                    type: string
                                                  allowedTypes:
                                                    type: array
                                                    items:
                                                      type: string
                                                      enum:
                                                        - PDF
                                                        - IMAGE
                                                  includeInDocument:
                                                    type: boolean
                                                  value:
                                                    type: object
                                                    properties:
                                                      filename:
                                                        type: string
                                                      mimeType:
                                                        type: string
                                                      size:
                                                        type: number
                                                        description: Size in bytes
                                                    required:
                                                      - filename
                                                      - mimeType
                                                      - size
                                                    additionalProperties: {}
                                                    description: >-
                                                      The file the party uploaded. Set by sajn
                                                      when the upload is confirmed; a request
                                                      can't set it.
                                                required:
                                                  - type
                                                additionalProperties: false
                                        required:
                                          - id
                                          - row
                                          - column
                                        additionalProperties: false
                                    locked:
                                      type: boolean
                                    sectionStyle:
                                      type: object
                                      properties:
                                        background:
                                          type: string
                                          enum:
                                            - NONE
                                            - MUTED
                                            - TINT
                                            - ACCENT
                                            - DARK
                                        padding:
                                          type: string
                                          enum:
                                            - NONE
                                            - SM
                                            - MD
                                            - LG
                                        bleed:
                                          type: boolean
                                        border:
                                          type: boolean
                                      additionalProperties: false
                                    visibilityRule:
                                      type: object
                                      properties:
                                        customFieldId:
                                          type: string
                                          minLength: 1
                                        equals:
                                          type: string
                                        mode:
                                          type: string
                                          enum:
                                            - SHOW_WHEN
                                            - HIDE_WHEN
                                      required:
                                        - customFieldId
                                        - equals
                                        - mode
                                      additionalProperties: false
                                    hidden:
                                      type: boolean
                                  required:
                                    - type
                                    - columns
                                    - fields
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - PRODUCT_TABLE
                                    name:
                                      type: string
                                    enableName:
                                      type: boolean
                                    columns:
                                      type: object
                                      additionalProperties:
                                        type: object
                                        properties:
                                          name:
                                            type: string
                                          originalName:
                                            type: string
                                          enabled:
                                            type: boolean
                                          key:
                                            type: string
                                          settings:
                                            type: object
                                            properties:
                                              decimalPlaces:
                                                type: number
                                              oneTimePayment:
                                                type: boolean
                                              pricePrefix:
                                                type: string
                                              priceSuffix:
                                                type: string
                                              pricesIncludeVat:
                                                description: >-
                                                  If `true`, the entered prices include
                                                  VAT. If `false`, they exclude it.
                                                  Default: `false`.
                                                type: boolean
                                              defaultVatRate:
                                                description: >-
                                                  VAT rate in percent, such as `25`, for a
                                                  product without its own `vat`. Default:
                                                  `25`.
                                                type: number
                                              showVatBreakdown:
                                                description: >-
                                                  If `true`, the totals show the VAT
                                                  amount. Default: `true`.
                                                type: boolean
                                            additionalProperties: false
                                        required:
                                          - name
                                          - originalName
                                          - enabled
                                          - key
                                          - settings
                                        additionalProperties: false
                                    summaryLabels:
                                      type: object
                                      properties:
                                        subtotal:
                                          type: string
                                        vat:
                                          type: string
                                        total:
                                          type: string
                                        payable:
                                          type: string
                                      required:
                                        - subtotal
                                        - vat
                                        - total
                                      additionalProperties: false
                                    allowSelection:
                                      type: boolean
                                    selectionPartyId:
                                      type: string
                                    selectionRequired:
                                      type: boolean
                                    selectedProductIds:
                                      type: array
                                      items:
                                        type: string
                                    recipientChoice:
                                      type: object
                                      properties:
                                        selectedIds:
                                          type: array
                                          items:
                                            type: string
                                        quantities:
                                          type: object
                                          additionalProperties:
                                            type: number
                                      required:
                                        - selectedIds
                                        - quantities
                                      additionalProperties: false
                                    payment:
                                      description: >-
                                        Collects a payment from one party in the
                                        signing flow. The payment is authorized
                                        before the party signs and captured when
                                        the document completes, on the
                                        organization's connected payment
                                        account.
                                      type: object
                                      properties:
                                        enabled:
                                          type: boolean
                                        payerPartyId:
                                          description: >-
                                            The party who pays. Without it,
                                            `selectionPartyId` pays.
                                          type: string
                                        basis:
                                          description: >-
                                            `ONE_TIME` charges the one-time rows.
                                            `FIRST_PERIOD` adds one period of every
                                            recurring row. Default: `ONE_TIME`.
                                          type: string
                                          enum:
                                            - ONE_TIME
                                            - FIRST_PERIOD
                                        percent:
                                          description: >-
                                            The share of the basis to charge, from 1
                                            to 100, such as `30` for a deposit.
                                            Default: `100`.
                                          type: integer
                                          minimum: 1
                                          maximum: 100
                                      required:
                                        - enabled
                                      additionalProperties: false
                                    sections:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                          name:
                                            type: string
                                          pickOne:
                                            type: boolean
                                          showSubtotal:
                                            type: boolean
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                    discount:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - PERCENT
                                            - AMOUNT
                                        value:
                                          type: number
                                        label:
                                          type: string
                                      required:
                                        - type
                                        - value
                                      additionalProperties: false
                                    pricing:
                                      type: object
                                      properties:
                                        pricesIncludeVat:
                                          description: >-
                                            If `true`, the entered prices include
                                            VAT. If `false`, they exclude it.
                                            Default: `false`.
                                          type: boolean
                                        defaultVatRate:
                                          description: >-
                                            VAT rate in percent, such as `25`, for a
                                            product without its own `vat`. Default:
                                            `25`.
                                          type: number
                                        showVatBreakdown:
                                          description: >-
                                            If `true`, the totals show the VAT
                                            amount. Default: `true`.
                                          type: boolean
                                      additionalProperties: false
                                    style:
                                      type: object
                                      properties:
                                        border:
                                          type: boolean
                                        rounded:
                                          type: boolean
                                      additionalProperties: false
                                    currency:
                                      description: >-
                                        ISO 4217 currency code, such as `SEK`.
                                        Every price in the table is a decimal
                                        amount in this currency.
                                      type: string
                                      pattern: ^[A-Z]{3}$
                                    language:
                                      type: string
                                      enum:
                                        - sv
                                        - en
                                        - 'no'
                                        - da
                                        - fi
                                        - de
                                        - is
                                        - es
                                        - fr
                                        - it
                                    products:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                          name:
                                            type: string
                                          description:
                                            type: string
                                          price:
                                            description: >-
                                              Unit price as a decimal amount in the
                                              table's `currency`, such as `1499.5`,
                                              not in minor units. It excludes VAT
                                              unless `pricing.pricesIncludeVat` is
                                              `true`.
                                            type: number
                                          unit:
                                            type: string
                                          quantity:
                                            type: number
                                          vat:
                                            description: >-
                                              VAT rate in percent, such as `25`.
                                              Without it, `pricing.defaultVatRate`
                                              applies.
                                            type: number
                                          optional:
                                            type: boolean
                                          defaultSelected:
                                            type: boolean
                                          quantityEditable:
                                            type: boolean
                                          quantityMin:
                                            type: number
                                          quantityMax:
                                            type: number
                                          discount:
                                            type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - PERCENT
                                                  - AMOUNT
                                              value:
                                                type: number
                                            required:
                                              - type
                                              - value
                                            additionalProperties: false
                                          billing:
                                            type: string
                                            enum:
                                              - ONE_TIME
                                              - MONTHLY
                                              - QUARTERLY
                                              - YEARLY
                                          sectionId:
                                            type: string
                                          sku:
                                            type: string
                                          productId:
                                            type: string
                                          productType:
                                            type: string
                                            enum:
                                              - GOODS
                                              - SERVICE
                                              - ROT
                                              - RUT
                                        required:
                                          - id
                                          - name
                                        additionalProperties: false
                                    locked:
                                      type: boolean
                                    sectionStyle:
                                      type: object
                                      properties:
                                        background:
                                          type: string
                                          enum:
                                            - NONE
                                            - MUTED
                                            - TINT
                                            - ACCENT
                                            - DARK
                                        padding:
                                          type: string
                                          enum:
                                            - NONE
                                            - SM
                                            - MD
                                            - LG
                                        bleed:
                                          type: boolean
                                        border:
                                          type: boolean
                                      additionalProperties: false
                                    visibilityRule:
                                      type: object
                                      properties:
                                        customFieldId:
                                          type: string
                                          minLength: 1
                                        equals:
                                          type: string
                                        mode:
                                          type: string
                                          enum:
                                            - SHOW_WHEN
                                            - HIDE_WHEN
                                      required:
                                        - customFieldId
                                        - equals
                                        - mode
                                      additionalProperties: false
                                    hidden:
                                      type: boolean
                                  required:
                                    - type
                                    - name
                                    - columns
                                    - products
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - TABLE
                                    columns:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                          name:
                                            type: string
                                          type:
                                            type: string
                                            enum:
                                              - TEXT
                                              - NUMBER
                                        required:
                                          - id
                                          - name
                                          - type
                                        additionalProperties: false
                                    rows:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                          cells:
                                            type: array
                                            items:
                                              type: object
                                              properties:
                                                columnId:
                                                  type: string
                                                value:
                                                  anyOf:
                                                    - type: string
                                                    - type: number
                                              required:
                                                - columnId
                                                - value
                                              additionalProperties: false
                                        required:
                                          - id
                                          - cells
                                        additionalProperties: false
                                    showHeaders:
                                      type: boolean
                                    style:
                                      type: object
                                      properties:
                                        border:
                                          type: boolean
                                        rounded:
                                          type: boolean
                                      additionalProperties: false
                                    locked:
                                      type: boolean
                                    sectionStyle:
                                      type: object
                                      properties:
                                        background:
                                          type: string
                                          enum:
                                            - NONE
                                            - MUTED
                                            - TINT
                                            - ACCENT
                                            - DARK
                                        padding:
                                          type: string
                                          enum:
                                            - NONE
                                            - SM
                                            - MD
                                            - LG
                                        bleed:
                                          type: boolean
                                        border:
                                          type: boolean
                                      additionalProperties: false
                                    visibilityRule:
                                      type: object
                                      properties:
                                        customFieldId:
                                          type: string
                                          minLength: 1
                                        equals:
                                          type: string
                                        mode:
                                          type: string
                                          enum:
                                            - SHOW_WHEN
                                            - HIDE_WHEN
                                      required:
                                        - customFieldId
                                        - equals
                                        - mode
                                      additionalProperties: false
                                    hidden:
                                      type: boolean
                                  required:
                                    - type
                                    - columns
                                    - rows
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - SPACER
                                    size:
                                      type: string
                                      enum:
                                        - S
                                        - M
                                        - L
                                        - XL
                                    locked:
                                      type: boolean
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - PAGE_BREAK
                                    locked:
                                      type: boolean
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - DURATION
                                    durationType:
                                      type: string
                                      enum:
                                        - NONE
                                        - SINGLE_PERIOD
                                        - RECURRING
                                        - RECURRING_WITH_INITIAL
                                        - NOT_SET
                                    period:
                                      type: object
                                      properties:
                                        value:
                                          type: integer
                                          exclusiveMinimum: 0
                                          maximum: 9007199254740991
                                        unit:
                                          type: string
                                          enum:
                                            - DAY
                                            - WEEK
                                            - MONTH
                                            - YEAR
                                      required:
                                        - value
                                        - unit
                                      additionalProperties: false
                                    noticePeriod:
                                      type: object
                                      properties:
                                        value:
                                          type: integer
                                          exclusiveMinimum: 0
                                          maximum: 9007199254740991
                                        unit:
                                          type: string
                                          enum:
                                            - DAY
                                            - WEEK
                                            - MONTH
                                            - YEAR
                                      required:
                                        - value
                                        - unit
                                      additionalProperties: false
                                    startDate:
                                      type: string
                                    endDate:
                                      type: string
                                    locked:
                                      type: boolean
                                    sectionStyle:
                                      type: object
                                      properties:
                                        background:
                                          type: string
                                          enum:
                                            - NONE
                                            - MUTED
                                            - TINT
                                            - ACCENT
                                            - DARK
                                        padding:
                                          type: string
                                          enum:
                                            - NONE
                                            - SM
                                            - MD
                                            - LG
                                        bleed:
                                          type: boolean
                                        border:
                                          type: boolean
                                      additionalProperties: false
                                  required:
                                    - type
                                  additionalProperties: false
                            - type: 'null'
                          description: >-
                            Type-specific content. For PDF fields this includes
                            `placedFields` (boxes placed on the PDF pages) and
                            `formFields` (form fields extracted from the PDF).
                        createdAt:
                          description: Date and time when the field was created
                          type:
                            - string
                            - 'null'
                          format: date-time
                        updatedAt:
                          description: Date and time when the field was last updated
                          type:
                            - string
                            - 'null'
                          format: date-time
                      required:
                        - id
                        - documentId
                        - templateId
                        - type
                        - position
                        - fieldMeta
                        - createdAt
                        - updatedAt
                      additionalProperties: false
                      example:
                        id: cm4k2x9p10009abcd1234efgh
                        documentId: cm4k2x9p10003abcd1234efgh
                        templateId: null
                        type: TEXT
                        position: 0
                        fieldMeta:
                          type: TEXT
                          content: >-
                            <p>Anställningen gäller tills vidare från och med
                            den 1 november 2026, med sex månaders
                            provanställning.</p>
                        createdAt: '2026-09-28T09:12:00.000Z'
                        updatedAt: '2026-09-28T09:12:00.000Z'
                  productTables:
                    type: array
                    items:
                      type: object
                      properties:
                        fieldId:
                          type: string
                          description: The content block ID.
                        name:
                          type: string
                        currency:
                          description: ISO 4217; null on tables authored before currencies
                          type:
                            - string
                            - 'null'
                        language:
                          type: string
                          enum:
                            - sv
                            - en
                            - 'no'
                            - da
                            - fi
                            - de
                            - is
                            - es
                            - fr
                            - it
                        allowSelection:
                          type: boolean
                        selectionPartyId:
                          description: The party who makes the selection
                          type:
                            - string
                            - 'null'
                        selectionRequired:
                          type: boolean
                        sections:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                                description: The section ID.
                              name:
                                type: string
                              pickOne:
                                type: boolean
                            required:
                              - id
                              - name
                              - pickOne
                            additionalProperties: false
                        rows:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                                description: The product ID.
                              sku:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type: string
                              description:
                                type:
                                  - string
                                  - 'null'
                              unit:
                                type:
                                  - string
                                  - 'null'
                              price:
                                type: number
                                description: >-
                                  Unit price as a decimal amount in the table's
                                  currency, such as `1499.5`, not in minor
                                  units. It excludes VAT unless the table's
                                  prices include VAT.
                              vat:
                                type: number
                                description: >-
                                  VAT rate in percent, such as `25`. Falls back
                                  to the table's default rate.
                              billing:
                                type: string
                                enum:
                                  - ONE_TIME
                                  - MONTHLY
                                  - QUARTERLY
                                  - YEARLY
                              discount:
                                description: Row discount, off the row amount
                                type:
                                  - object
                                  - 'null'
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - PERCENT
                                      - AMOUNT
                                  value:
                                    type: number
                                required:
                                  - type
                                  - value
                                additionalProperties: false
                              optional:
                                type: boolean
                                description: >-
                                  The recipient may choose whether to include
                                  this row
                              selected:
                                type: boolean
                                description: >-
                                  Whether the row counts towards the totals.
                                  Declined rows are still listed, with false.
                              quantity:
                                type: number
                                description: Final quantity, including a recipient-set one
                              lineTotal:
                                type: number
                                description: >-
                                  price × quantity − discount, in the basis the
                                  price was entered in
                              lineNet:
                                type: number
                                description: Line amount excluding VAT
                              lineVat:
                                type: number
                                description: VAT on the line
                              sectionId:
                                description: The section ID.
                                type:
                                  - string
                                  - 'null'
                              productType:
                                type:
                                  - string
                                  - 'null'
                                enum:
                                  - GOODS
                                  - SERVICE
                                  - ROT
                                  - RUT
                                  - null
                            required:
                              - id
                              - sku
                              - name
                              - description
                              - unit
                              - price
                              - vat
                              - billing
                              - discount
                              - optional
                              - selected
                              - quantity
                              - lineTotal
                              - lineNet
                              - lineVat
                              - sectionId
                              - productType
                            additionalProperties: false
                          description: Every row, selected or not, in table order
                        totals:
                          type: object
                          properties:
                            subtotal:
                              type: number
                              description: Net, before the table discount
                            discountAmount:
                              type: number
                            vatAmount:
                              type: number
                            total:
                              type: number
                            rotDeduction:
                              type: number
                            rutDeduction:
                              type: number
                            payable:
                              type: number
                              description: total − ROT/RUT deductions
                            byBilling:
                              type: object
                              additionalProperties:
                                type: object
                                properties:
                                  subtotal:
                                    type: number
                                  vatAmount:
                                    type: number
                                  total:
                                    type: number
                                required:
                                  - subtotal
                                  - vatAmount
                                  - total
                                additionalProperties: false
                          required:
                            - subtotal
                            - discountAmount
                            - vatAmount
                            - total
                            - rotDeduction
                            - rutDeduction
                            - payable
                            - byBilling
                          additionalProperties: false
                          description: >-
                            Computed from the selected rows only. Every amount
                            in a summary is a decimal amount in the table's
                            currency, rounded to two decimals, not in minor
                            units.
                      required:
                        - fieldId
                        - name
                        - currency
                        - language
                        - allowSelection
                        - selectionPartyId
                        - selectionRequired
                        - sections
                        - rows
                        - totals
                      additionalProperties: false
                    description: >-
                      Every product table on the document, resolved: each row
                      carries the recipient's final `selected` state and
                      `quantity`, and the totals count the selected rows only.
                      Empty when the document has no product table.
                  approvalRequestId:
                    description: >-
                      ID of the document's approval request, or null when it has
                      none. To read it, call `GET
                      /api/v1/approval-requests/{id}`.
                    type:
                      - string
                      - 'null'
                  bundleId:
                    description: >-
                      ID of the bundle the document was sent in, or null. Every
                      document in a bundle also fires its own events, so this is
                      the key that groups them. To read the bundle, call `GET
                      /api/v1/bundles/{id}`.
                    type:
                      - string
                      - 'null'
                required:
                  - id
                  - externalId
                  - expiresAt
                  - name
                  - status
                  - documentMeta
                  - createdAt
                  - updatedAt
                  - completedAt
                  - deletedAt
                  - templateId
                  - folderId
                  - responsibleUserId
                  - parties
                  - tags
                  - customFields
                  - content
                  - productTables
                  - approvalRequestId
                  - bundleId
                additionalProperties: false
              example:
                id: cm4k2x9p10003abcd1234efgh
                externalId: HR-2026-0142
                expiresAt: '2026-10-28T22:00:00.000Z'
                name: Anställningsavtal – Kai Lindqvist
                status: COMPLETED
                documentMeta:
                  subject: Ditt anställningsavtal från Exempelbolaget AB
                  message: >-
                    Hej Kai! Här är ditt anställningsavtal. Signera det med
                    BankID senast den 28 oktober.
                  signingMode: PARALLEL
                  forceReadFullDocument: false
                  showChatToSigners: false
                  language: sv
                  value: '540000'
                  redirectUrl: null
                  redirectEnabled: true
                  internalRecipients:
                    - hr@example.com
                  signableAfterExpired: false
                  sendPlainTextEmailOnly: false
                  reminderIntervalDays: 3
                  allowDelegation: false
                  openVerification: PIN
                  aiChatEnabled: false
                  nationalIdDisplayMode: FULL
                  sameDeviceSigning: false
                  documentCategoryId: cm4k2x9p10017abcd1234efgh
                createdAt: '2026-09-28T09:12:00.000Z'
                updatedAt: '2026-09-28T09:15:00.000Z'
                completedAt: '2026-09-29T07:41:00.000Z'
                deletedAt: null
                templateId: cm4k2x9p10008abcd1234efgh
                folderId: cm4k2x9p10011abcd1234efgh
                responsibleUserId: cm4k2x9p10002abcd1234efgh
                parties:
                  - id: cm4k2x9p10004abcd1234efgh
                    documentId: cm4k2x9p10003abcd1234efgh
                    email: kai@example.com
                    name: Kai Lindqvist
                    phone: '+46701740605'
                    type: INDIVIDUAL
                    company: null
                    externalId: HR-2026-0142
                    contactId: cm4k2x9p10006abcd1234efgh
                    nationalId: '191212121212'
                    country: SE
                    role: SIGNER
                    signingOrder: 1
                    signedAt: '2026-09-29T07:41:00.000Z'
                    readStatus: READ
                    signingStatus: SIGNED
                    delivery:
                      - EMAIL
                    signatureMethod: SE_BANKID
                    signVerification: PIN
                    openVerification: PIN
                    sendStatus: DELIVERED
                    identityVerified: true
                    identityMismatch: false
                    createdAt: '2026-09-28T09:12:00.000Z'
                tags:
                  - id: cm4k2x9p10010abcd1234efgh
                    name: Anställning
                    color: '#16A34A'
                customFields:
                  - id: cm4k2x9p10016abcd1234efgh
                    name: Startdatum
                    type: TEXT
                    value: '2026-11-01'
                content:
                  - id: cm4k2x9p10009abcd1234efgh
                    documentId: cm4k2x9p10003abcd1234efgh
                    templateId: null
                    type: TEXT
                    position: 0
                    fieldMeta:
                      type: TEXT
                      content: >-
                        <p>Anställningen gäller tills vidare från och med den 1
                        november 2026, med sex månaders provanställning.</p>
                    createdAt: '2026-09-28T09:12:00.000Z'
                    updatedAt: '2026-09-28T09:12:00.000Z'
                productTables:
                  - fieldId: cm4k2x9p10009abcd1234efgh
                    name: Anställningsavtal – Kai Lindqvist
                    currency: SEK
                    language: sv
                    allowSelection: false
                    selectionPartyId: cm4k2x9p10004abcd1234efgh
                    selectionRequired: false
                    sections:
                      - id: cm4k2x9p10037abcd1234efgh
                        name: Utbildningar
                        pickOne: false
                    rows:
                      - id: cm4k2x9p10036abcd1234efgh
                        sku: UTB-INTRO
                        name: Introduktionsutbildning
                        description: Introduktionsutbildning.
                        unit: st
                        price: 4500
                        vat: 25
                        billing: ONE_TIME
                        discount:
                          type: PERCENT
                          value: 1
                        optional: false
                        selected: false
                        quantity: 1
                        lineTotal: 1
                        lineNet: 1
                        lineVat: 1
                        sectionId: cm4k2x9p10037abcd1234efgh
                        productType: GOODS
                    totals:
                      subtotal: 4500
                      discountAmount: 1
                      vatAmount: 1125
                      total: 1
                      rotDeduction: 1
                      rutDeduction: 1
                      payable: 5625
                      byBilling:
                        ONE_TIME:
                          subtotal: 4500
                          vatAmount: 1125
                          total: 1
                        MONTHLY:
                          subtotal: 4500
                          vatAmount: 1125
                          total: 1
                        QUARTERLY:
                          subtotal: 4500
                          vatAmount: 1125
                          total: 1
                        YEARLY:
                          subtotal: 4500
                          vatAmount: 1125
                          total: 1
                approvalRequestId: cm4k2x9p10003abcd1234efgh
                bundleId: cm4k2x9p10044abcd1234efgh
          headers:
            Sajn-Version:
              description: API version that served the request.
              schema:
                type: string
            Deprecation:
              description: >-
                Present only when the version is deprecated: when it was
                deprecated, as `@<unix seconds>`.
              schema:
                type: string
            Sunset:
              description: >-
                Present only when the version is deprecated: the HTTP date from
                which requests on this version return 400 `API_VERSION_SUNSET`.
              schema:
                type: string
            Sajn-Request-Id:
              description: >-
                Identifier of the request. Error bodies repeat it as
                `requestId`; quote it when you contact support.
              schema:
                type: string
            X-RateLimit-Limit:
              description: Requests allowed per minute.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left in the current minute.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: When the minute window resets, in Unix seconds.
              schema:
                type: integer
            Idempotent-Replayed:
              description: >-
                `true` when the response is a stored response replayed for a
                repeated `Idempotency-Key`.
              schema:
                type: string
        '400':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - VALIDATION_FAILED
                      - INVALID_JSON
                      - EXPIRED
                      - IDEMPOTENCY_KEY_REUSED
                      - WORKSPACE_REQUIRED
                      - INVALID_API_VERSION
                      - API_VERSION_SUNSET
                      - UNAUTHORIZED
                      - API_KEY_EXPIRED
                      - PERMISSION_DENIED
                      - WORKSPACE_ACCESS_DENIED
                      - INSUFFICIENT_SCOPE
                      - PLAN_REQUIRED
                      - ACCOUNT_INACTIVE
                      - ACCOUNT_SETUP_REQUIRED
                      - LIMIT_EXCEEDED
                      - DOCUMENT_NOT_READY
                      - APPROVAL_REQUIRED
                      - NOT_FOUND
                      - ROUTE_NOT_FOUND
                      - INVALID_STATE
                      - ALREADY_EXISTS
                      - IDEMPOTENCY_KEY_IN_USE
                      - RATE_LIMITED
                      - INTERNAL_ERROR
                      - UPSTREAM_UNAVAILABLE
                    description: >-
                      Machine-readable error code from a closed list. Branch on
                      it, never on `message`.
                  message:
                    type: string
                    description: >-
                      What went wrong, in English, for developers. Its wording
                      can change; don't parse it.
                  userMessage:
                    type: string
                    description: >-
                      Text that is safe to show to an end user, usually in
                      Swedish
                  requestId:
                    type: string
                    description: >-
                      Identifier of the request, the same value as the
                      `Sajn-Request-Id` header. Quote it when you contact
                      support.
                  resource:
                    description: >-
                      On a 404 `NOT_FOUND`, the type of the missing resource,
                      such as `document` or `party`; `null` when the API can't
                      tell
                    type:
                      - string
                      - 'null'
                  issues:
                    description: Every validation issue, on a 400 `VALIDATION_FAILED`
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: >-
                            Dotted path to the invalid value, such as
                            `parties.0.email`; empty when no single input caused
                            the issue
                        code:
                          type: string
                          enum:
                            - INVALID_TYPE
                            - INVALID_FORMAT
                            - INVALID_VALUE
                            - TOO_SMALL
                            - TOO_BIG
                            - UNRECOGNIZED_KEY
                        message:
                          type: string
                          description: What is wrong with the value, in English
                      required:
                        - path
                        - code
                        - message
                      additionalProperties: false
                  requiredScopes:
                    description: >-
                      OAuth scopes the endpoint requires, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  grantedScopes:
                    description: >-
                      OAuth scopes the token was granted, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  readiness:
                    description: >-
                      What blocks sending the document, on a 409
                      `DOCUMENT_NOT_READY`
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: >-
                            What is wrong, such as `MISSING_EMAIL` or
                            `NO_EXPIRATION`. New codes can be added.
                        severity:
                          type: string
                          enum:
                            - BLOCKER
                            - WARNING
                          description: '`BLOCKER` stops the send; `WARNING` doesn''t.'
                        message:
                          type: string
                          description: What is wrong, in English
                        userMessage:
                          type: string
                          description: >-
                            The same, naming the party or field, in Swedish, for
                            showing to a user
                      required:
                        - code
                        - severity
                        - message
                        - userMessage
                      additionalProperties: false
                required:
                  - code
                  - message
                  - userMessage
                  - requestId
                additionalProperties: {}
                description: Error response
              example:
                code: VALIDATION_FAILED
                message: 'Invalid input: expected string, received number'
                userMessage: Förfrågan innehåller ogiltiga värden.
                requestId: req_V1StGXR8Z5jdHi6BmyT2
                issues:
                  - path: reason
                    code: INVALID_TYPE
                    message: 'Invalid input: expected string, received number'
          headers:
            Sajn-Version:
              description: API version that served the request.
              schema:
                type: string
            Deprecation:
              description: >-
                Present only when the version is deprecated: when it was
                deprecated, as `@<unix seconds>`.
              schema:
                type: string
            Sunset:
              description: >-
                Present only when the version is deprecated: the HTTP date from
                which requests on this version return 400 `API_VERSION_SUNSET`.
              schema:
                type: string
            Sajn-Request-Id:
              description: >-
                Identifier of the request. Error bodies repeat it as
                `requestId`; quote it when you contact support.
              schema:
                type: string
            X-RateLimit-Limit:
              description: Requests allowed per minute.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left in the current minute.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: When the minute window resets, in Unix seconds.
              schema:
                type: integer
            Idempotent-Replayed:
              description: >-
                `true` when the response is a stored response replayed for a
                repeated `Idempotency-Key`.
              schema:
                type: string
        '401':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - VALIDATION_FAILED
                      - INVALID_JSON
                      - EXPIRED
                      - IDEMPOTENCY_KEY_REUSED
                      - WORKSPACE_REQUIRED
                      - INVALID_API_VERSION
                      - API_VERSION_SUNSET
                      - UNAUTHORIZED
                      - API_KEY_EXPIRED
                      - PERMISSION_DENIED
                      - WORKSPACE_ACCESS_DENIED
                      - INSUFFICIENT_SCOPE
                      - PLAN_REQUIRED
                      - ACCOUNT_INACTIVE
                      - ACCOUNT_SETUP_REQUIRED
                      - LIMIT_EXCEEDED
                      - DOCUMENT_NOT_READY
                      - APPROVAL_REQUIRED
                      - NOT_FOUND
                      - ROUTE_NOT_FOUND
                      - INVALID_STATE
                      - ALREADY_EXISTS
                      - IDEMPOTENCY_KEY_IN_USE
                      - RATE_LIMITED
                      - INTERNAL_ERROR
                      - UPSTREAM_UNAVAILABLE
                    description: >-
                      Machine-readable error code from a closed list. Branch on
                      it, never on `message`.
                  message:
                    type: string
                    description: >-
                      What went wrong, in English, for developers. Its wording
                      can change; don't parse it.
                  userMessage:
                    type: string
                    description: >-
                      Text that is safe to show to an end user, usually in
                      Swedish
                  requestId:
                    type: string
                    description: >-
                      Identifier of the request, the same value as the
                      `Sajn-Request-Id` header. Quote it when you contact
                      support.
                  resource:
                    description: >-
                      On a 404 `NOT_FOUND`, the type of the missing resource,
                      such as `document` or `party`; `null` when the API can't
                      tell
                    type:
                      - string
                      - 'null'
                  issues:
                    description: Every validation issue, on a 400 `VALIDATION_FAILED`
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: >-
                            Dotted path to the invalid value, such as
                            `parties.0.email`; empty when no single input caused
                            the issue
                        code:
                          type: string
                          enum:
                            - INVALID_TYPE
                            - INVALID_FORMAT
                            - INVALID_VALUE
                            - TOO_SMALL
                            - TOO_BIG
                            - UNRECOGNIZED_KEY
                        message:
                          type: string
                          description: What is wrong with the value, in English
                      required:
                        - path
                        - code
                        - message
                      additionalProperties: false
                  requiredScopes:
                    description: >-
                      OAuth scopes the endpoint requires, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  grantedScopes:
                    description: >-
                      OAuth scopes the token was granted, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  readiness:
                    description: >-
                      What blocks sending the document, on a 409
                      `DOCUMENT_NOT_READY`
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: >-
                            What is wrong, such as `MISSING_EMAIL` or
                            `NO_EXPIRATION`. New codes can be added.
                        severity:
                          type: string
                          enum:
                            - BLOCKER
                            - WARNING
                          description: '`BLOCKER` stops the send; `WARNING` doesn''t.'
                        message:
                          type: string
                          description: What is wrong, in English
                        userMessage:
                          type: string
                          description: >-
                            The same, naming the party or field, in Swedish, for
                            showing to a user
                      required:
                        - code
                        - severity
                        - message
                        - userMessage
                      additionalProperties: false
                required:
                  - code
                  - message
                  - userMessage
                  - requestId
                additionalProperties: {}
                description: Error response
              example:
                code: UNAUTHORIZED
                message: Invalid API token
                userMessage: Ogiltig API-nyckel
                requestId: req_V1StGXR8Z5jdHi6BmyT2
          headers:
            Sajn-Version:
              description: API version that served the request.
              schema:
                type: string
            Deprecation:
              description: >-
                Present only when the version is deprecated: when it was
                deprecated, as `@<unix seconds>`.
              schema:
                type: string
            Sunset:
              description: >-
                Present only when the version is deprecated: the HTTP date from
                which requests on this version return 400 `API_VERSION_SUNSET`.
              schema:
                type: string
            Sajn-Request-Id:
              description: >-
                Identifier of the request. Error bodies repeat it as
                `requestId`; quote it when you contact support.
              schema:
                type: string
            X-RateLimit-Limit:
              description: Requests allowed per minute.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left in the current minute.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: When the minute window resets, in Unix seconds.
              schema:
                type: integer
            Idempotent-Replayed:
              description: >-
                `true` when the response is a stored response replayed for a
                repeated `Idempotency-Key`.
              schema:
                type: string
        '403':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - VALIDATION_FAILED
                      - INVALID_JSON
                      - EXPIRED
                      - IDEMPOTENCY_KEY_REUSED
                      - WORKSPACE_REQUIRED
                      - INVALID_API_VERSION
                      - API_VERSION_SUNSET
                      - UNAUTHORIZED
                      - API_KEY_EXPIRED
                      - PERMISSION_DENIED
                      - WORKSPACE_ACCESS_DENIED
                      - INSUFFICIENT_SCOPE
                      - PLAN_REQUIRED
                      - ACCOUNT_INACTIVE
                      - ACCOUNT_SETUP_REQUIRED
                      - LIMIT_EXCEEDED
                      - DOCUMENT_NOT_READY
                      - APPROVAL_REQUIRED
                      - NOT_FOUND
                      - ROUTE_NOT_FOUND
                      - INVALID_STATE
                      - ALREADY_EXISTS
                      - IDEMPOTENCY_KEY_IN_USE
                      - RATE_LIMITED
                      - INTERNAL_ERROR
                      - UPSTREAM_UNAVAILABLE
                    description: >-
                      Machine-readable error code from a closed list. Branch on
                      it, never on `message`.
                  message:
                    type: string
                    description: >-
                      What went wrong, in English, for developers. Its wording
                      can change; don't parse it.
                  userMessage:
                    type: string
                    description: >-
                      Text that is safe to show to an end user, usually in
                      Swedish
                  requestId:
                    type: string
                    description: >-
                      Identifier of the request, the same value as the
                      `Sajn-Request-Id` header. Quote it when you contact
                      support.
                  resource:
                    description: >-
                      On a 404 `NOT_FOUND`, the type of the missing resource,
                      such as `document` or `party`; `null` when the API can't
                      tell
                    type:
                      - string
                      - 'null'
                  issues:
                    description: Every validation issue, on a 400 `VALIDATION_FAILED`
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: >-
                            Dotted path to the invalid value, such as
                            `parties.0.email`; empty when no single input caused
                            the issue
                        code:
                          type: string
                          enum:
                            - INVALID_TYPE
                            - INVALID_FORMAT
                            - INVALID_VALUE
                            - TOO_SMALL
                            - TOO_BIG
                            - UNRECOGNIZED_KEY
                        message:
                          type: string
                          description: What is wrong with the value, in English
                      required:
                        - path
                        - code
                        - message
                      additionalProperties: false
                  requiredScopes:
                    description: >-
                      OAuth scopes the endpoint requires, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  grantedScopes:
                    description: >-
                      OAuth scopes the token was granted, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  readiness:
                    description: >-
                      What blocks sending the document, on a 409
                      `DOCUMENT_NOT_READY`
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: >-
                            What is wrong, such as `MISSING_EMAIL` or
                            `NO_EXPIRATION`. New codes can be added.
                        severity:
                          type: string
                          enum:
                            - BLOCKER
                            - WARNING
                          description: '`BLOCKER` stops the send; `WARNING` doesn''t.'
                        message:
                          type: string
                          description: What is wrong, in English
                        userMessage:
                          type: string
                          description: >-
                            The same, naming the party or field, in Swedish, for
                            showing to a user
                      required:
                        - code
                        - severity
                        - message
                        - userMessage
                      additionalProperties: false
                required:
                  - code
                  - message
                  - userMessage
                  - requestId
                additionalProperties: {}
                description: Error response
              example:
                code: INSUFFICIENT_SCOPE
                message: 'Insufficient OAuth scope: requires documents:write'
                userMessage: Applikationen saknar behörighet (scope) för denna åtgärd.
                requestId: req_V1StGXR8Z5jdHi6BmyT2
                requiredScopes:
                  - documents:write
                grantedScopes:
                  - profile:read
          headers:
            Sajn-Version:
              description: API version that served the request.
              schema:
                type: string
            Deprecation:
              description: >-
                Present only when the version is deprecated: when it was
                deprecated, as `@<unix seconds>`.
              schema:
                type: string
            Sunset:
              description: >-
                Present only when the version is deprecated: the HTTP date from
                which requests on this version return 400 `API_VERSION_SUNSET`.
              schema:
                type: string
            Sajn-Request-Id:
              description: >-
                Identifier of the request. Error bodies repeat it as
                `requestId`; quote it when you contact support.
              schema:
                type: string
            X-RateLimit-Limit:
              description: Requests allowed per minute.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left in the current minute.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: When the minute window resets, in Unix seconds.
              schema:
                type: integer
            Idempotent-Replayed:
              description: >-
                `true` when the response is a stored response replayed for a
                repeated `Idempotency-Key`.
              schema:
                type: string
        '404':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - VALIDATION_FAILED
                      - INVALID_JSON
                      - EXPIRED
                      - IDEMPOTENCY_KEY_REUSED
                      - WORKSPACE_REQUIRED
                      - INVALID_API_VERSION
                      - API_VERSION_SUNSET
                      - UNAUTHORIZED
                      - API_KEY_EXPIRED
                      - PERMISSION_DENIED
                      - WORKSPACE_ACCESS_DENIED
                      - INSUFFICIENT_SCOPE
                      - PLAN_REQUIRED
                      - ACCOUNT_INACTIVE
                      - ACCOUNT_SETUP_REQUIRED
                      - LIMIT_EXCEEDED
                      - DOCUMENT_NOT_READY
                      - APPROVAL_REQUIRED
                      - NOT_FOUND
                      - ROUTE_NOT_FOUND
                      - INVALID_STATE
                      - ALREADY_EXISTS
                      - IDEMPOTENCY_KEY_IN_USE
                      - RATE_LIMITED
                      - INTERNAL_ERROR
                      - UPSTREAM_UNAVAILABLE
                    description: >-
                      Machine-readable error code from a closed list. Branch on
                      it, never on `message`.
                  message:
                    type: string
                    description: >-
                      What went wrong, in English, for developers. Its wording
                      can change; don't parse it.
                  userMessage:
                    type: string
                    description: >-
                      Text that is safe to show to an end user, usually in
                      Swedish
                  requestId:
                    type: string
                    description: >-
                      Identifier of the request, the same value as the
                      `Sajn-Request-Id` header. Quote it when you contact
                      support.
                  resource:
                    description: >-
                      On a 404 `NOT_FOUND`, the type of the missing resource,
                      such as `document` or `party`; `null` when the API can't
                      tell
                    type:
                      - string
                      - 'null'
                  issues:
                    description: Every validation issue, on a 400 `VALIDATION_FAILED`
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: >-
                            Dotted path to the invalid value, such as
                            `parties.0.email`; empty when no single input caused
                            the issue
                        code:
                          type: string
                          enum:
                            - INVALID_TYPE
                            - INVALID_FORMAT
                            - INVALID_VALUE
                            - TOO_SMALL
                            - TOO_BIG
                            - UNRECOGNIZED_KEY
                        message:
                          type: string
                          description: What is wrong with the value, in English
                      required:
                        - path
                        - code
                        - message
                      additionalProperties: false
                  requiredScopes:
                    description: >-
                      OAuth scopes the endpoint requires, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  grantedScopes:
                    description: >-
                      OAuth scopes the token was granted, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  readiness:
                    description: >-
                      What blocks sending the document, on a 409
                      `DOCUMENT_NOT_READY`
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: >-
                            What is wrong, such as `MISSING_EMAIL` or
                            `NO_EXPIRATION`. New codes can be added.
                        severity:
                          type: string
                          enum:
                            - BLOCKER
                            - WARNING
                          description: '`BLOCKER` stops the send; `WARNING` doesn''t.'
                        message:
                          type: string
                          description: What is wrong, in English
                        userMessage:
                          type: string
                          description: >-
                            The same, naming the party or field, in Swedish, for
                            showing to a user
                      required:
                        - code
                        - severity
                        - message
                        - userMessage
                      additionalProperties: false
                required:
                  - code
                  - message
                  - userMessage
                  - requestId
                additionalProperties: {}
                description: Error response
              example:
                code: NOT_FOUND
                message: Document not found
                userMessage: Resursen hittades inte.
                requestId: req_V1StGXR8Z5jdHi6BmyT2
                resource: document
          headers:
            Sajn-Version:
              description: API version that served the request.
              schema:
                type: string
            Deprecation:
              description: >-
                Present only when the version is deprecated: when it was
                deprecated, as `@<unix seconds>`.
              schema:
                type: string
            Sunset:
              description: >-
                Present only when the version is deprecated: the HTTP date from
                which requests on this version return 400 `API_VERSION_SUNSET`.
              schema:
                type: string
            Sajn-Request-Id:
              description: >-
                Identifier of the request. Error bodies repeat it as
                `requestId`; quote it when you contact support.
              schema:
                type: string
            X-RateLimit-Limit:
              description: Requests allowed per minute.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left in the current minute.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: When the minute window resets, in Unix seconds.
              schema:
                type: integer
            Idempotent-Replayed:
              description: >-
                `true` when the response is a stored response replayed for a
                repeated `Idempotency-Key`.
              schema:
                type: string
        '409':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - VALIDATION_FAILED
                      - INVALID_JSON
                      - EXPIRED
                      - IDEMPOTENCY_KEY_REUSED
                      - WORKSPACE_REQUIRED
                      - INVALID_API_VERSION
                      - API_VERSION_SUNSET
                      - UNAUTHORIZED
                      - API_KEY_EXPIRED
                      - PERMISSION_DENIED
                      - WORKSPACE_ACCESS_DENIED
                      - INSUFFICIENT_SCOPE
                      - PLAN_REQUIRED
                      - ACCOUNT_INACTIVE
                      - ACCOUNT_SETUP_REQUIRED
                      - LIMIT_EXCEEDED
                      - DOCUMENT_NOT_READY
                      - APPROVAL_REQUIRED
                      - NOT_FOUND
                      - ROUTE_NOT_FOUND
                      - INVALID_STATE
                      - ALREADY_EXISTS
                      - IDEMPOTENCY_KEY_IN_USE
                      - RATE_LIMITED
                      - INTERNAL_ERROR
                      - UPSTREAM_UNAVAILABLE
                    description: >-
                      Machine-readable error code from a closed list. Branch on
                      it, never on `message`.
                  message:
                    type: string
                    description: >-
                      What went wrong, in English, for developers. Its wording
                      can change; don't parse it.
                  userMessage:
                    type: string
                    description: >-
                      Text that is safe to show to an end user, usually in
                      Swedish
                  requestId:
                    type: string
                    description: >-
                      Identifier of the request, the same value as the
                      `Sajn-Request-Id` header. Quote it when you contact
                      support.
                  resource:
                    description: >-
                      On a 404 `NOT_FOUND`, the type of the missing resource,
                      such as `document` or `party`; `null` when the API can't
                      tell
                    type:
                      - string
                      - 'null'
                  issues:
                    description: Every validation issue, on a 400 `VALIDATION_FAILED`
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: >-
                            Dotted path to the invalid value, such as
                            `parties.0.email`; empty when no single input caused
                            the issue
                        code:
                          type: string
                          enum:
                            - INVALID_TYPE
                            - INVALID_FORMAT
                            - INVALID_VALUE
                            - TOO_SMALL
                            - TOO_BIG
                            - UNRECOGNIZED_KEY
                        message:
                          type: string
                          description: What is wrong with the value, in English
                      required:
                        - path
                        - code
                        - message
                      additionalProperties: false
                  requiredScopes:
                    description: >-
                      OAuth scopes the endpoint requires, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  grantedScopes:
                    description: >-
                      OAuth scopes the token was granted, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  readiness:
                    description: >-
                      What blocks sending the document, on a 409
                      `DOCUMENT_NOT_READY`
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: >-
                            What is wrong, such as `MISSING_EMAIL` or
                            `NO_EXPIRATION`. New codes can be added.
                        severity:
                          type: string
                          enum:
                            - BLOCKER
                            - WARNING
                          description: '`BLOCKER` stops the send; `WARNING` doesn''t.'
                        message:
                          type: string
                          description: What is wrong, in English
                        userMessage:
                          type: string
                          description: >-
                            The same, naming the party or field, in Swedish, for
                            showing to a user
                      required:
                        - code
                        - severity
                        - message
                        - userMessage
                      additionalProperties: false
                required:
                  - code
                  - message
                  - userMessage
                  - requestId
                additionalProperties: {}
                description: Error response
              examples:
                invalid_state:
                  summary: INVALID_STATE
                  value:
                    code: INVALID_STATE
                    message: >-
                      The resource's current state doesn't allow the operation,
                      such as editing a document that was already sent or
                      downloading a file that isn't produced yet.
                    userMessage: Åtgärden är inte möjlig i resursens nuvarande status.
                    requestId: req_V1StGXR8Z5jdHi6BmyT2
                notPending:
                  summary: INVALID_STATE
                  value:
                    code: INVALID_STATE
                    message: Only a PENDING or EXPIRED document can be completed
                    userMessage: >-
                      Endast dokument som väntar på signering kan avslutas
                      manuellt.
                    requestId: req_V1StGXR8Z5jdHi6BmyT2
                noSignatures:
                  summary: INVALID_STATE
                  value:
                    code: INVALID_STATE
                    message: >-
                      At least one party must sign before the document can be
                      completed
                    userMessage: >-
                      Minst en part måste ha signerat innan dokumentet kan
                      avslutas manuellt.
                    requestId: req_V1StGXR8Z5jdHi6BmyT2
          headers:
            Sajn-Version:
              description: API version that served the request.
              schema:
                type: string
            Deprecation:
              description: >-
                Present only when the version is deprecated: when it was
                deprecated, as `@<unix seconds>`.
              schema:
                type: string
            Sunset:
              description: >-
                Present only when the version is deprecated: the HTTP date from
                which requests on this version return 400 `API_VERSION_SUNSET`.
              schema:
                type: string
            Sajn-Request-Id:
              description: >-
                Identifier of the request. Error bodies repeat it as
                `requestId`; quote it when you contact support.
              schema:
                type: string
            X-RateLimit-Limit:
              description: Requests allowed per minute.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left in the current minute.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: When the minute window resets, in Unix seconds.
              schema:
                type: integer
            Retry-After:
              description: Seconds to wait before you retry.
              schema:
                type: integer
            Idempotent-Replayed:
              description: >-
                `true` when the response is a stored response replayed for a
                repeated `Idempotency-Key`.
              schema:
                type: string
        '429':
          description: '`RATE_LIMITED`.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - VALIDATION_FAILED
                      - INVALID_JSON
                      - EXPIRED
                      - IDEMPOTENCY_KEY_REUSED
                      - WORKSPACE_REQUIRED
                      - INVALID_API_VERSION
                      - API_VERSION_SUNSET
                      - UNAUTHORIZED
                      - API_KEY_EXPIRED
                      - PERMISSION_DENIED
                      - WORKSPACE_ACCESS_DENIED
                      - INSUFFICIENT_SCOPE
                      - PLAN_REQUIRED
                      - ACCOUNT_INACTIVE
                      - ACCOUNT_SETUP_REQUIRED
                      - LIMIT_EXCEEDED
                      - DOCUMENT_NOT_READY
                      - APPROVAL_REQUIRED
                      - NOT_FOUND
                      - ROUTE_NOT_FOUND
                      - INVALID_STATE
                      - ALREADY_EXISTS
                      - IDEMPOTENCY_KEY_IN_USE
                      - RATE_LIMITED
                      - INTERNAL_ERROR
                      - UPSTREAM_UNAVAILABLE
                    description: >-
                      Machine-readable error code from a closed list. Branch on
                      it, never on `message`.
                  message:
                    type: string
                    description: >-
                      What went wrong, in English, for developers. Its wording
                      can change; don't parse it.
                  userMessage:
                    type: string
                    description: >-
                      Text that is safe to show to an end user, usually in
                      Swedish
                  requestId:
                    type: string
                    description: >-
                      Identifier of the request, the same value as the
                      `Sajn-Request-Id` header. Quote it when you contact
                      support.
                  resource:
                    description: >-
                      On a 404 `NOT_FOUND`, the type of the missing resource,
                      such as `document` or `party`; `null` when the API can't
                      tell
                    type:
                      - string
                      - 'null'
                  issues:
                    description: Every validation issue, on a 400 `VALIDATION_FAILED`
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: >-
                            Dotted path to the invalid value, such as
                            `parties.0.email`; empty when no single input caused
                            the issue
                        code:
                          type: string
                          enum:
                            - INVALID_TYPE
                            - INVALID_FORMAT
                            - INVALID_VALUE
                            - TOO_SMALL
                            - TOO_BIG
                            - UNRECOGNIZED_KEY
                        message:
                          type: string
                          description: What is wrong with the value, in English
                      required:
                        - path
                        - code
                        - message
                      additionalProperties: false
                  requiredScopes:
                    description: >-
                      OAuth scopes the endpoint requires, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  grantedScopes:
                    description: >-
                      OAuth scopes the token was granted, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  readiness:
                    description: >-
                      What blocks sending the document, on a 409
                      `DOCUMENT_NOT_READY`
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: >-
                            What is wrong, such as `MISSING_EMAIL` or
                            `NO_EXPIRATION`. New codes can be added.
                        severity:
                          type: string
                          enum:
                            - BLOCKER
                            - WARNING
                          description: '`BLOCKER` stops the send; `WARNING` doesn''t.'
                        message:
                          type: string
                          description: What is wrong, in English
                        userMessage:
                          type: string
                          description: >-
                            The same, naming the party or field, in Swedish, for
                            showing to a user
                      required:
                        - code
                        - severity
                        - message
                        - userMessage
                      additionalProperties: false
                required:
                  - code
                  - message
                  - userMessage
                  - requestId
                additionalProperties: {}
                description: Error response
              example:
                code: RATE_LIMITED
                message: API rate limit exceeded
                userMessage: För många förfrågningar. Försök igen om en stund.
                requestId: req_V1StGXR8Z5jdHi6BmyT2
          headers:
            Sajn-Version:
              description: API version that served the request.
              schema:
                type: string
            Deprecation:
              description: >-
                Present only when the version is deprecated: when it was
                deprecated, as `@<unix seconds>`.
              schema:
                type: string
            Sunset:
              description: >-
                Present only when the version is deprecated: the HTTP date from
                which requests on this version return 400 `API_VERSION_SUNSET`.
              schema:
                type: string
            Sajn-Request-Id:
              description: >-
                Identifier of the request. Error bodies repeat it as
                `requestId`; quote it when you contact support.
              schema:
                type: string
            X-RateLimit-Limit:
              description: Requests allowed per minute.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left in the current minute.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: When the minute window resets, in Unix seconds.
              schema:
                type: integer
            Retry-After:
              description: Seconds to wait before you retry.
              schema:
                type: integer
            Idempotent-Replayed:
              description: >-
                `true` when the response is a stored response replayed for a
                repeated `Idempotency-Key`.
              schema:
                type: string
        '500':
          description: '`INTERNAL_ERROR`.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - VALIDATION_FAILED
                      - INVALID_JSON
                      - EXPIRED
                      - IDEMPOTENCY_KEY_REUSED
                      - WORKSPACE_REQUIRED
                      - INVALID_API_VERSION
                      - API_VERSION_SUNSET
                      - UNAUTHORIZED
                      - API_KEY_EXPIRED
                      - PERMISSION_DENIED
                      - WORKSPACE_ACCESS_DENIED
                      - INSUFFICIENT_SCOPE
                      - PLAN_REQUIRED
                      - ACCOUNT_INACTIVE
                      - ACCOUNT_SETUP_REQUIRED
                      - LIMIT_EXCEEDED
                      - DOCUMENT_NOT_READY
                      - APPROVAL_REQUIRED
                      - NOT_FOUND
                      - ROUTE_NOT_FOUND
                      - INVALID_STATE
                      - ALREADY_EXISTS
                      - IDEMPOTENCY_KEY_IN_USE
                      - RATE_LIMITED
                      - INTERNAL_ERROR
                      - UPSTREAM_UNAVAILABLE
                    description: >-
                      Machine-readable error code from a closed list. Branch on
                      it, never on `message`.
                  message:
                    type: string
                    description: >-
                      What went wrong, in English, for developers. Its wording
                      can change; don't parse it.
                  userMessage:
                    type: string
                    description: >-
                      Text that is safe to show to an end user, usually in
                      Swedish
                  requestId:
                    type: string
                    description: >-
                      Identifier of the request, the same value as the
                      `Sajn-Request-Id` header. Quote it when you contact
                      support.
                  resource:
                    description: >-
                      On a 404 `NOT_FOUND`, the type of the missing resource,
                      such as `document` or `party`; `null` when the API can't
                      tell
                    type:
                      - string
                      - 'null'
                  issues:
                    description: Every validation issue, on a 400 `VALIDATION_FAILED`
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: >-
                            Dotted path to the invalid value, such as
                            `parties.0.email`; empty when no single input caused
                            the issue
                        code:
                          type: string
                          enum:
                            - INVALID_TYPE
                            - INVALID_FORMAT
                            - INVALID_VALUE
                            - TOO_SMALL
                            - TOO_BIG
                            - UNRECOGNIZED_KEY
                        message:
                          type: string
                          description: What is wrong with the value, in English
                      required:
                        - path
                        - code
                        - message
                      additionalProperties: false
                  requiredScopes:
                    description: >-
                      OAuth scopes the endpoint requires, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  grantedScopes:
                    description: >-
                      OAuth scopes the token was granted, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  readiness:
                    description: >-
                      What blocks sending the document, on a 409
                      `DOCUMENT_NOT_READY`
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: >-
                            What is wrong, such as `MISSING_EMAIL` or
                            `NO_EXPIRATION`. New codes can be added.
                        severity:
                          type: string
                          enum:
                            - BLOCKER
                            - WARNING
                          description: '`BLOCKER` stops the send; `WARNING` doesn''t.'
                        message:
                          type: string
                          description: What is wrong, in English
                        userMessage:
                          type: string
                          description: >-
                            The same, naming the party or field, in Swedish, for
                            showing to a user
                      required:
                        - code
                        - severity
                        - message
                        - userMessage
                      additionalProperties: false
                required:
                  - code
                  - message
                  - userMessage
                  - requestId
                additionalProperties: {}
                description: Error response
              example:
                code: INTERNAL_ERROR
                message: Internal server error
                userMessage: Något gick fel.
                requestId: req_V1StGXR8Z5jdHi6BmyT2
          headers:
            Sajn-Version:
              description: API version that served the request.
              schema:
                type: string
            Deprecation:
              description: >-
                Present only when the version is deprecated: when it was
                deprecated, as `@<unix seconds>`.
              schema:
                type: string
            Sunset:
              description: >-
                Present only when the version is deprecated: the HTTP date from
                which requests on this version return 400 `API_VERSION_SUNSET`.
              schema:
                type: string
            Sajn-Request-Id:
              description: >-
                Identifier of the request. Error bodies repeat it as
                `requestId`; quote it when you contact support.
              schema:
                type: string
            X-RateLimit-Limit:
              description: Requests allowed per minute.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left in the current minute.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: When the minute window resets, in Unix seconds.
              schema:
                type: integer
        '503':
          description: >-
            `UPSTREAM_UNAVAILABLE`: a service the operation depends on failed.
            Retry with exponential backoff.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - VALIDATION_FAILED
                      - INVALID_JSON
                      - EXPIRED
                      - IDEMPOTENCY_KEY_REUSED
                      - WORKSPACE_REQUIRED
                      - INVALID_API_VERSION
                      - API_VERSION_SUNSET
                      - UNAUTHORIZED
                      - API_KEY_EXPIRED
                      - PERMISSION_DENIED
                      - WORKSPACE_ACCESS_DENIED
                      - INSUFFICIENT_SCOPE
                      - PLAN_REQUIRED
                      - ACCOUNT_INACTIVE
                      - ACCOUNT_SETUP_REQUIRED
                      - LIMIT_EXCEEDED
                      - DOCUMENT_NOT_READY
                      - APPROVAL_REQUIRED
                      - NOT_FOUND
                      - ROUTE_NOT_FOUND
                      - INVALID_STATE
                      - ALREADY_EXISTS
                      - IDEMPOTENCY_KEY_IN_USE
                      - RATE_LIMITED
                      - INTERNAL_ERROR
                      - UPSTREAM_UNAVAILABLE
                    description: >-
                      Machine-readable error code from a closed list. Branch on
                      it, never on `message`.
                  message:
                    type: string
                    description: >-
                      What went wrong, in English, for developers. Its wording
                      can change; don't parse it.
                  userMessage:
                    type: string
                    description: >-
                      Text that is safe to show to an end user, usually in
                      Swedish
                  requestId:
                    type: string
                    description: >-
                      Identifier of the request, the same value as the
                      `Sajn-Request-Id` header. Quote it when you contact
                      support.
                  resource:
                    description: >-
                      On a 404 `NOT_FOUND`, the type of the missing resource,
                      such as `document` or `party`; `null` when the API can't
                      tell
                    type:
                      - string
                      - 'null'
                  issues:
                    description: Every validation issue, on a 400 `VALIDATION_FAILED`
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: >-
                            Dotted path to the invalid value, such as
                            `parties.0.email`; empty when no single input caused
                            the issue
                        code:
                          type: string
                          enum:
                            - INVALID_TYPE
                            - INVALID_FORMAT
                            - INVALID_VALUE
                            - TOO_SMALL
                            - TOO_BIG
                            - UNRECOGNIZED_KEY
                        message:
                          type: string
                          description: What is wrong with the value, in English
                      required:
                        - path
                        - code
                        - message
                      additionalProperties: false
                  requiredScopes:
                    description: >-
                      OAuth scopes the endpoint requires, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  grantedScopes:
                    description: >-
                      OAuth scopes the token was granted, on a 403
                      `INSUFFICIENT_SCOPE`
                    type: array
                    items:
                      type: string
                  readiness:
                    description: >-
                      What blocks sending the document, on a 409
                      `DOCUMENT_NOT_READY`
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: >-
                            What is wrong, such as `MISSING_EMAIL` or
                            `NO_EXPIRATION`. New codes can be added.
                        severity:
                          type: string
                          enum:
                            - BLOCKER
                            - WARNING
                          description: '`BLOCKER` stops the send; `WARNING` doesn''t.'
                        message:
                          type: string
                          description: What is wrong, in English
                        userMessage:
                          type: string
                          description: >-
                            The same, naming the party or field, in Swedish, for
                            showing to a user
                      required:
                        - code
                        - severity
                        - message
                        - userMessage
                      additionalProperties: false
                required:
                  - code
                  - message
                  - userMessage
                  - requestId
                additionalProperties: {}
                description: Error response
              example:
                code: UPSTREAM_UNAVAILABLE
                message: >-
                  A service the operation depends on, such as an eID provider or
                  a connected integration, failed or is unavailable. Retry with
                  exponential backoff.
                userMessage: En extern tjänst svarar inte just nu. Försök igen om en stund.
                requestId: req_V1StGXR8Z5jdHi6BmyT2
          headers:
            Sajn-Version:
              description: API version that served the request.
              schema:
                type: string
            Deprecation:
              description: >-
                Present only when the version is deprecated: when it was
                deprecated, as `@<unix seconds>`.
              schema:
                type: string
            Sunset:
              description: >-
                Present only when the version is deprecated: the HTTP date from
                which requests on this version return 400 `API_VERSION_SUNSET`.
              schema:
                type: string
            Sajn-Request-Id:
              description: >-
                Identifier of the request. Error bodies repeat it as
                `requestId`; quote it when you contact support.
              schema:
                type: string
            X-RateLimit-Limit:
              description: Requests allowed per minute.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left in the current minute.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: When the minute window resets, in Unix seconds.
              schema:
                type: integer
      security:
        - bearerAuth: []
        - oauth2:
            - documents:write
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Personal API key, e.g. `Authorization: Bearer sajn_sk_...`. Not
        scope-limited — acts as the issuing user.
    oauth2:
      type: oauth2
      description: >-
        OAuth 2.0 access token for a connected application. Limited to the
        scopes granted at consent.
      flows:
        authorizationCode:
          authorizationUrl: https://app.sajn.se/oauth/authorize
          tokenUrl: https://app.sajn.se/api/oauth/token
          refreshUrl: https://app.sajn.se/api/oauth/token
          scopes:
            profile:read: >-
              Read the user's profile, including name, phone number and email
              address.
            documents:read: Read documents.
            documents:write: Create documents and edit the documents the user created.
            documents:delete: >-
              Delete documents, files, folders, custom fields and comment
              threads.
            forms:read: Read forms and their settings.
            forms:write: Create, edit and publish forms.
            forms:delete: Permanently delete forms and their submissions.
            forms:submissions:read: Read form submissions and the respondents' contact details.
            templates:read: Read templates.
            templates:write: Create and edit templates.
            contacts:read: Read contacts.
            contacts:write: Create and edit contacts.
            contacts:delete: Delete contacts.
            organization:read: Read information about the organization.
            audit:read: Read document activity and event logs.
            signatures:read: >-
              Read the identity the eID verified at signing, including the
              national identity number.
            sajnid:read: Read sajn ID verifications.
            sajnid:write: Create sajn ID verifications.
            login:read: Read the result of sajn Login sessions.
            login:write: Start sajn Login sessions.
            webhooks:read: Read webhooks and their deliveries.
            webhooks:write: Create, edit and delete webhooks.
            actions:read: Read suggested actions and what each one does.
            actions:write: >-
              Approve, dismiss and snooze suggested actions. An approval can
              send reminders to counterparties, terminate agreements and create
              follow-ups.
            members:read: Read the workspace's members.
            members:write: Invite and manage workspace members.
            roles:read: Read the workspace's roles and permissions.
            roles:write: Create, edit and delete workspace roles.
            sajn:read: >-
              MCP only. Read everything the user's role can read in the
              workspace.
            sajn:write: >-
              MCP only. Includes sajn:read, and create, change and send within
              the user's role.
            sajn:admin: >-
              MCP only. Includes sajn:write, and manage members, roles and
              settings within the user's role.

````

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