> ## 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.

# Create a document field

> Add a field/section to a document. Can create single field or multiple fields at once.

**Field Types:**
- `TEXT` - Rich text content section (Tiptap editor format)
- `HTML` - Raw HTML content with custom styling (API-only, sanitized for security)
- `FORM` - Form with input fields for signers
- `PDF` - PDF file section
- `PRODUCT_TABLE` - Product/service table with pricing
- `TABLE` - Simple table with custom rows and columns
- `SPACER`, `PAGE_BREAK`, `DURATION` - Layout and duration blocks

**Field Position:** Determines the order fields appear in the document (0-based index).

**Field Metadata:** Each field type has specific metadata requirements. See schema documentation for details.

**Placing fields on a PDF:** a `PDF` field renders an uploaded PDF (`fieldMeta.value` is the storage `key` returned by the files endpoint). Add boxes on its pages with `fieldMeta.placedFields`. Each entry has a unique `id`, `page` (0-based), `rect` (`x`, `y`, `width`, `height` in PDF points, origin at the bottom-left corner of the page), and a `kind`. The server fills `pageWidth`, `pageHeight`, and `pageRotation` from the PDF page when you omit them. If you send `pageWidth` and `pageHeight`, `rect` is measured on a page of that size and scaled to the real page. The box kinds are the following:
- `input` with `inputType` `signature` or `initials` and a `signerId`: a mark the party draws at signing, sealed into the PDF at that position.
- `input` with `inputType` `text`, `date`, `checkbox` or `select` and a `signerId`: a value the party fills in before signing. Set `required` to block signing until it is filled.
- `static` with `content` (HTML): fixed text stamped at that position.

Set `key` on an `input` box to fill it in by that key through `PATCH /api/v1/documents/{id}/field-values`. A key can contain lowercase letters, digits, hyphens, and underscores.

Example:
```json
{
  "type": "PDF",
  "position": 0,
  "fieldMeta": {
    "type": "PDF",
    "value": "f/org_123/abc123def/contract.pdf",
    "placedFields": [
      {
        "id": "sig-1",
        "kind": "input",
        "inputType": "signature",
        "page": 2,
        "rect": { "x": 72, "y": 96, "width": 200, "height": 48 },
        "pageWidth": 595.28,
        "pageHeight": 841.89,
        "signerId": "PARTY_ID",
        "required": true
      }
    ]
  }
}
```

The request fails with an HTTP `400 Bad Request` status code, and writes nothing, when a box has a `page` the PDF doesn't have, doesn't fit on its page, names a `signerId` that isn't a party on the document, or is a `signature` or `initials` box without a party with the `SIGNER` role. The `issues` array in the response lists every problem with its path, such as `fieldMeta.placedFields.2.rect`.

Read the result back with `GET /api/v1/documents/{id}/fields`. To add, move, or remove single boxes later, use `PATCH /api/v1/documents/{id}/fields/{fieldId}/placed-fields`.

**HTML Field Security:** HTML fields accept raw HTML but are automatically sanitized server-side to allow only safe formatting tags (p, div, span, headings, lists, tables, images) and basic CSS styling. Links, script tags, and dangerous attributes are stripped. Images support HTTP/HTTPS URLs and data URIs for inline images.

<Warning>You're viewing API version `2026-09`, which is deprecated and stops working on October 1, 2027. To see the current version, select **2026-10** in the menu at the top of the sidebar. To move your integration, see [Upgrading to 2026-10](/upgrading/2026-10).</Warning>


## OpenAPI

````yaml /api/openapi-2026-09.json post /api/v1/documents/{id}/fields
openapi: 3.0.2
info:
  title: sajn API
  version: 1.0.0
  description: >-
    # sajn - API v1


    Welcome to the sajn API documentation. This RESTful API allows you to
    integrate digital document signing capabilities into your applications.


    ## Overview


    sajn is a Swedish digital document signing platform that enables you to:

    - Create and manage digital documents

    - Add signers and participants to documents

    - Send documents for signing via email or SMS

    - Track document status and signatures

    - Manage contacts and companies

    - Organize documents with tags and custom fields

    - Perform identity verification with sajn ID (BankID integration)


    ## 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:


    - **Personal API key** (`sajn_sk_...`) — generated from your workspace
    developer settings. Acts as the issuing user; can reach any endpoint the
    user's workspace role permits.

    - **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*.


    Each operation below lists the OAuth scope(s) it requires under 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 | Per day |

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

    | Basic | 60 | 2 000 |

    | Solo | 120 | 10 000 |

    | Team | 600 | 100 000 |

    | Enterprise | 2 000 | 2 000 000 |

    | Sandbox | 60 | 2 000 |


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


    ## Pagination


    List endpoints accept `page` (default 1) and `perPage` (default 10, max 100)
    and return `totalPages`. The documents, templates and contacts lists also
    return `total`.


    The documents list additionally supports cursor pagination: pass the
    `nextCursor` from a response as `cursor` on the next request. Cursors stay
    correct while documents are created and updated between requests, which page
    numbers do not, so use them when mirroring documents into your own system
    together with 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. 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`; retrying while the first request
    is still running returns `409`. Responses with a `5xx` status are not
    stored, so the retry runs again. Keys are scoped to the workspace.


    ## Webhooks


    Configure webhooks to receive real-time notifications about document events:

    - `DOCUMENT_CREATED` - When a document is created

    - `DOCUMENT_SENT` - When a document is sent for signing

    - `DOCUMENT_OPENED` - When a signer opens a document

    - `DOCUMENT_SIGNED` - When a signer signs a document

    - `DOCUMENT_COMPLETED` - When all signers have signed

    - `DOCUMENT_REJECTED` - When a signer rejects a document


    ## Error Handling


    The API uses standard HTTP status codes and returns error details in JSON
    format:


    ```json

    {
      "message": "Error description",
      "code": "NOT_FOUND",
      "errorId": "..."
    }

    ```


    `code` is a stable machine-readable identifier; `errorId` identifies the
    occurrence when you contact support.


    A `400` for an invalid request lists every problem in `issues` (`[{ "path":
    "signers.0.email", "message": "..." }]`). A `403` for a missing OAuth scope
    includes `requiredScopes` and `grantedScopes`.


    Common status codes:

    - 200: Success

    - 400: Bad Request - Invalid parameters

    - 401: Unauthorized - Invalid or missing API key

    - 404: Not Found - Resource doesn't exist

    - 409: Conflict - Resource already exists

    - 429: Too Many Requests - Rate limit exceeded

    - 500: Internal Server Error


    ## 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: hej@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: Signers
    description: >-
      [DEPRECATED] Legacy endpoints for document signers. Will stop working in
      API v2 — use the Parties endpoints instead.
  - 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. File uploads are handled by a dedicated upload
      server (upload.sajn.se).
  - 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 replay 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}/fields:
    post:
      summary: Create a document field
      description: >-
        Add a field/section to a document. Can create single field or multiple
        fields at once.


        **Field Types:**

        - `TEXT` - Rich text content section (Tiptap editor format)

        - `HTML` - Raw HTML content with custom styling (API-only, sanitized for
        security)

        - `FORM` - Form with input fields for signers

        - `PDF` - PDF file section

        - `PRODUCT_TABLE` - Product/service table with pricing

        - `TABLE` - Simple table with custom rows and columns

        - `SPACER`, `PAGE_BREAK`, `DURATION` - Layout and duration blocks


        **Field Position:** Determines the order fields appear in the document
        (0-based index).


        **Field Metadata:** Each field type has specific metadata requirements.
        See schema documentation for details.


        **Placing fields on a PDF:** a `PDF` field renders an uploaded PDF
        (`fieldMeta.value` is the storage `key` returned by the files endpoint).
        Add boxes on its pages with `fieldMeta.placedFields`. Each entry has a
        unique `id`, `page` (0-based), `rect` (`x`, `y`, `width`, `height` in
        PDF points, origin at the bottom-left corner of the page), and a `kind`.
        The server fills `pageWidth`, `pageHeight`, and `pageRotation` from the
        PDF page when you omit them. If you send `pageWidth` and `pageHeight`,
        `rect` is measured on a page of that size and scaled to the real page.
        The box kinds are the following:

        - `input` with `inputType` `signature` or `initials` and a `signerId`: a
        mark the party draws at signing, sealed into the PDF at that position.

        - `input` with `inputType` `text`, `date`, `checkbox` or `select` and a
        `signerId`: a value the party fills in before signing. Set `required` to
        block signing until it is filled.

        - `static` with `content` (HTML): fixed text stamped at that position.


        Set `key` on an `input` box to fill it in by that key through `PATCH
        /api/v1/documents/{id}/field-values`. A key can contain lowercase
        letters, digits, hyphens, and underscores.


        Example:

        ```json

        {
          "type": "PDF",
          "position": 0,
          "fieldMeta": {
            "type": "PDF",
            "value": "f/org_123/abc123def/contract.pdf",
            "placedFields": [
              {
                "id": "sig-1",
                "kind": "input",
                "inputType": "signature",
                "page": 2,
                "rect": { "x": 72, "y": 96, "width": 200, "height": 48 },
                "pageWidth": 595.28,
                "pageHeight": 841.89,
                "signerId": "PARTY_ID",
                "required": true
              }
            ]
          }
        }

        ```


        The request fails with an HTTP `400 Bad Request` status code, and writes
        nothing, when a box has a `page` the PDF doesn't have, doesn't fit on
        its page, names a `signerId` that isn't a party on the document, or is a
        `signature` or `initials` box without a party with the `SIGNER` role.
        The `issues` array in the response lists every problem with its path,
        such as `fieldMeta.placedFields.2.rect`.


        Read the result back with `GET /api/v1/documents/{id}/fields`. To add,
        move, or remove single boxes later, use `PATCH
        /api/v1/documents/{id}/fields/{fieldId}/placed-fields`.


        **HTML Field Security:** HTML fields accept raw HTML but are
        automatically sanitized server-side to allow only safe formatting tags
        (p, div, span, headings, lists, tables, images) and basic CSS styling.
        Links, script tags, and dangerous attributes are stripped. Images
        support HTTP/HTTPS URLs and data URIs for inline images.
      operationId: createField
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: authorization
          in: header
          description: Bearer token for API authentication
          required: true
          schema:
            type: string
        - 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:
              anyOf:
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - TEXT
                        - HTML
                        - FORM
                        - PDF
                        - PRODUCT_TABLE
                        - TABLE
                        - SPACER
                        - PAGE_BREAK
                        - DURATION
                    position:
                      type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    key:
                      type: string
                      pattern: ^[a-z0-9_-]*$
                    fieldMeta:
                      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:
                                customInputId:
                                  type: string
                                  minLength: 1
                                equals:
                                  type: string
                                mode:
                                  type: string
                                  enum:
                                    - SHOW_WHEN
                                    - HIDE_WHEN
                              required:
                                - customInputId
                                - 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:
                                customInputId:
                                  type: string
                                  minLength: 1
                                equals:
                                  type: string
                                mode:
                                  type: string
                                  enum:
                                    - SHOW_WHEN
                                    - HIDE_WHEN
                              required:
                                - customInputId
                                - 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: 0
                                    maximum: 9007199254740991
                                  rect:
                                    type: object
                                    properties:
                                      x:
                                        type: number
                                      'y':
                                        type: number
                                      width:
                                        type: number
                                      height:
                                        type: number
                                    required:
                                      - x
                                      - 'y'
                                      - width
                                      - height
                                    additionalProperties: false
                                  pageWidth:
                                    type: number
                                    exclusiveMinimum: true
                                    minimum: 0
                                  pageHeight:
                                    type: number
                                    exclusiveMinimum: true
                                    minimum: 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
                                required:
                                  - name
                                  - type
                                  - page
                                  - rect
                                  - pageWidth
                                  - pageHeight
                                additionalProperties: false
                            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: 0
                                        maximum: 9007199254740991
                                      rect:
                                        type: object
                                        properties:
                                          x:
                                            type: number
                                          'y':
                                            type: number
                                          width:
                                            type: number
                                            exclusiveMinimum: true
                                            minimum: 0
                                          height:
                                            type: number
                                            exclusiveMinimum: true
                                            minimum: 0
                                        required:
                                          - x
                                          - 'y'
                                          - width
                                          - height
                                        additionalProperties: false
                                      pageWidth:
                                        description: >-
                                          Width of the page in PDF points, the
                                          unit `rect` is measured in. Omit to use
                                          the width of the PDF page.
                                        type: number
                                        exclusiveMinimum: true
                                        minimum: 0
                                      pageHeight:
                                        description: >-
                                          Height of the page in PDF points. Omit
                                          to use the height of the PDF page.
                                        type: number
                                        exclusiveMinimum: true
                                        minimum: 0
                                      pageRotation:
                                        description: >-
                                          Rotation of the page in degrees. Omit to
                                          use the rotation of the PDF page.
                                        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
                                      signerId:
                                        type: string
                                      variableId:
                                        type: string
                                      required:
                                        type: boolean
                                      options:
                                        type: array
                                        items:
                                          type: string
                                      multiline:
                                        type: boolean
                                    required:
                                      - id
                                      - page
                                      - rect
                                      - kind
                                      - inputType
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      id:
                                        type: string
                                        minLength: 1
                                      page:
                                        type: integer
                                        minimum: 0
                                        maximum: 9007199254740991
                                      rect:
                                        type: object
                                        properties:
                                          x:
                                            type: number
                                          'y':
                                            type: number
                                          width:
                                            type: number
                                            exclusiveMinimum: true
                                            minimum: 0
                                          height:
                                            type: number
                                            exclusiveMinimum: true
                                            minimum: 0
                                        required:
                                          - x
                                          - 'y'
                                          - width
                                          - height
                                        additionalProperties: false
                                      pageWidth:
                                        description: >-
                                          Width of the page in PDF points, the
                                          unit `rect` is measured in. Omit to use
                                          the width of the PDF page.
                                        type: number
                                        exclusiveMinimum: true
                                        minimum: 0
                                      pageHeight:
                                        description: >-
                                          Height of the page in PDF points. Omit
                                          to use the height of the PDF page.
                                        type: number
                                        exclusiveMinimum: true
                                        minimum: 0
                                      pageRotation:
                                        description: >-
                                          Rotation of the page in degrees. Omit to
                                          use the rotation of the PDF page.
                                        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
                                      - kind
                                    additionalProperties: false
                                description: A box placed on a page of a PDF field
                            locked:
                              type: boolean
                            visibilityRule:
                              type: object
                              properties:
                                customInputId:
                                  type: string
                                  minLength: 1
                                equals:
                                  type: string
                                mode:
                                  type: string
                                  enum:
                                    - SHOW_WHEN
                                    - HIDE_WHEN
                              required:
                                - customInputId
                                - 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: true
                                    maximum: 9007199254740991
                                    minimum: 0
                                  fieldMeta:
                                    oneOf:
                                      - type: object
                                        properties:
                                          label:
                                            type: string
                                          placeholder:
                                            type: string
                                          description:
                                            type: string
                                          signerId:
                                            type: string
                                            nullable: true
                                          required:
                                            type: boolean
                                          type:
                                            type: string
                                            enum:
                                              - input
                                          value:
                                            type: string
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          label:
                                            type: string
                                          placeholder:
                                            type: string
                                          description:
                                            type: string
                                          signerId:
                                            type: string
                                            nullable: true
                                          required:
                                            type: boolean
                                          type:
                                            type: string
                                            enum:
                                              - text
                                          value:
                                            type: string
                                          rows:
                                            type: integer
                                            minimum: 2
                                            maximum: 20
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          label:
                                            type: string
                                          placeholder:
                                            type: string
                                          description:
                                            type: string
                                          signerId:
                                            type: string
                                            nullable: true
                                          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
                                          signerId:
                                            type: string
                                            nullable: true
                                          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
                                          signerId:
                                            type: string
                                            nullable: true
                                          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
                                          signerId:
                                            type: string
                                            nullable: true
                                          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
                                          signerId:
                                            type: string
                                            nullable: true
                                          required:
                                            type: boolean
                                          type:
                                            type: string
                                            enum:
                                              - number
                                          value:
                                            type: string
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          label:
                                            type: string
                                          placeholder:
                                            type: string
                                          description:
                                            type: string
                                          signerId:
                                            type: string
                                            nullable: true
                                          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:
                                              s3Key:
                                                type: string
                                              fileName:
                                                type: string
                                              mimeType:
                                                type: string
                                              size:
                                                type: number
                                              sha256:
                                                type: string
                                              storageProviderId:
                                                type: string
                                                nullable: true
                                            required:
                                              - s3Key
                                              - fileName
                                              - mimeType
                                              - size
                                              - sha256
                                            additionalProperties: false
                                        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:
                                customInputId:
                                  type: string
                                  minLength: 1
                                equals:
                                  type: string
                                mode:
                                  type: string
                                  enum:
                                    - SHOW_WHEN
                                    - HIDE_WHEN
                              required:
                                - customInputId
                                - 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: {}
                                  settings:
                                    type: object
                                    properties:
                                      decimalPlaces:
                                        type: number
                                      oneTimePayment:
                                        type: boolean
                                      pricePrefix:
                                        type: string
                                      priceSuffix:
                                        type: string
                                      defaultMomsRate:
                                        type: number
                                      showMomsBreakdown:
                                        type: boolean
                                      pricesIncludeMoms:
                                        type: boolean
                                    additionalProperties: false
                                required:
                                  - name
                                  - originalName
                                  - enabled
                                  - key
                                  - settings
                                additionalProperties: false
                            summaryLabels:
                              type: object
                              properties:
                                subtotal:
                                  type: string
                                moms:
                                  type: string
                                total:
                                  type: string
                                payable:
                                  type: string
                              required:
                                - subtotal
                                - moms
                                - total
                              additionalProperties: false
                            allowSelection:
                              type: boolean
                            selectionSignerId:
                              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
                            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:
                                pricesIncludeMoms:
                                  type: boolean
                                defaultMomsRate:
                                  type: number
                                showMomsBreakdown:
                                  type: boolean
                              additionalProperties: false
                            style:
                              type: object
                              properties:
                                border:
                                  type: boolean
                                rounded:
                                  type: boolean
                              additionalProperties: false
                            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:
                                    type: number
                                  unit:
                                    type: string
                                  quantity:
                                    type: number
                                  moms:
                                    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:
                                customInputId:
                                  type: string
                                  minLength: 1
                                equals:
                                  type: string
                                mode:
                                  type: string
                                  enum:
                                    - SHOW_WHEN
                                    - HIDE_WHEN
                              required:
                                - customInputId
                                - 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:
                                customInputId:
                                  type: string
                                  minLength: 1
                                equals:
                                  type: string
                                mode:
                                  type: string
                                  enum:
                                    - SHOW_WHEN
                                    - HIDE_WHEN
                              required:
                                - customInputId
                                - 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: true
                                  maximum: 9007199254740991
                                  minimum: 0
                                unit:
                                  type: string
                                  enum:
                                    - day
                                    - week
                                    - month
                                    - year
                              required:
                                - value
                                - unit
                              additionalProperties: false
                            noticePeriod:
                              type: object
                              properties:
                                value:
                                  type: integer
                                  exclusiveMinimum: true
                                  maximum: 9007199254740991
                                  minimum: 0
                                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
                  required:
                    - type
                    - position
                    - fieldMeta
                  additionalProperties: false
                - minItems: 1
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - TEXT
                          - HTML
                          - FORM
                          - PDF
                          - PRODUCT_TABLE
                          - TABLE
                          - SPACER
                          - PAGE_BREAK
                          - DURATION
                      position:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                      key:
                        type: string
                        pattern: ^[a-z0-9_-]*$
                      fieldMeta:
                        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:
                                  customInputId:
                                    type: string
                                    minLength: 1
                                  equals:
                                    type: string
                                  mode:
                                    type: string
                                    enum:
                                      - SHOW_WHEN
                                      - HIDE_WHEN
                                required:
                                  - customInputId
                                  - 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:
                                  customInputId:
                                    type: string
                                    minLength: 1
                                  equals:
                                    type: string
                                  mode:
                                    type: string
                                    enum:
                                      - SHOW_WHEN
                                      - HIDE_WHEN
                                required:
                                  - customInputId
                                  - 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: 0
                                      maximum: 9007199254740991
                                    rect:
                                      type: object
                                      properties:
                                        x:
                                          type: number
                                        'y':
                                          type: number
                                        width:
                                          type: number
                                        height:
                                          type: number
                                      required:
                                        - x
                                        - 'y'
                                        - width
                                        - height
                                      additionalProperties: false
                                    pageWidth:
                                      type: number
                                      exclusiveMinimum: true
                                      minimum: 0
                                    pageHeight:
                                      type: number
                                      exclusiveMinimum: true
                                      minimum: 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
                                  required:
                                    - name
                                    - type
                                    - page
                                    - rect
                                    - pageWidth
                                    - pageHeight
                                  additionalProperties: false
                              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: 0
                                          maximum: 9007199254740991
                                        rect:
                                          type: object
                                          properties:
                                            x:
                                              type: number
                                            'y':
                                              type: number
                                            width:
                                              type: number
                                              exclusiveMinimum: true
                                              minimum: 0
                                            height:
                                              type: number
                                              exclusiveMinimum: true
                                              minimum: 0
                                          required:
                                            - x
                                            - 'y'
                                            - width
                                            - height
                                          additionalProperties: false
                                        pageWidth:
                                          description: >-
                                            Width of the page in PDF points, the
                                            unit `rect` is measured in. Omit to use
                                            the width of the PDF page.
                                          type: number
                                          exclusiveMinimum: true
                                          minimum: 0
                                        pageHeight:
                                          description: >-
                                            Height of the page in PDF points. Omit
                                            to use the height of the PDF page.
                                          type: number
                                          exclusiveMinimum: true
                                          minimum: 0
                                        pageRotation:
                                          description: >-
                                            Rotation of the page in degrees. Omit to
                                            use the rotation of the PDF page.
                                          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
                                        signerId:
                                          type: string
                                        variableId:
                                          type: string
                                        required:
                                          type: boolean
                                        options:
                                          type: array
                                          items:
                                            type: string
                                        multiline:
                                          type: boolean
                                      required:
                                        - id
                                        - page
                                        - rect
                                        - kind
                                        - inputType
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        id:
                                          type: string
                                          minLength: 1
                                        page:
                                          type: integer
                                          minimum: 0
                                          maximum: 9007199254740991
                                        rect:
                                          type: object
                                          properties:
                                            x:
                                              type: number
                                            'y':
                                              type: number
                                            width:
                                              type: number
                                              exclusiveMinimum: true
                                              minimum: 0
                                            height:
                                              type: number
                                              exclusiveMinimum: true
                                              minimum: 0
                                          required:
                                            - x
                                            - 'y'
                                            - width
                                            - height
                                          additionalProperties: false
                                        pageWidth:
                                          description: >-
                                            Width of the page in PDF points, the
                                            unit `rect` is measured in. Omit to use
                                            the width of the PDF page.
                                          type: number
                                          exclusiveMinimum: true
                                          minimum: 0
                                        pageHeight:
                                          description: >-
                                            Height of the page in PDF points. Omit
                                            to use the height of the PDF page.
                                          type: number
                                          exclusiveMinimum: true
                                          minimum: 0
                                        pageRotation:
                                          description: >-
                                            Rotation of the page in degrees. Omit to
                                            use the rotation of the PDF page.
                                          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
                                        - kind
                                      additionalProperties: false
                                  description: A box placed on a page of a PDF field
                              locked:
                                type: boolean
                              visibilityRule:
                                type: object
                                properties:
                                  customInputId:
                                    type: string
                                    minLength: 1
                                  equals:
                                    type: string
                                  mode:
                                    type: string
                                    enum:
                                      - SHOW_WHEN
                                      - HIDE_WHEN
                                required:
                                  - customInputId
                                  - 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: true
                                      maximum: 9007199254740991
                                      minimum: 0
                                    fieldMeta:
                                      oneOf:
                                        - type: object
                                          properties:
                                            label:
                                              type: string
                                            placeholder:
                                              type: string
                                            description:
                                              type: string
                                            signerId:
                                              type: string
                                              nullable: true
                                            required:
                                              type: boolean
                                            type:
                                              type: string
                                              enum:
                                                - input
                                            value:
                                              type: string
                                          required:
                                            - type
                                          additionalProperties: false
                                        - type: object
                                          properties:
                                            label:
                                              type: string
                                            placeholder:
                                              type: string
                                            description:
                                              type: string
                                            signerId:
                                              type: string
                                              nullable: true
                                            required:
                                              type: boolean
                                            type:
                                              type: string
                                              enum:
                                                - text
                                            value:
                                              type: string
                                            rows:
                                              type: integer
                                              minimum: 2
                                              maximum: 20
                                          required:
                                            - type
                                          additionalProperties: false
                                        - type: object
                                          properties:
                                            label:
                                              type: string
                                            placeholder:
                                              type: string
                                            description:
                                              type: string
                                            signerId:
                                              type: string
                                              nullable: true
                                            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
                                            signerId:
                                              type: string
                                              nullable: true
                                            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
                                            signerId:
                                              type: string
                                              nullable: true
                                            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
                                            signerId:
                                              type: string
                                              nullable: true
                                            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
                                            signerId:
                                              type: string
                                              nullable: true
                                            required:
                                              type: boolean
                                            type:
                                              type: string
                                              enum:
                                                - number
                                            value:
                                              type: string
                                          required:
                                            - type
                                          additionalProperties: false
                                        - type: object
                                          properties:
                                            label:
                                              type: string
                                            placeholder:
                                              type: string
                                            description:
                                              type: string
                                            signerId:
                                              type: string
                                              nullable: true
                                            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:
                                                s3Key:
                                                  type: string
                                                fileName:
                                                  type: string
                                                mimeType:
                                                  type: string
                                                size:
                                                  type: number
                                                sha256:
                                                  type: string
                                                storageProviderId:
                                                  type: string
                                                  nullable: true
                                              required:
                                                - s3Key
                                                - fileName
                                                - mimeType
                                                - size
                                                - sha256
                                              additionalProperties: false
                                          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:
                                  customInputId:
                                    type: string
                                    minLength: 1
                                  equals:
                                    type: string
                                  mode:
                                    type: string
                                    enum:
                                      - SHOW_WHEN
                                      - HIDE_WHEN
                                required:
                                  - customInputId
                                  - 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: {}
                                    settings:
                                      type: object
                                      properties:
                                        decimalPlaces:
                                          type: number
                                        oneTimePayment:
                                          type: boolean
                                        pricePrefix:
                                          type: string
                                        priceSuffix:
                                          type: string
                                        defaultMomsRate:
                                          type: number
                                        showMomsBreakdown:
                                          type: boolean
                                        pricesIncludeMoms:
                                          type: boolean
                                      additionalProperties: false
                                  required:
                                    - name
                                    - originalName
                                    - enabled
                                    - key
                                    - settings
                                  additionalProperties: false
                              summaryLabels:
                                type: object
                                properties:
                                  subtotal:
                                    type: string
                                  moms:
                                    type: string
                                  total:
                                    type: string
                                  payable:
                                    type: string
                                required:
                                  - subtotal
                                  - moms
                                  - total
                                additionalProperties: false
                              allowSelection:
                                type: boolean
                              selectionSignerId:
                                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
                              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:
                                  pricesIncludeMoms:
                                    type: boolean
                                  defaultMomsRate:
                                    type: number
                                  showMomsBreakdown:
                                    type: boolean
                                additionalProperties: false
                              style:
                                type: object
                                properties:
                                  border:
                                    type: boolean
                                  rounded:
                                    type: boolean
                                additionalProperties: false
                              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:
                                      type: number
                                    unit:
                                      type: string
                                    quantity:
                                      type: number
                                    moms:
                                      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:
                                  customInputId:
                                    type: string
                                    minLength: 1
                                  equals:
                                    type: string
                                  mode:
                                    type: string
                                    enum:
                                      - SHOW_WHEN
                                      - HIDE_WHEN
                                required:
                                  - customInputId
                                  - 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:
                                  customInputId:
                                    type: string
                                    minLength: 1
                                  equals:
                                    type: string
                                  mode:
                                    type: string
                                    enum:
                                      - SHOW_WHEN
                                      - HIDE_WHEN
                                required:
                                  - customInputId
                                  - 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: true
                                    maximum: 9007199254740991
                                    minimum: 0
                                  unit:
                                    type: string
                                    enum:
                                      - day
                                      - week
                                      - month
                                      - year
                                required:
                                  - value
                                  - unit
                                additionalProperties: false
                              noticePeriod:
                                type: object
                                properties:
                                  value:
                                    type: integer
                                    exclusiveMinimum: true
                                    maximum: 9007199254740991
                                    minimum: 0
                                  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
                    required:
                      - type
                      - position
                      - fieldMeta
                    additionalProperties: false
      responses:
        '400':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing what went wrong
                  code:
                    description: Machine-readable error code (e.g. APPROVAL_REQUIRED)
                    type: string
                  errorId:
                    description: >-
                      Identifier for this occurrence — quote it to support when
                      reporting a 500
                    type: string
                  issues:
                    description: Every validation issue, on a 400 for an invalid request
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: >-
                            Dotted path to the invalid value, e.g.
                            `signers.0.email`; empty for the root
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: false
                  requiredScopes:
                    description: >-
                      OAuth scopes the endpoint requires, on a 403 for a missing
                      scope
                    type: array
                    items:
                      type: string
                  grantedScopes:
                    description: >-
                      OAuth scopes the token was granted, on a 403 for a missing
                      scope
                    type: array
                    items:
                      type: string
                required:
                  - message
                additionalProperties: false
                description: Error response
        '401':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing what went wrong
                  code:
                    description: Machine-readable error code (e.g. APPROVAL_REQUIRED)
                    type: string
                  errorId:
                    description: >-
                      Identifier for this occurrence — quote it to support when
                      reporting a 500
                    type: string
                  issues:
                    description: Every validation issue, on a 400 for an invalid request
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: >-
                            Dotted path to the invalid value, e.g.
                            `signers.0.email`; empty for the root
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: false
                  requiredScopes:
                    description: >-
                      OAuth scopes the endpoint requires, on a 403 for a missing
                      scope
                    type: array
                    items:
                      type: string
                  grantedScopes:
                    description: >-
                      OAuth scopes the token was granted, on a 403 for a missing
                      scope
                    type: array
                    items:
                      type: string
                required:
                  - message
                additionalProperties: false
                description: Error response
        '404':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing what went wrong
                  code:
                    description: Machine-readable error code (e.g. APPROVAL_REQUIRED)
                    type: string
                  errorId:
                    description: >-
                      Identifier for this occurrence — quote it to support when
                      reporting a 500
                    type: string
                  issues:
                    description: Every validation issue, on a 400 for an invalid request
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: >-
                            Dotted path to the invalid value, e.g.
                            `signers.0.email`; empty for the root
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: false
                  requiredScopes:
                    description: >-
                      OAuth scopes the endpoint requires, on a 403 for a missing
                      scope
                    type: array
                    items:
                      type: string
                  grantedScopes:
                    description: >-
                      OAuth scopes the token was granted, on a 403 for a missing
                      scope
                    type: array
                    items:
                      type: string
                required:
                  - message
                additionalProperties: false
                description: Error response
      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: >-
              Läsa din profilinformation, inklusive namn, telefonnummer och
              e-postadress
            documents:read: Tillgång till att läsa dina dokument
            documents:write: >-
              Tillgång till att skapa nya dokument och redigera dokument som du
              har skapat
            documents:delete: >-
              Tillgång till att ta bort dokument och tillhörande filer, mappar,
              datafält och kommentarer
            forms:read: Tillgång till att läsa formulär och inställningar
            forms:write: Tillgång till att skapa, redigera och publicera formulär
            forms:delete: Tillgång till att ta bort formulär och svar permanent
            forms:submissions:read: >-
              Tillgång till att läsa formulärsvar och respondenternas
              kontaktuppgifter
            templates:read: Tillgång till att läsa dina mallar
            templates:write: Tillgång till att skapa och redigera mallar
            contacts:read: Tillgång till att läsa dina kontakter
            contacts:write: Tillgång till att skapa och redigera dina kontakter
            contacts:delete: Tillgång till att ta bort dina kontakter
            organization:read: Tillgång till att läsa information om din organisation
            audit:read: Tillgång till att läsa dokumentaktivitet och händelseloggar
            signatures:read: >-
              Tillgång till att läsa vilken identitet e-legitimationen
              verifierade vid signering, inklusive personnummer
            sajnid:read: Tillgång till att läsa sajn-id-verifieringar
            sajnid:write: Tillgång till att skapa sajn-id-verifieringar
            login:read: Tillgång till att läsa resultatet av inloggningar via sajn Login
            login:write: Tillgång till att starta inloggningar via sajn Login
            webhooks:read: Tillgång till att läsa webhooks och deras leveranser
            webhooks:write: Tillgång till att skapa, redigera och ta bort webhooks
            actions:read: Tillgång till att läsa föreslagna åtgärder och vad de skulle göra
            actions:write: >-
              Tillgång till att godkänna, avfärda och skjuta upp föreslagna
              åtgärder — ett godkännande kan skicka påminnelser till motparter,
              säga upp avtal och skapa bevakningar
            members:read: Tillgång till att läsa arbetsytans medlemmar
            members:write: Tillgång till att bjuda in och hantera medlemmar
            roles:read: Tillgång till att läsa arbetsytans roller och behörigheter
            roles:write: Tillgång till att skapa, redigera och ta bort arbetsytans roller

````

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