{
  "info": {
    "_postman_id": "920db615-c30a-5588-92e1-ad08556e4e8c",
    "name": "sajn API Reference",
    "description": "Every sajn API endpoint, generated from the OpenAPI specification and grouped like the API reference.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Login",
      "item": [
        {
          "name": "Start a sajn Login session",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/login/sessions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "login",
                "sessions"
              ]
            },
            "description": "Create a hosted login session and get a URL to send the user to.\n\nUse this when you don't want to run an OIDC client \u2014 typically a native app that opens `loginUrl` in an in-app browser.\n\n**Flow:**\n1. `POST` here to get `loginUrl`\n2. Open it; the user authenticates with BankID on sajn's hosted page\n3. We redirect to your `redirectUri` with `?sessionId=\u2026` (and `?state=\u2026` if you sent one)\n4. `GET /api/v1/login/sessions/{id}` **from your server** to read the result\n\n**The redirect is only a handle.** Never trust it as proof of authentication \u2014 anyone can craft that URL. The server-side `GET` is the authoritative read, because it is authenticated as your organization.\n\n`redirectUri` must be registered on the client. Custom schemes (`myapp://auth`) are supported so the in-app browser can dismiss straight back into your app.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"clientId\": \"cm4k2x9p10039abcd1234efgh\",\n  \"redirectUri\": \"https://example.com/auth/callback\",\n  \"state\": \"f9a1c2e3\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Read the result of a sajn Login session",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/login/sessions/{{sessionId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "login",
                "sessions",
                "{{sessionId}}"
              ]
            },
            "description": "Authoritative read of a login session. Call this from your server after the redirect.\n\n`claims` and `sub` are populated only once `status` is `COMPLETED`, and contain exactly the fields your client is approved for \u2014 the same projection the OIDC `id_token` uses.\n\n`sub` is stable per person **per organization**: the same individual logging into any of your clients always yields the same `sub`, and it can never be correlated with their identifier at another sajn customer."
          },
          "response": []
        },
        {
          "name": "Start an eID attempt in your own UI",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/login/sessions/{{sessionId}}/start",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "login",
                "sessions",
                "{{sessionId}}",
                "start"
              ]
            },
            "description": "Authenticate the user in your own interface instead of sajn's hosted page. You show the QR code and the button that opens the eID app; sajn talks to the eID provider.\n\n**Flow:**\n1. `POST /api/v1/login/sessions` to create the session\n2. `POST` here, from your server, with the user's IP address. Show `qrCode` on desktop, or open `autoStartUrl` from a tap on mobile\n3. `POST /api/v1/login/sessions/{id}/poll` every 1 to 2 seconds and show the new `qrCode`\n4. When `status` is `COMPLETED`, read the result with `GET /api/v1/login/sessions/{id}`\n\nCalling this again while an attempt runs returns that attempt. After a `FAILED` or `EXPIRED` attempt, calling it starts a new one while `attemptsRemaining` is above 0. The client must use your own BankID certificate.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"method\": \"SE_BANKID\",\n  \"endUserIp\": \"192.0.2.10\",\n  \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15\",\n  \"returnUrl\": \"https://example.com/logga-in\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Poll an eID attempt",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/login/sessions/{{sessionId}}/poll",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "login",
                "sessions",
                "{{sessionId}}",
                "poll"
              ]
            },
            "description": "Check the current attempt with the eID provider and get the next QR code. Poll every 1 to 2 seconds while `status` is `PENDING`. The login completes even if you stop polling, and `login.completed` fires.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Cancel an eID attempt",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/login/sessions/{{sessionId}}/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "login",
                "sessions",
                "{{sessionId}}",
                "cancel"
              ]
            },
            "description": "Cancel the current attempt, for example when the user presses Cancel. The session stays open, so the user can start a new attempt. If the user finished in the eID app just before, `status` is `COMPLETED`.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "System",
      "item": [
        {
          "name": "Health check",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/health",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "health"
              ]
            },
            "description": "Check API health status and get version information. This endpoint does not require authentication.",
            "auth": {
              "type": "noauth"
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Account",
      "item": [
        {
          "name": "Get authenticated user + workspace context",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "me"
              ]
            },
            "description": "Returns the authenticated user, the workspace the request acts in (the `Sajn-Workspace` header, or the token's default workspace), and the parent organization. Used by Zapier and other integrations to verify the connection and label it for users."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Organization",
      "item": [
        {
          "name": "Get the authenticated organization",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/organization",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "organization"
              ]
            },
            "description": "Returns metadata for the organization that owns the API token's workspace \u2014 name, address, legal numbers, logo, and branding settings."
          },
          "response": []
        },
        {
          "name": "Get plan limits and usage",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/limits",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "limits"
              ]
            },
            "description": "Returns the organization's plan, its quotas, what it used this billing month, and what remains: documents, eID signatures per scheme (`signatures`, keyed by a scheme such as `SE_BANKID`), members, the AI budget, identity checks, and workspaces. An unlimited quota is `null`. Money is `{ amount, currency }` in minor units: `balance` is in the organization's currency, and the AI budget is in `SEK`. Use it to gate features, such as checking how many BankID signatures remain before you send."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Workspaces",
      "item": [
        {
          "name": "List accessible workspaces",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/workspaces",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "workspaces"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                }
              ]
            },
            "description": "Returns the workspaces in the authenticated user's organization that they are a member of. The workspace the request acts in is marked with `isCurrent: true`; send another workspace's ID in the `Sajn-Workspace` header to act there."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Members",
      "item": [
        {
          "name": "List workspace members",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/members",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "members"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "ACTIVE",
                  "description": "Filter by activity. A member is `ACTIVE` once they have signed in at least once. Omit for both.",
                  "disabled": true
                },
                {
                  "key": "roleId",
                  "value": "",
                  "description": "Only return members with one of these workspace roles. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "permission",
                  "value": "READ_DOCUMENT",
                  "description": "Only return members whose role grants this permission, directly or through `ADMINISTRATOR`. For example, `APPROVE_DOCUMENT` lists the members who can approve documents.",
                  "disabled": true
                },
                {
                  "key": "query",
                  "value": "",
                  "description": "Free-text search across member name and email",
                  "disabled": true
                },
                {
                  "key": "orderBy",
                  "value": "joinedAt",
                  "description": "The field to sort by. Default: `joinedAt`.",
                  "disabled": true
                },
                {
                  "key": "orderDirection",
                  "value": "desc",
                  "description": "The sort direction. Default: `desc`.",
                  "disabled": true
                }
              ]
            },
            "description": "Returns the members of the workspace bound to the current API token, paginated and filterable by activity, role, permission and free-text search. To list the members who can approve documents, pass `permission=APPROVE_DOCUMENT`. Address an individual member by their `id`, which is their user ID.\n\n**Permission required:** `MANAGE_WORKSPACE_MEMBERS` on the workspace."
          },
          "response": []
        },
        {
          "name": "Add a member to the workspace",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/members",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "members"
              ]
            },
            "description": "Adds a member of the organization to this workspace with the role `roleId`, and returns the new member. To list roles, call `GET /api/v1/roles`.\n\nIf the email address is on a domain that your organization manages through SSO, and no account has it yet, the request creates the account, makes it a member of the organization and this workspace, and returns it. The person signs in through SSO, so there's no invitation to accept.\n\nOtherwise, if no member of the organization has the email address, the request returns `404`. To invite someone who isn't a member of the organization yet, call `POST /api/v1/member-invites`.\n\n**Permission required:** `MANAGE_WORKSPACE_MEMBERS` on the workspace.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"robin@example.com\",\n  \"roleId\": \"cm4k2x9p10026abcd1234efgh\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a workspace member",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/members/{{userId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "members",
                "{{userId}}"
              ]
            },
            "description": "Get a single workspace member by their user ID.\n\n**Permission required:** `MANAGE_WORKSPACE_MEMBERS` on the workspace."
          },
          "response": []
        },
        {
          "name": "Update a workspace member's role",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/members/{{userId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "members",
                "{{userId}}"
              ]
            },
            "description": "Assigns a workspace member a different role. `roleId` must reference a role on this workspace. To list roles, call `GET /api/v1/roles`.\n\n**Permission required:** `MANAGE_WORKSPACE_MEMBERS` on the workspace.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"roleId\": \"cm4k2x9p10026abcd1234efgh\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Remove a member from the workspace",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/members/{{userId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "members",
                "{{userId}}"
              ]
            },
            "description": "Remove a member from the workspace. This revokes their access to this workspace only \u2014 it does not remove them from the organization. You cannot remove yourself.\n\n**Permission required:** `MANAGE_WORKSPACE_MEMBERS` on the workspace."
          },
          "response": []
        },
        {
          "name": "List pending workspace invitations",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/member-invites",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "member-invites"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                }
              ]
            },
            "description": "Returns the pending invitations for this workspace.\n\n**Permission required:** `MANAGE_WORKSPACE_MEMBERS` on the workspace."
          },
          "response": []
        },
        {
          "name": "Invite someone to the workspace",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/member-invites",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "member-invites"
              ]
            },
            "description": "Invites someone who isn't a member of the organization to join it and this workspace with the role `roleId`, and emails them the invitation. The invitation expires after two days; to send it again, call `POST /api/v1/member-invites/{id}/resend`. When they accept, they become a member of the workspace.\n\nTo add someone who is already a member of the organization, or whose email address is on a domain that your organization manages through SSO, call `POST /api/v1/members`. If the email address already has a pending invitation, the request returns `409 ALREADY_EXISTS`, and if it's on an SSO-managed domain, `409 INVALID_STATE`.\n\n**Permission required:** `MANAGE_WORKSPACE_MEMBERS` on the workspace.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"robin@example.com\",\n  \"roleId\": \"cm4k2x9p10026abcd1234efgh\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Resend a workspace invitation",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/member-invites/{{memberInviteId}}/resend",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "member-invites",
                "{{memberInviteId}}",
                "resend"
              ]
            },
            "description": "Sends the invitation email again, extends the expiry, and returns the invitation.\n\n**Permission required:** `MANAGE_WORKSPACE_MEMBERS` on the workspace.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Revoke a workspace invitation",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/member-invites/{{memberInviteId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "member-invites",
                "{{memberInviteId}}"
              ]
            },
            "description": "Cancel a pending invitation before it is accepted.\n\n**Permission required:** `MANAGE_WORKSPACE_MEMBERS` on the workspace."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Roles and permissions",
      "item": [
        {
          "name": "List roles",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/roles",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "roles"
              ]
            },
            "description": "Lists the roles of the workspace bound to the current API token, with the permission keys each role grants and how many members hold it. Pass a role's `id` as `roleId` when you add or update a member or create an invitation; role names can change.\n\n**Permission required:** `MANAGE_WORKSPACE_ROLES` on the workspace."
          },
          "response": []
        },
        {
          "name": "Create a role",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/roles",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "roles"
              ]
            },
            "description": "Creates a custom role with a set of permission keys. To list valid keys, call `GET /api/v1/permissions`. To grant `ADMINISTRATOR`, you must hold it yourself.\n\n**Permission required:** `MANAGE_WORKSPACE_ROLES` on the workspace.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Rekryterare\",\n  \"permissions\": [\n    \"READ_DOCUMENT\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a role",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/roles/{{roleId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "roles",
                "{{roleId}}"
              ]
            },
            "description": "Gets a role, with its permission keys and member count.\n\n**Permission required:** `MANAGE_WORKSPACE_ROLES` on the workspace."
          },
          "response": []
        },
        {
          "name": "Update a role",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/roles/{{roleId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "roles",
                "{{roleId}}"
              ]
            },
            "description": "Renames a role, replaces its permissions, or both. You can't edit a built-in role. To grant `ADMINISTRATOR`, you must hold it yourself.\n\n**Permission required:** `MANAGE_WORKSPACE_ROLES` on the workspace.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Rekryterare\",\n  \"permissions\": [\n    \"READ_DOCUMENT\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a role",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/roles/{{roleId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "roles",
                "{{roleId}}"
              ]
            },
            "description": "Deletes a custom role. You can't delete a built-in role, or a role that members still hold; assign those members another role first.\n\n**Permission required:** `MANAGE_WORKSPACE_ROLES` on the workspace."
          },
          "response": []
        },
        {
          "name": "List permissions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/permissions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "permissions"
              ]
            },
            "description": "Lists every permission key you can grant to a role, with a label. Use the keys when you create or update a role.\n\n**Permission required:** `MANAGE_WORKSPACE_ROLES` on the workspace."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Documents",
      "item": [
        {
          "name": "List all documents",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "DRAFT",
                  "description": "Filter by document status. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "tagId",
                  "value": "",
                  "description": "Filter by one or more tag IDs. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "folderId",
                  "value": "",
                  "description": "Filter by folder ID. Pass `root` to include only top-level documents.",
                  "disabled": true
                },
                {
                  "key": "templateId",
                  "value": "",
                  "description": "Filter by the IDs of the templates the documents were created from. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "bundleId",
                  "value": "",
                  "description": "Returns only the documents in this bundle. `folderId` is ignored with it.",
                  "disabled": true
                },
                {
                  "key": "externalId",
                  "value": "",
                  "description": "Returns only the document whose `externalId` equals this value exactly. For partial matches, use `query`.",
                  "disabled": true
                },
                {
                  "key": "responsibleUserId",
                  "value": "",
                  "description": "Filter by responsible user IDs. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only documents created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only documents created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only documents updated at or after this ISO 8601 date or date-time. Use this for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only documents updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "completedAfter",
                  "value": "",
                  "description": "Only documents completed at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "completedBefore",
                  "value": "",
                  "description": "Only documents completed at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "query",
                  "value": "",
                  "description": "Free-text search across name, externalId, signer name, and signer email",
                  "disabled": true
                },
                {
                  "key": "archived",
                  "value": "true",
                  "description": "If `true`, returns only archived documents. If `false`, returns only documents that aren't archived. Default: `false`.",
                  "disabled": true
                },
                {
                  "key": "orderBy",
                  "value": "createdAt",
                  "description": "The field to sort by. Default: `createdAt`.",
                  "disabled": true
                },
                {
                  "key": "orderDirection",
                  "value": "desc",
                  "description": "The sort direction. Default: `desc`.",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve a paginated list of all documents in your workspace.\n\nDocuments can be filtered and sorted. The response includes basic document information and metadata. Use the 'getDocument' endpoint to retrieve full document details including parties and fields.\n\n**Pagination:** Pass `nextCursor` from the previous response as `cursor` until `hasMore` is false. Pages are keyset-based on every `orderBy`, so they stay stable while documents change. Documents without a `completedAt` or `expiresAt` come last when you sort by that field.\n\n**Incremental sync:** Filter with `updatedAfter` set to the newest `updatedAt` you have stored, sort by `updatedAt` ascending, and follow the cursor until `hasMore` is false."
          },
          "response": []
        },
        {
          "name": "Create a new document",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents"
              ]
            },
            "description": "Create a new document in DRAFT status. You can optionally include parties, metadata, and responsible user during creation.\n\n**Document Types:**\n- `SIGNABLE` (default) - Standard signing document\n- `ACCEPTABLE` - Document that requires acceptance rather than signature\n- `ARCHIVE_IMPORTED` - Imported from external archive\n\n**Template Support:** Use `templateId` to create a document from a template. The template's fields and parties are copied. If you also send `parties`, they replace the template's parties, and signature and initials boxes placed on the PDF for the template's parties are removed.\n\n**CRM Link:** Use `integrationLink` to link the document to a CRM record (currently HubSpot deals). When the workspace has a field mapping configured for the integration, mapped custom fields and product-table rows are prefilled from the record, and signing status is written back to it. Explicit `customFields` in the request take precedence over prefilled values.\n\n**Responsible User:** Use `responsibleUserId` to assign a specific team member as responsible for the document. Defaults to the creating user if not specified.\n\n**Adding Parties:** Two approaches are supported:\n1. **Contact-based** (recommended): Provide `contactId` to reference existing contacts - automatically inherits all contact details\n2. **Manual**: Provide `name` and `email` to manually specify party details\n\n**Party Examples:**\n```json\n{\n  \"parties\": [\n    {\n      \"contactId\": \"contact-123\",\n      \"role\": \"SIGNER\",\n      \"signingOrder\": 1,\n      \"delivery\": [\"EMAIL\"],\n      \"signatureMethod\": \"SE_BANKID\"\n    },\n    {\n      \"name\": \"John Doe\",\n      \"email\": \"john@example.com\",\n      \"role\": \"SIGNER\",\n      \"signingOrder\": 2,\n      \"delivery\": [\"SMS\"],\n      \"signatureMethod\": \"DRAWING\"\n    }\n  ]\n}\n```\n\n**Per-Party Settings:**\n- `delivery` - How the party gets the invitation: `[\"EMAIL\"]` (default), `[\"SMS\"]`, `[\"IN_APP\"]` to sign in person on your device, or `[]` to send nothing and share the signing URL yourself\n- `signatureMethod` - How the party signs: `DRAWING`, `SE_BANKID` (Swedish BankID), `CLICK_TO_SIGN`, `MANUAL`, or a national eID scheme. eID schemes are switched on market by market, so call `GET /api/v1/helpers/signature-methods` for the set your account can use\n- `signVerification` - Verification the party passes before signing: `PIN`, `SMS`, `EMAIL`, or an eID such as `SE_BANKID`. null (default) means none. Call `GET /api/v1/helpers/two-step-verifications` for the live list\n\n**Complete Workflow with Templates:**\n\n1. **Create a template** in the dashboard, and give each value you fill in a key, such as \"name\" or \"phone\".\n2. **Create, fill in, and send in one request** (this endpoint): send `templateId`, the `parties`, the values in `fieldValues`, and `send: true`. If the template has signature boxes placed for its parties, fill those parties in with `templatePartyId` so the boxes stay. To list a template's keys, create a draft and call `GET /api/v1/documents/{docId}/field-values`.\n3. **Show the document in your app**, if you embed signing: create an embed session with `POST /api/v1/embed-sessions` for the party's ID. Find the party in the response by the `ref` you gave it.\n\nEach party has its own `delivery` and `signatureMethod`. A party with `delivery: []` gets no invitation.\n\n**Example:**\n```json\nPOST /api/v1/documents\n{\n  \"name\": \"Employment Contract\",\n  \"templateId\": \"template-id-with-form-fields\",\n  \"parties\": [\n    {\n      \"templatePartyId\": \"template-party-id\",\n      \"ref\": \"employee\",\n      \"name\": \"Alex Andersson\",\n      \"email\": \"alex@example.com\",\n      \"role\": \"SIGNER\",\n      \"delivery\": [],\n      \"signatureMethod\": \"SE_BANKID\"\n    }\n  ],\n  \"fieldValues\": [\n    {\"key\": \"name\", \"value\": \"Alex Andersson\"},\n    {\"key\": \"phone\", \"value\": \"+46700000000\"}\n  ],\n  \"send\": true\n}\n```\n\nTo fill in values or add parties after creation, use `PATCH /api/v1/documents/{docId}/field-values` and `POST /api/v1/documents/{docId}/parties`, then send with `POST /api/v1/documents/{docId}/send`.\n\n**Response:** Returns the created document in the same shape as `GET /api/v1/documents/{id}`, without `fields`. Each party carries the `ref` you gave it. To get a party's signing URL, call `GET /api/v1/documents/{id}/parties/{partyId}`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Anst\u00e4llningsavtal \u2013 Kai Lindqvist\",\n  \"type\": \"SIGNABLE\",\n  \"expiresAt\": \"2027-03-31T22:00:00.000Z\",\n  \"documentMeta\": {\n    \"subject\": \"Ditt anst\u00e4llningsavtal fr\u00e5n Exempelbolaget AB\",\n    \"message\": \"Hej Kai! H\u00e4r \u00e4r ditt anst\u00e4llningsavtal.\",\n    \"signingMode\": \"PARALLEL\",\n    \"language\": \"sv\"\n  },\n  \"parties\": [\n    {\n      \"name\": \"Maja Holm\",\n      \"email\": \"maja.holm@example.com\",\n      \"role\": \"SIGNER\",\n      \"company\": {\n        \"name\": \"Exempelbolaget AB\",\n        \"orgNumber\": \"5561234567\",\n        \"role\": \"HR-chef\"\n      },\n      \"country\": \"SE\",\n      \"delivery\": [\n        \"EMAIL\"\n      ],\n      \"signatureMethod\": \"DRAWING\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "var response = {};",
                  "try { response = pm.response.json(); } catch (error) {}",
                  "var save = function (key, value) {",
                  "  if (!value) { return; }",
                  "  pm.collectionVariables.set(key, value);",
                  "  if (pm.environment.name) { pm.environment.set(key, value); }",
                  "};",
                  "save('documentId', response.id);",
                  "save('partyId', response.parties && response.parties[0] && response.parties[0].id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Get a document by ID",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}"
              ],
              "query": [
                {
                  "key": "expand",
                  "value": "content",
                  "description": "Related data to include in the response, comma-separated or repeated. `content` adds the document's content blocks.",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve detailed information about a specific document including all parties, tags, and custom field values.\n\nThe response includes:\n- Document metadata (subject, message, signing order, etc.)\n- All document parties with their status\n- Applied tags\n- Custom field values\n- Product tables with their resolved totals\n- Document timestamps (created, updated, completed, archived)\n\n**Content blocks:** `content` is null unless you pass `expand=content`. To poll a document's status, leave it out. To read the content, pass `expand=content` or call `GET /api/v1/documents/{id}/content`."
          },
          "response": []
        },
        {
          "name": "Update a document",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}"
              ]
            },
            "description": "Update document properties. A DRAFT document accepts every field. After sending, what you can change depends on the field, and a locked field returns `409 INVALID_STATE` with the reason.\n\n**Updatable Fields:**\n- `name` - Document title\n- `externalId` - Your external reference ID\n- `expiresAt` - Document expiration date\n- `responsibleUserId` - User ID of responsible team member (must be in your organization)\n- `documentMeta` - Metadata, such as the subject, the message, and the signing mode\n- `customFields` - Custom field values\n\n**Per-party settings:** Delivery method and signature type are set per party through the parties endpoints, not at the document level.\n\n**After sending:**\n- `name`, `externalId`, `responsibleUserId`, `value` and `documentCategoryId` can always change.\n- Reminders, subject, message, redirect, chat, delegation, internal recipients and `signableAfterExpired` can change until the document is completed, cancelled or rejected.\n- `expiresAt` moves the deadline (at least 24 hours ahead) and notifies the parties, like `POST /api/v1/documents/{id}/extend-expiration`.\n- `openVerification`, `forceReadFullDocument` and `language` can change until someone has signed.\n- `signingMode`, `nationalIdDisplayMode`, `sameDeviceSigning` and `documentStyle` can't change; withdraw the document first.\n\n**Response:** Returns the updated document in the same shape as `GET /api/v1/documents/{id}`, without `fields`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"expiresAt\": \"2026-11-15T22:00:00.000Z\",\n  \"documentMeta\": {\n    \"message\": \"Hej Kai! H\u00e4r \u00e4r ditt anst\u00e4llningsavtal med det nya startdatumet.\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a document",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}"
              ]
            },
            "description": "Move a document to the trash. It is marked as deleted but not yet removed \u2014 restore it, or let the workspace's trash window purge it.\n\nWorks for every status, including `COMPLETED`. You are the controller of your data; deciding when a signed agreement goes is your call.\n\n**Response:** Returns the document in the same shape as `GET /api/v1/documents/{id}`, without `fields`, with `deletedAt` set. The list and `GET /api/v1/documents/{id}` don't return a document in the trash.\n\n**To remove a document immediately and irreversibly**, use `POST /api/v1/documents/{id}/purge`."
          },
          "response": []
        },
        {
          "name": "Check whether a document is ready to send",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/readiness",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "readiness"
              ]
            },
            "description": "Runs the checks `POST /api/v1/documents/{id}/send` runs before it sends, without sending. `ready` is true when no `BLOCKER` remains. Each issue has a `code`, such as `MISSING_EMAIL` or `NO_EXPIRATION`, an English `message`, and a Swedish `userMessage` that names the party or field.\n\nWhen a send fails the same checks, it returns an HTTP `409 Conflict` status code with code `DOCUMENT_NOT_READY` and this list in `readiness`."
          },
          "response": []
        },
        {
          "name": "Send document for signing",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "send"
              ]
            },
            "description": "Send a document to signers for signing.\n\n**Request Body:**\n- `customMessage` (optional) - Custom message to include in the signing invitation emails/SMS. Supports newline characters (`\\n`) for line breaks. Available template variables (use `{{variableName}}` syntax): `{{firstName}}`, `{{lastName}}`, `{{fullName}}`, `{{recipientFirstName}}`, `{{recipientLastName}}`, `{{recipientFullName}}`, `{{recipientEmail}}`, `{{recipientPhone}}`, `{{recipientCompanyName}}`, `{{recipientCompanyRole}}`, `{{recipientCompanyOrgNumber}}`, `{{recipientRole}}`, `{{senderFirstName}}`, `{{senderLastName}}`, `{{senderFullName}}`, `{{senderEmail}}`, `{{senderCompanyName}}`, `{{documentName}}`, `{{documentId}}`, `{{documentValue}}`, `{{documentCreatedDate}}`, `{{expirationDate}}`, `{{signUrl}}`. Custom fields are available as `{{custom.<field-slug>}}` using the slugified field name (e.g. \"Avtalsdatum (demo)\" becomes `{{custom.avtalsdatum-demo}}`); secured fields are excluded.\n\n**Prerequisites:**\n- Document must have at least one signer added via `POST /documents/{id}/parties` or when creating the document\n- Each signer's delivery method (`EMAIL`, `SMS`, or `NONE`) and signature type (`DRAWING`, `SE_BANKID`, `CLICK_TO_SIGN`) are configured per-signer when adding them\n\n**Responses:**\n- **200** - The document is sent. Returns the document in the same shape as `GET /api/v1/documents/{id}`, without `fields`.\n- **409** with `code: \"APPROVAL_REQUIRED\"` - You lack the `SEND_WITHOUT_APPROVAL` permission, so the document needs an approval first. Request one with `POST /api/v1/approval-requests`; the document is sent when it's approved.\n- **409** with `code: \"INVALID_STATE\"` - The document isn't a draft, or its approval request is still pending.\n\n**Approved documents:** A document whose approval request is `APPROVED` but that wasn't sent automatically (`autoSend` false) stays `PENDING_APPROVAL`. The user who requested the approval sends it with this endpoint, and the invitation uses the message stored on the approval request.\n\n**What happens when you send:**\n1. Document status changes from `DRAFT` to `PENDING`\n2. sajn sends each party an invitation through the channels in its `delivery`\n3. A party with `delivery: []` gets no invitation, so share its signing URL yourself",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"customMessage\": \"Hej! H\u00e4r \u00e4r anst\u00e4llningsavtalet. L\u00e4s igenom det och signera.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Withdraw a sent document",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/withdraw",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "withdraw"
              ]
            },
            "description": "Withdraw (cancel) a document that has been sent out for signing. The document is returned to `DRAFT` status and signers are notified.\n\n**Status Requirements:**\n- Document must be in `PENDING` status; any other status returns `409 INVALID_STATE`. Use `DELETE /api/v1/documents/{id}` for documents in `DRAFT`, and `POST /api/v1/approval-requests/{id}/cancel` for `PENDING_APPROVAL`.\n\n**Permissions:**\n- Requires the `WITHDRAW_DOCUMENT` workspace permission.\n\n**Request Body:**\n- `reason` (optional) - Free-text reason. Included in withdrawal emails to signers and stored on the audit log.\n\n**What happens when you withdraw:**\n1. Document status is set back to `DRAFT`\n2. Any existing signatures and signer verifications are removed\n3. Each signer's signing/sending/read status is reset\n4. Pending signing reminders are cancelled\n5. A withdrawal email is sent to every signer that had been notified\n6. The `document.withdrawn` webhook is triggered\n\n**Response:** Returns the document in the same shape as `GET /api/v1/documents/{id}`, without `fields`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reason\": \"Fel startdatum i avtalet.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Complete a document before every party has signed",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/complete",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "complete"
              ]
            },
            "description": "Complete a sent document now and seal it with the signatures it has. Use it when a party will never sign and the signatures already collected are enough. It can't be undone.\n\n**Status Requirements:**\n- Document must be in `PENDING` or `EXPIRED` status, and at least one party must have signed. Otherwise it returns `409 INVALID_STATE`.\n\n**Permissions:**\n- Requires the `FORCE_COMPLETE_DOCUMENT` workspace permission.\n\n**Request Body:**\n- `reason` (optional) - Free-text reason, stored on the audit log.\n\n**What happens when you complete:**\n1. Pending reminders are cancelled\n2. The document is sealed in the background with the signatures it has\n3. Each party that didn't sign is emailed that the document was completed without them\n4. The `document.completed` webhook is triggered once the document is sealed\n\n**Response:** Returns the document in the same shape as `GET /api/v1/documents/{id}`, without `fields`. Sealing runs in the background, so the status is still `PENDING` or `EXPIRED` until `document.completed` arrives.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reason\": \"Motparten har l\u00e4mnat bolaget.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Change a sent document's expiration date",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/extend-expiration",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "extend-expiration"
              ]
            },
            "description": "Change the expiration date of a document that has already been sent for signing. The new date can be earlier or later than the current one.\n\n**Status Requirements:**\n- Document must be in `PENDING` or `EXPIRED` status. An `EXPIRED` document returns to `PENDING`. A document in any other status returns `409 INVALID_STATE`. For `DRAFT` documents, set `expiresAt` with `PATCH /api/v1/documents/{id}` instead.\n\n**Permissions:**\n- Requires the `EDIT_DOCUMENT` workspace permission.\n\n**Request Body:**\n- `expiresAt` (required) - The new expiration date/time (ISO 8601). Must be at least 24 hours in the future.\n\n**What happens:**\n1. The document's `expiresAt` is updated.\n2. An audit log entry is recorded.\n3. Every recipient that is still notifiable (has an email, notifications enabled, delivery method other than `NONE`, and has not rejected) is emailed that the signing deadline has moved.\n\n**Response:** Returns the document in the same shape as `GET /api/v1/documents/{id}`, without `fields`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"expiresAt\": \"2026-11-15T22:00:00.000Z\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Permanently delete a document",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/purge",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "purge"
              ]
            },
            "description": "Irreversibly delete a document: database rows, uploaded files, the sealed PDF, the signing certificate and the audit trail. There is no undo and no support path to recover it.\n\n**Requirements:**\n- The document must already be in the trash. Call `DELETE /api/v1/documents/{id}` first.\n- Requires the `PERMANENTLY_DELETE_DOCUMENT` workspace permission, which is not part of the default document-permission set.\n- Requires the `documents:delete` scope.\n\n**Completed documents:** allowed, and the verify link printed into the sealed PDF keeps working. It resolves to a record holding the document ID, the sealed PDF's SHA-256 and the deletion date \u2014 and no personal data. A counterparty holding the PDF can still check their copy against that hash; the PAdES signature in their file also validates on its own, without sajn.\n\n**Backups:** the document is gone from the live database immediately. Encrypted database backups roll off within 7 days.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"confirmDocumentId\": \"cm4k2x9p10003abcd1234efgh\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "List document files",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/files",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "files"
              ]
            },
            "description": "Lists the files of a document that are ready to download, each with a pre-signed URL that works for 15 minutes.\n\n- `ORIGINAL`: the unsigned source document, after the document is sent and sajn has generated the PDF. It's ready when `document.sent` fires. For a QES document, and for some documents where a party picks products, sajn generates it after the parties have filled in their fields. A draft has no `ORIGINAL`.\n- `SIGNED`: the signed and sealed copy, after the document is completed and sealed.\n- `JOURNAL`: the signing journal (audit trail), after the document is completed.\n\nA file that isn't ready yet isn't listed. Every URL in the response counts as a download in the document's audit trail."
          },
          "response": []
        },
        {
          "name": "Get a document file",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/files/{{fileType}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "files",
                "{{fileType}}"
              ]
            },
            "description": "Gets one file of a document, `ORIGINAL`, `SIGNED`, or `JOURNAL`, with a pre-signed URL that works for 15 minutes.\n\nA file that isn't ready yet, such as the signed copy of a pending document, returns `409 INVALID_STATE`. To see which files are ready, call `GET /api/v1/documents/{id}/files`."
          },
          "response": []
        },
        {
          "name": "Get document activity log",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/activity",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "activity"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve the activity/audit log for a specific document. Returns all activity events sorted newest-first.\n\n**Response includes:**\n- Event type (e.g., DOCUMENT_CREATED, DOCUMENT_SIGNED, EMAIL_SENT)\n- Timestamp of the event\n- Event-specific data payload\n- Name and email of the person who triggered the event (when available)\n\n**Privacy:** Sensitive fields such as IP address, user agent, and request metadata are not included in the response."
          },
          "response": []
        },
        {
          "name": "Get verified signer identities",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/signatures",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "signatures"
              ]
            },
            "description": "The identity each eID actually verified, per signature \u2014 as opposed to the signer details the sender entered when creating the document.\n\n**Why this is a separate endpoint:** `party.nationalId` is what the sender supplied. It is never overwritten with what the eID returned, so the two can differ, and this is where you read the verified one.\n\n**One shape for every eID.** Keys are always present and null when a scheme issues nothing, so you never branch on provider to find where the identity lives:\n- `identity.nationalId` \u2014 the national identity number, masked per the workspace's national ID display setting. **Null for schemes that issue none:** MitID without CPR scope, MitID Erhverv, and iDIN, which may never expose a BSN.\n- `identity.serialNumber` \u2014 always present. A stable, non-sensitive reference for this person at your organization. Use it to recognise a returning signer without ever handling a national id. Scoped per organization, so the same person yields a different value for a different customer.\n- `identity.match` \u2014 whether the verified identity matched the intended signer. Computed before masking, so it stays meaningful even when `nationalId` is hidden by policy.\n\n`identity` is null for drawn and click-to-sign signatures: nothing verified an identity.\n\n**Permissions:** requires the `READ_DOCUMENT` workspace permission and the `signatures:read` scope. `documents:read` alone never returns a national identity number.\n\n**Auditing:** every call is recorded on the organization audit log \u2014 who read a verified identity and when. The identity values themselves are never logged."
          },
          "response": []
        },
        {
          "name": "List signer delegations for a document",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/delegations",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "delegations"
              ]
            },
            "description": "Returns all delegation events on a document \u2014 when a signer hands off signing to someone else. Useful for compliance and audit integrations."
          },
          "response": []
        },
        {
          "name": "List reminders sent for a document",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/reminders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "reminders"
              ]
            },
            "description": "Returns all reminder events for a document (both manual and automatic), newest-first."
          },
          "response": []
        },
        {
          "name": "Send reminders to one or more signers",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/reminders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "reminders"
              ]
            },
            "description": "Send manual reminders to signers on a PENDING document.\n\nIf `partyIds` is omitted, a reminder is sent to every signer that has not yet signed and is eligible: the document has been sent to them, and they have an address for the channel.\n\n**Channel:** Each reminder goes out on the party's delivery method unless you set `channel` to `EMAIL` or `SMS`. A party without an address for that channel is skipped with reason `MISSING_EMAIL` or `MISSING_PHONE`. SMS reminders are billed like SMS invites.\n\n**Rate limiting:** Each signer can only receive one reminder per 24 hours. Signers that are rate-limited or otherwise not eligible are returned in the response with `status: SKIPPED` and a `reason`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"partyIds\": [\n    \"cm4k2x9p10004abcd1234efgh\"\n  ],\n  \"channel\": \"EMAIL\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "List document links",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/links",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "links"
              ]
            },
            "description": "List a document's links to other documents, in both directions.\n\n**Link types:** AMENDS, REPLACES, RENEWS, RELATES_TO \u2014 the from-document acts on the to-document.\n\n**Direction:** FROM means this document is the acting end of the link; TO means another document links to it.\n\nLinks whose other end you don't have access to are omitted. A trashed target is returned with `target: null`."
          },
          "response": []
        },
        {
          "name": "Link document to another document",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/links",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "links"
              ]
            },
            "description": "Create a link from this document to another document in the same organization.\n\n**Required Fields:**\n- `toDocumentId` - The document to link to\n- `linkType` - AMENDS, REPLACES, RENEWS or RELATES_TO (this document acts on the target)\n\nBoth documents must be accessible to the acting user. RELATES_TO is symmetric \u2014 the same pair can only be related once regardless of direction.\n\n**Response:** Returns the link in the shape of an item from `GET /api/v1/documents/:id/links`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"toDocumentId\": \"cm4k2x9p10022abcd1234efgh\",\n  \"linkType\": \"AMENDS\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Remove a document link",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/links/{{linkId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "links",
                "{{linkId}}"
              ]
            },
            "description": "Remove a link between two documents. Requires edit access to either end of the link.\n\n**Response:** Returns `{ id, deleted: true }`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Document parties",
      "item": [
        {
          "name": "List all parties for a document",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/parties",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "parties"
              ]
            },
            "description": "Retrieve all parties for a document WITHOUT signing URLs.\n\nThis endpoint returns party information for display purposes. Signing URLs are not included for security reasons.\n\nTo get a party's signing URL (which creates an audit log entry), use the GET /documents/:id/parties/:partyId endpoint."
          },
          "response": []
        },
        {
          "name": "Add a party to document",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/parties",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "parties"
              ]
            },
            "description": "Add a party (signer/participant) to a document. The party must reference an existing contact.\n\n**Party Roles:**\n- `SIGNER` - Must sign the document\n- `ORGANIZER` - Document organizer (no signature required)\n- `REVIEWER` - Reviews document (no signature required)\n\n**Per-Party Settings:**\n- `delivery` - How the party gets the invitation: `[\"EMAIL\"]` (default), `[\"SMS\"]`, `[\"IN_APP\"]` to sign in person on your device, or `[]` to send nothing and share the signing URL yourself\n- `signatureMethod` - How the party signs: `DRAWING`, `SE_BANKID` (Swedish BankID), `CLICK_TO_SIGN`, `MANUAL`, or a national eID scheme. eID schemes are switched on market by market, so call `GET /api/v1/helpers/signature-methods` for the set your account can use\n- `signVerification` - Verification the party passes before signing: `PIN`, `SMS`, `EMAIL`, or an eID such as `SE_BANKID`. null (default) means none. Call `GET /api/v1/helpers/two-step-verifications` for the live list\n\n**Signing Order:** For SEQUENTIAL signing, specify the order (1, 2, 3...). For PARALLEL signing, order is ignored.\n\n**Response:** Returns the created party, with its `signingUrl`, in the shape of `GET /api/v1/documents/:id/parties/:partyId`. sajn logs that you read the signing URL in the document's audit trail.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"contactId\": \"{{contactId}}\",\n  \"role\": \"SIGNER\",\n  \"delivery\": [\n    \"EMAIL\"\n  ],\n  \"signatureMethod\": \"DRAWING\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "var response = {};",
                  "try { response = pm.response.json(); } catch (error) {}",
                  "var save = function (key, value) {",
                  "  if (!value) { return; }",
                  "  pm.collectionVariables.set(key, value);",
                  "  if (pm.environment.name) { pm.environment.set(key, value); }",
                  "};",
                  "save('partyId', response.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Get a party with signing URL",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/parties/{{partyId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "parties",
                "{{partyId}}"
              ]
            },
            "description": "Retrieve a specific party including their signing URL.\n\n**Security Note:** This endpoint creates an audit log entry each time a signing URL is accessed. Use this endpoint when you need the signing URL to share with the party.\n\n**Response includes:**\n- Party details (name, email, phone, company info)\n- Signing status (NOT_SIGNED, SIGNED, REJECTED)\n- Read status (NOT_OPENED, OPENED, READ)\n- Complete signing URL with token"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "var response = {};",
                  "try { response = pm.response.json(); } catch (error) {}",
                  "var save = function (key, value) {",
                  "  if (!value) { return; }",
                  "  pm.collectionVariables.set(key, value);",
                  "  if (pm.environment.name) { pm.environment.set(key, value); }",
                  "};",
                  "save('signingUrl', response.signingUrl);"
                ]
              }
            }
          ]
        },
        {
          "name": "Update a party",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/parties/{{partyId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "parties",
                "{{partyId}}"
              ]
            },
            "description": "Update party information. Most fields can only be updated before the document is sent.\n\nAfter the document is sent, you can change only `name`, `email`, and `phone`, and only for a party that hasn't signed. Other parties' signatures stay valid. Replacing an email address or phone number issues a new signing link, so the old link stops working, and a party who already got the invitation through that channel gets it again. Any other property returns `409 INVALID_STATE`.\n\nA field you leave out keeps its value. To clear `phone`, `externalId`, `nationalId`, or a key of `company`, pass `null`.\n\n**Updatable Fields:**\n- `name` - Party's full name\n- `email` - Party's email address\n- `phone` - Party's phone number\n- `company` - The company the party signs for: `id` links a company in your workspace, and `name`, `orgNumber`, and `role` describe it. Pass `company: null` to make the party a private individual.\n- `externalId` - Your external reference ID for the party\n- `nationalId` - National identity number, such as a Swedish personnummer, matched against the eID at signing\n- `role` - Party role (SIGNER, ORGANIZER, REVIEWER)\n- `signingOrder` - Order for sequential signing\n- `delivery` - How the party gets the invitation: `[\"EMAIL\"]`, `[\"SMS\"]`, `[\"IN_APP\"]` to sign in person on your device, or `[]` to send nothing and share the signing URL yourself\n- `signatureMethod` - How the party signs: `DRAWING`, `SE_BANKID` (Swedish BankID), `CLICK_TO_SIGN`, `MANUAL`, or a national eID scheme. eID schemes are switched on market by market, so call `GET /api/v1/helpers/signature-methods` for the set your account can use\n- `signVerification` - Verification the party passes before signing: `PIN`, `SMS`, `EMAIL`, or an eID such as `SE_BANKID`. null means none. Call `GET /api/v1/helpers/two-step-verifications` for the live list\n\n**Restrictions:** Cannot update after party has signed the document.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone\": \"+46701740605\",\n  \"delivery\": [\n    \"SMS\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Remove a party from document",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/parties/{{partyId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "parties",
                "{{partyId}}"
              ]
            },
            "description": "Remove a party from a document. You can remove a party from a `DRAFT` document, or from a `PENDING` document if the party hasn't signed.\n\n**Response:** Returns `{ id, deleted: true }`. To keep the party's details, get the party before you remove it."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Embed sessions",
      "item": [
        {
          "name": "Create an embed session",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/embed-sessions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "embed-sessions"
              ]
            },
            "description": "Start an embedded signing session for one party of a sent document, to show in your own page with the sajn embed SDK.\n\n**Flow:**\n1. `POST` here **from your server** when the party opens your page.\n2. Return `clientSecret` to your page and hand it to the SDK, in `fetchClientSecret`.\n3. The SDK frames `/embed/v2/{id}` and the frame redeems the secret. The party signs in the frame.\n4. Confirm the outcome with the `document.party.signed` webhook. Events in the browser are hints, not proof.\n\nThe session decides what the frame may do: `features`, `appearance` and `origins` can't be changed from the browser. A session lasts at most 24 hours, and ends after an hour without activity. When it ends, the SDK calls `fetchClientSecret` again, so keep that endpoint cheap.\n\nEmbedded signing is turned on per organization by sajn. Each origin must match one of the organization's embed domains. Create sessions with an API key: an OAuth app can't, because a session ends when the key that created it is rotated or deleted.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"signing\",\n  \"documentId\": \"{{documentId}}\",\n  \"partyId\": \"{{partyId}}\",\n  \"origins\": [\n    \"https://app.example.com\"\n  ],\n  \"features\": {\n    \"rejection\": true,\n    \"download\": true\n  },\n  \"appearance\": {\n    \"colors\": {\n      \"primary\": \"#0f766e\",\n      \"primaryForeground\": \"#ffffff\"\n    },\n    \"radius\": 8,\n    \"mode\": \"inline\"\n  },\n  \"locale\": \"sv\",\n  \"externalId\": \"EMP-0142\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Revoke an embed session",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/embed-sessions/{{embedSessionId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "embed-sessions",
                "{{embedSessionId}}"
              ]
            },
            "description": "End an embed session at once. A frame that shows it stops working on its next request. Revoking an API key also revokes every session it created."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Document content",
      "item": [
        {
          "name": "List document content",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/content",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "content"
              ],
              "query": [
                {
                  "key": "key",
                  "value": "",
                  "description": "Returns only the fields that hold a value with one of these keys: a FORM subfield, an AcroForm field, or a box placed on a PDF. Comma-separated or repeated.",
                  "disabled": true
                }
              ]
            },
            "description": "List the content blocks of a document in position order, with full type-specific metadata.\n\nFor `PDF` fields, `fieldMeta.placedFields` holds the boxes placed on the PDF pages (signature and initials marks, signer inputs, fixed text) with their page and coordinates, and `fieldMeta.formFields` holds form fields extracted from the PDF itself. See the field placement guide for the coordinate model.\n\nTo find the field that holds a FORM subfield, an AcroForm field, or a placed box by its key, pass `key`."
          },
          "response": []
        },
        {
          "name": "Create document content",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/content",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "content"
              ]
            },
            "description": "Adds content blocks to a document. Send the blocks in `content`, even when you create one.\n\n**Field Types:**\n- `TEXT` - Rich text content section (Tiptap editor format)\n- `HTML` - Raw HTML content with custom styling (API-only, sanitized for security)\n- `FORM` - Form with input fields for signers\n- `PDF` - PDF file section\n- `PRODUCT_TABLE` - Product/service table with pricing\n- `TABLE` - Simple table with custom rows and columns\n- `SPACER`, `PAGE_BREAK`, `DURATION` - Layout and duration blocks\n\n**Field Position:** The 0-based index of the field among the content blocks. A field sent to a taken index goes there, and the fields from that index on move down by one. A position past the end puts the field last.\n\n**Field Metadata:** Each field type has specific metadata requirements. See schema documentation for details.\n\n**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`, a `page` counted from 1, a `rect` (`x`, `y`, `width`, `height`), and a `kind`. By default, `rect` is in fractions of the page from 0 to 1, measured from its top-left corner, so `{ \"x\": 0.1, \"y\": 0.8, \"width\": 0.3, \"height\": 0.05 }` is a box near the bottom left. To send PDF points from the bottom-left corner instead, set `unit` to `POINTS` and `origin` to `BOTTOM_LEFT`. The server fills `pageWidth`, `pageHeight`, and `pageRotation` from the PDF page when you omit them, and responses always return relative values from the top-left corner. The box kinds are the following:\n- `INPUT` with `inputType` `SIGNATURE` or `INITIALS` and a `partyId`: a mark the party draws at signing, sealed into the PDF at that position.\n- `INPUT` with `inputType` `TEXT`, `DATE`, `CHECKBOX` or `SELECT` and a `partyId`: a value the party fills in before signing. Set `required` to block signing until it is filled.\n- `STATIC` with `content` (HTML): fixed text stamped at that position.\n\nSet `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.\n\nThe following example creates a PDF field with a signature box:\n\n```json\n{\n  \"content\": [\n    {\n      \"type\": \"PDF\",\n      \"position\": 0,\n      \"fieldMeta\": {\n        \"type\": \"PDF\",\n        \"value\": \"f/org_123/abc123def/contract.pdf\",\n        \"placedFields\": [\n          {\n            \"id\": \"sig-1\",\n            \"kind\": \"INPUT\",\n            \"inputType\": \"SIGNATURE\",\n            \"page\": 2,\n            \"rect\": { \"x\": 0.12, \"y\": 0.83, \"width\": 0.34, \"height\": 0.06 },\n            \"partyId\": \"PARTY_ID\",\n            \"required\": true\n          }\n        ]\n      }\n    }\n  ]\n}\n```\n\nThe 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 `partyId` 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 `content.0.fieldMeta.placedFields.2.rect`.\n\nThe response lists the created fields in request order, each in the same shape as `GET /api/v1/documents/{id}/content/{contentId}`. To add, move, or remove single boxes later, use `PATCH /api/v1/documents/{id}/content/{contentId}/placed-fields`.\n\n**Product tables:** a `PRODUCT_TABLE` field's `price` values are decimal amounts in the table's `currency`, such as `1499.5`, not minor units. `vat` is a rate in percent, such as `25`.\n\n**Fields a party fills in:** In `TEXT` or `HTML` content, place a field with a `<sajn-field>` tag, such as `<sajn-field key=\"buyer-phone\" party=\"PARTY_ID\" type=\"TEXT\" label=\"Phone\"></sajn-field>`. `key` names the field, and `party` is the party who fills it in. `type` is `TEXT` (default), `DATE`, or `SELECT` with its choices in `options`, separated by commas. A field is required unless you set `required=\"false\"`, and `value` prefills it. To fill a `TEXT` field from the party's eID verification, set `identity` to `NAME` or `SSN`; the party must open the document through an eID ACCESS gate that returns that value, and they can't change it. Responses return the same tag.\n\n**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.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": [\n    {\n      \"type\": \"TEXT\",\n      \"position\": 0,\n      \"fieldMeta\": {\n        \"type\": \"TEXT\",\n        \"content\": \"<p>Anst\u00e4llningen g\u00e4ller tills vidare fr\u00e5n och med den 1 november 2026, med sex m\u00e5naders provanst\u00e4llning.</p>\",\n        \"locked\": false,\n        \"sectionStyle\": {\n          \"background\": \"NONE\",\n          \"padding\": \"NONE\",\n          \"bleed\": false,\n          \"border\": false\n        },\n        \"hidden\": false\n      }\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a document content block",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/content/{{contentId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "content",
                "{{contentId}}"
              ]
            },
            "description": "Get one content block of a document by its field ID, with full type-specific metadata."
          },
          "response": []
        },
        {
          "name": "Update a document content block",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/content/{{contentId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "content",
                "{{contentId}}"
              ]
            },
            "description": "Updates a document field by its ID. Only DRAFT documents can be changed. To fill in a value, such as a FORM subfield, use `PATCH /api/v1/documents/{id}/field-values` instead. To find the field that holds a key, call `GET /api/v1/documents/{id}/content?key=KEY`.\n\n**Updatable properties:**\n- `type` - Field type\n- `position` - The 0-based index to move the field to\n- `fieldMeta` - The full metadata for the field type, which replaces the stored metadata\n\nThe following example updates an HTML field:\n\n```json\nPATCH /api/v1/documents/{docId}/content/{contentId}\n{\n  \"type\": \"HTML\",\n  \"fieldMeta\": {\n    \"type\": \"HTML\",\n    \"content\": \"<div style='text-align: center'><h1>Contract title</h1><p>Custom styled content</p></div>\"\n  }\n}\n```\n\nThe response is the updated field, in the same shape as `GET /api/v1/documents/{id}/content/{contentId}`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"TEXT\",\n  \"position\": 0,\n  \"fieldMeta\": {\n    \"type\": \"TEXT\",\n    \"content\": \"<p>Anst\u00e4llningen g\u00e4ller tills vidare fr\u00e5n och med den 1 november 2026, med sex m\u00e5naders provanst\u00e4llning.</p>\",\n    \"locked\": false,\n    \"sectionStyle\": {\n      \"background\": \"NONE\",\n      \"padding\": \"NONE\",\n      \"bleed\": false,\n      \"border\": false\n    },\n    \"hidden\": false\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Add, update, or remove boxes on a PDF block",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/content/{{contentId}}/placed-fields",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "content",
                "{{contentId}}",
                "placed-fields"
              ]
            },
            "description": "Changes individual boxes on a PDF field without sending the whole field. Only DRAFT documents can be changed.\n\nEach box in `upsert` has the same shape as an entry in `fieldMeta.placedFields` on `POST /api/v1/documents/{id}/content`, and is checked the same way. The response is the updated field, in the same shape as `GET /api/v1/documents/{id}/content/{contentId}`. A box whose `id` already exists on the field replaces that box and keeps its stacking order. A box with a new `id` is added on top. `remove` lists the ids of boxes to delete. Boxes you don't mention stay as they are.\n\nThe change is atomic: if any box is invalid, nothing is written and the response lists every problem in `issues`. If another edit changes the field while the request runs, the request fails with an HTTP `409 Conflict` status code and code `INVALID_STATE`; send it again.\n\n**Example - move one box and remove another:**\n```json\nPATCH /api/v1/documents/{docId}/content/{contentId}/placed-fields\n{\n  \"upsert\": [\n    {\n      \"id\": \"sig-1\",\n      \"kind\": \"INPUT\",\n      \"inputType\": \"SIGNATURE\",\n      \"page\": 2,\n      \"rect\": { \"x\": 0.12, \"y\": 0.8, \"width\": 0.34, \"height\": 0.06 },\n      \"partyId\": \"PARTY_ID\"\n    }\n  ],\n  \"remove\": [\"initials-3\"]\n}\n```",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"upsert\": [\n    {\n      \"id\": \"cm4k2x9p10009abcd1234efgh\",\n      \"page\": 1,\n      \"rect\": {\n        \"x\": 0.12,\n        \"y\": 0.76,\n        \"width\": 0.3,\n        \"height\": 0.06\n      },\n      \"pageWidth\": 595.28,\n      \"pageHeight\": 841.89,\n      \"pageRotation\": 0,\n      \"name\": \"Anst\u00e4llningsvillkor\",\n      \"key\": \"startdatum\",\n      \"locked\": false,\n      \"style\": {\n        \"fontSize\": 6,\n        \"color\": \"#2563EB\",\n        \"bold\": false,\n        \"italic\": false,\n        \"align\": \"LEFT\"\n      },\n      \"kind\": \"INPUT\",\n      \"inputType\": \"TEXT\",\n      \"label\": \"Startdatum\",\n      \"fillSource\": \"SIGNER\",\n      \"partyId\": \"cm4k2x9p10004abcd1234efgh\",\n      \"variableId\": \"startdatum\",\n      \"identity\": \"name\",\n      \"drawn\": false,\n      \"required\": true,\n      \"options\": [\n        \"Heltid\"\n      ],\n      \"multiline\": false,\n      \"format\": \"email\",\n      \"min\": 1,\n      \"max\": 1,\n      \"decimals\": 1,\n      \"step\": 1,\n      \"unit\": \"RELATIVE\",\n      \"origin\": \"TOP_LEFT\"\n    }\n  ],\n  \"remove\": [\n    \"Anst\u00e4llningsvillkor\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a document content block",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/content/{{contentId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "content",
                "{{contentId}}"
              ]
            },
            "description": "Deletes a field from a document. Only DRAFT documents can be changed. The response holds the ID of the deleted field; to keep its content, read the field before you delete it."
          },
          "response": []
        },
        {
          "name": "List the fillable values on a document",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/field-values",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "field-values"
              ],
              "query": [
                {
                  "key": "onlyEmpty",
                  "value": "true",
                  "description": "If `true`, returns only the values that are empty.",
                  "disabled": true
                }
              ]
            },
            "description": "Lists every value that the sender or a party can fill in on a document, addressed by one `key` each. The list covers FORM subfields, form fields that are part of an uploaded PDF (AcroForm fields), and input boxes placed on a PDF.\n\nThe values are in `data`. To fill in values, send the keys to `PATCH /api/v1/documents/{id}/field-values`."
          },
          "response": []
        },
        {
          "name": "Fill in values on a document",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/field-values",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "field-values"
              ]
            },
            "description": "Fills in values by key. The same request shape works for FORM subfields, AcroForm fields, and boxes placed on a PDF. Only documents with the status DRAFT or IMPORTED can be filled in.\n\nKeys must match exactly. To find the keys, call `GET /api/v1/documents/{id}/field-values`. Set a key in the editor on a FORM subfield or a placed box, or send `key` when you create a placed box through the API, so that the key stays the same for every document created from a template.\n\nThe following example fills in a FORM subfield, a placed text box, and a PDF checkbox:\n\n```json\n{\n  \"values\": [\n    { \"key\": \"customer-name\", \"value\": \"Example AB\" },\n    { \"key\": \"org-number\", \"value\": \"556000-0000\" },\n    { \"key\": \"accept-terms\", \"value\": true }\n  ]\n}\n```\n\nA value fails, and the other values are still written, when its key doesn't exist, when two fields share the key, when a party fills in the value and the document is no longer a draft, or when the value doesn't match the type or the allowed options. `results` lists the outcome for each key, with an `error` that has a `code` from the error catalogue, and `data` holds every value on the document after the write, as `GET /api/v1/documents/{id}/field-values` returns them.\n\nIf another edit changes one of the fields while the request runs, nothing is written and the request fails with an HTTP `409 Conflict` status code. Send the request again.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"values\": [\n    {\n      \"key\": \"startdatum\",\n      \"value\": \"2026-11-01\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Document comments",
      "item": [
        {
          "name": "List comment threads on a document",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/comments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "comments"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "OPEN",
                  "description": "Filter by thread status. Omit for both.",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only threads created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only threads created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only threads updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only threads updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                }
              ]
            },
            "description": "Returns the comment threads on a document, newest first. Each item is a thread: the comment that opened it and its replies are in `messages`. Filter by `status` (`OPEN` or `RESOLVED`), or omit it for both."
          },
          "response": []
        },
        {
          "name": "Create a comment thread on a document",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/comments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "comments"
              ]
            },
            "description": "Start a new comment thread on a document with an initial message. Mention users by passing their user IDs in `mentions`.\n\nTo place the thread on a passage, send the passage as `excerpt` and the block it's in as `contentId`. If the excerpt appears more than once in the block, `prefix` and `suffix` pick the occurrence. To import comments from another tool without duplicates, send each with its own `externalId`. A request with an `externalId` the document already has returns that thread and creates nothing.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"body\": \"Kan vi \u00e4ndra startdatum till den 1 december?\",\n  \"excerpt\": \"Anst\u00e4llningen b\u00f6rjar den 1 november 2026\",\n  \"mentions\": [\n    \"cm4k2x9p10002abcd1234efgh\"\n  ],\n  \"visibility\": \"INTERNAL\",\n  \"contentId\": \"cm4k2x9p10018abcd1234efgh\",\n  \"prefix\": \"Anst\u00e4llningsavtal \u2013 Kai Lindqvist\",\n  \"suffix\": \"Anst\u00e4llningsavtal \u2013 Kai Lindqvist\",\n  \"externalId\": \"HR-2026-0142\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a comment thread",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/comments/{{threadId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "comments",
                "{{threadId}}"
              ]
            },
            "description": "Returns one comment thread on a document, with its messages oldest first."
          },
          "response": []
        },
        {
          "name": "Resolve or reopen a comment thread",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/comments/{{threadId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "comments",
                "{{threadId}}"
              ]
            },
            "description": "Toggle a thread between `OPEN` and `RESOLVED`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"OPEN\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a comment thread",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/comments/{{threadId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "comments",
                "{{threadId}}"
              ]
            },
            "description": "Permanently delete a comment thread and all its messages. Only the thread creator may delete it (AI-created threads are deletable by anyone with permission)."
          },
          "response": []
        },
        {
          "name": "Add a message to a comment thread",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/comments/{{threadId}}/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "comments",
                "{{threadId}}",
                "messages"
              ]
            },
            "description": "Append a reply or new message to an existing comment thread on a document. Posting to a resolved thread will reopen it.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"body\": \"Kan vi \u00e4ndra startdatum till den 1 december?\",\n  \"parentMessageId\": null,\n  \"mentions\": [\n    \"cm4k2x9p10002abcd1234efgh\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Document messages",
      "item": [
        {
          "name": "List messages on a document",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "messages"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                }
              ]
            },
            "description": "Returns a document's chat messages, newest first: external messages, which the parties see, and internal messages, which only the workspace sees. A party's private notes aren't included."
          },
          "response": []
        },
        {
          "name": "Post a message to a document",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "messages"
              ]
            },
            "description": "Posts a message to a document's chat. To keep it visible to the workspace only, set `internal` to `true`. Otherwise the message is external: the document's parties see it and get an email about it.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"body\": \"Kan vi \u00e4ndra startdatum till den 1 december?\",\n  \"internal\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Document tags",
      "item": [
        {
          "name": "Add tag to document",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/tags",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "tags"
              ]
            },
            "description": "Associate a tag with a document, and return the document.\n\nThe tag's `availableFor` must include `DOCUMENT`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"tagId\": \"cm4k2x9p10010abcd1234efgh\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Remove tag from document",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/documents/{{documentId}}/tags/{{tagId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "{{documentId}}",
                "tags",
                "{{tagId}}"
              ]
            },
            "description": "Remove a tag association from a document, and return the document."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Approval requests",
      "item": [
        {
          "name": "List approval requests",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/approval-requests",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "approval-requests"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "documentId",
                  "value": "",
                  "description": "Only requests for these documents. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "approverId",
                  "value": "",
                  "description": "Only requests where one of these users is an approver. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "DRAFT",
                  "description": "Only requests with one of these statuses. Comma-separated or repeated.",
                  "disabled": true
                }
              ]
            },
            "description": "Lists the approval requests on documents you can read, newest first. A document has at most one request. To find the requests waiting for someone, pass `approverId` and `status=PENDING`; the result also lists requests whose turn for that approver hasn't come yet in a later stage."
          },
          "response": []
        },
        {
          "name": "Request approval of a document",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/approval-requests",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "approval-requests"
              ]
            },
            "description": "Submits a `DRAFT` document for internal approval. The document's status changes to `PENDING_APPROVAL`, and sajn notifies the approvers of the first stage. When the request is approved, sajn sends the document for signing, unless approvers already on the document were set up with `autoSend` false.\n\nPass `approverIds` to set who approves; every one of them must approve. Omit it to submit the approvers already on the document, such as the ones its template adds. A template that locks its approvers returns `409 INVALID_STATE` if you pass `approverIds`.\n\nTo resubmit a rejected request, call this endpoint again. The request keeps its ID, and every approver's decision is reset, so earlier decisions aren't kept. The resubmission fires `approval_request.created` again, with the same `data.object.id`.\n\n**Permission required:** `SEND_DOCUMENT` on the workspace.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"documentId\": \"{{documentId}}\",\n  \"approverIds\": [\n    \"cm4k2x9p10041abcd1234efgh\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "var response = {};",
                  "try { response = pm.response.json(); } catch (error) {}",
                  "var save = function (key, value) {",
                  "  if (!value) { return; }",
                  "  pm.collectionVariables.set(key, value);",
                  "  if (pm.environment.name) { pm.environment.set(key, value); }",
                  "};",
                  "save('approvalRequestId', response.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Get an approval request",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/approval-requests/{{approvalRequestId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "approval-requests",
                "{{approvalRequestId}}"
              ]
            },
            "description": "Gets an approval request, with each approver's stage and decision."
          },
          "response": []
        },
        {
          "name": "Approve an approval request",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/approval-requests/{{approvalRequestId}}/approve",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "approval-requests",
                "{{approvalRequestId}}",
                "approve"
              ]
            },
            "description": "Approves the request as the authenticated user, who must be an approver in the current stage. You can't approve on someone else's behalf. When the last required approver approves, the request becomes `APPROVED`, and with `autoSend` set to true, sajn sends the document for signing.\n\n**Permission required:** `APPROVE_DOCUMENT` on the workspace.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"comment\": \"Godk\u00e4nt enligt l\u00f6nepolicyn.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Reject an approval request",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/approval-requests/{{approvalRequestId}}/reject",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "approval-requests",
                "{{approvalRequestId}}",
                "reject"
              ]
            },
            "description": "Rejects the request as the authenticated user, who must be an approver in the current stage. A comment is required. One rejection rejects the whole request, and the document returns to `DRAFT` so the requester can edit it and resubmit.\n\n**Permission required:** `APPROVE_DOCUMENT` on the workspace.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"comment\": \"Godk\u00e4nt enligt l\u00f6nepolicyn.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Cancel an approval request",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/approval-requests/{{approvalRequestId}}/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "approval-requests",
                "{{approvalRequestId}}",
                "cancel"
              ]
            },
            "description": "Cancels a `PENDING` request. Only the user who submitted it can cancel it. sajn deletes the request, so the response is the last state of the request with `status` set to `CANCELLED`, and `GET /api/v1/approval-requests/{id}` returns `404` afterwards. The `approval_request.cancelled` event carries the same last state, so it's the only record of the request. The document returns to `DRAFT`.\n\n**Permission required:** `SEND_DOCUMENT` on the workspace.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Bundles",
      "item": [
        {
          "name": "List bundles",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/bundles",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "bundles"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                }
              ]
            },
            "description": "Lists the workspace's bundles in every status, newest first. A bundle is listed only if you can read every document in it.\n\nTo list the documents of one bundle with their full details, call `GET /api/v1/documents?bundleId={id}`."
          },
          "response": []
        },
        {
          "name": "Create a bundle",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/bundles",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "bundles"
              ]
            },
            "description": "Creates a draft bundle. A bundle sends several documents as one invitation, so each party signs all of their documents with one signature. Every document keeps its own signature, seal, audit trail, and certificate.\n\nThe bundle owns who signs and how the send behaves: its parties and its send settings, which it writes onto every document in it. Each document keeps its content, fields, and document-level settings.\n\nPass `documentIds` to add existing drafts. Their parties become the bundle's parties, one per email address. A person who signs with different methods, verifications, or roles on different documents, or documents with different signing modes, return `409 INVALID_STATE`. A document without parties gets every bundle party.\n\nPass `parties` to set the parties yourself. They replace the parties the documents brought, and a party whose email address one of the documents already had keeps that document's fields.\n\nSend the bundle with `POST /api/v1/bundles/{id}/send` once it holds 2 or more documents.\n\n**Permission required:** `EDIT_DOCUMENT` on the workspace, and access to every document in the bundle. Requires a Team plan.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Anst\u00e4llningspaket \u2013 Kai Lindqvist\",\n  \"expiresAt\": \"2026-10-28T22:00:00.000Z\",\n  \"documentIds\": [\n    \"cm4k2x9p10003abcd1234efgh\",\n    \"cm4k2x9p10022abcd1234efgh\"\n  ],\n  \"parties\": [\n    {\n      \"name\": \"Kai Lindqvist\",\n      \"email\": \"kai@example.com\",\n      \"signatureMethod\": \"SE_BANKID\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a bundle",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/bundles/{{bundleId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "bundles",
                "{{bundleId}}"
              ]
            },
            "description": "Gets a bundle in any status, with its settings, its parties and the documents each one is on, and the signing status of every party on every document. Returns `404 NOT_FOUND` if you can't read every document in it.\n\nSigning URLs aren't included. To get a party's signing URL, call `GET /api/v1/bundles/{id}/parties/{partyId}`."
          },
          "response": []
        },
        {
          "name": "Update a bundle's settings",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/bundles/{{bundleId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "bundles",
                "{{bundleId}}"
              ]
            },
            "description": "Updates the bundle's send settings and writes them onto every document in it. A setting you leave out keeps its value.\n\nWorks only while the bundle is a `DRAFT`. On a sent bundle it returns `409 INVALID_STATE`; withdraw it first with `POST /api/v1/bundles/{id}/withdraw`.\n\n**Permission required:** `EDIT_DOCUMENT` on the workspace, and access to every document in the bundle. Requires a Team plan.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"message\": \"Hej Kai! H\u00e4r \u00e4r ditt anst\u00e4llningsavtal och sekretessavtalet. Signera b\u00e5da med BankID.\",\n  \"reminderIntervalDays\": 2\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Add documents to a bundle",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/bundles/{{bundleId}}/documents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "bundles",
                "{{bundleId}}",
                "documents"
              ]
            },
            "description": "Adds draft documents to the bundle, up to 50 in total. A document's parties join the bundle's parties: a party whose email address the bundle already has is matched to it, and a new address becomes a new bundle party. A document without parties gets every bundle party. The bundle's settings are written onto the added documents. A document is refused with 409 when one email address has a different signing method, verification, role or personal number than in the bundle, or when its signing mode or party order differs from the bundle's.\n\nWorks only while the bundle is a `DRAFT`. On a sent bundle it returns `409 INVALID_STATE`; withdraw it first with `POST /api/v1/bundles/{id}/withdraw`.\n\n**Permission required:** `EDIT_DOCUMENT` on the workspace, and access to every document in the bundle. Requires a Team plan.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"documentIds\": [\n    \"cm4k2x9p10022abcd1234efgh\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Remove a document from a bundle",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/bundles/{{bundleId}}/documents/{{documentId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "bundles",
                "{{bundleId}}",
                "documents",
                "{{documentId}}"
              ]
            },
            "description": "Removes a document from the bundle. It stays a `DRAFT` with the parties and settings it has.\n\nWorks only while the bundle is a `DRAFT`. On a sent bundle it returns `409 INVALID_STATE`; withdraw it first with `POST /api/v1/bundles/{id}/withdraw`.\n\n**Permission required:** `EDIT_DOCUMENT` on the workspace, and access to every document in the bundle. Requires a Team plan.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Set a bundle's parties",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/bundles/{{bundleId}}/parties",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "bundles",
                "{{bundleId}}",
                "parties"
              ]
            },
            "description": "Replaces the bundle's parties and the documents each one is on, and writes them onto every document.\n\nA party whose email address the bundle already has keeps its ID, and its parties on the documents keep theirs, so the fields assigned to them stay. A party you leave out, or take off a document with `documentIds`, is removed from those documents: its signature and initials boxes are removed, and fields it filled in keep their values as fixed text.\n\nWorks only while the bundle is a `DRAFT`. On a sent bundle it returns `409 INVALID_STATE`; withdraw it first with `POST /api/v1/bundles/{id}/withdraw`.\n\n**Permission required:** `EDIT_DOCUMENT` on the workspace, and access to every document in the bundle. Requires a Team plan.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"parties\": [\n    {\n      \"name\": \"Kai Lindqvist\",\n      \"email\": \"kai@example.com\",\n      \"signatureMethod\": \"SE_BANKID\"\n    },\n    {\n      \"name\": \"Alex Berg\",\n      \"email\": \"alex@example.com\",\n      \"role\": \"REVIEWER\",\n      \"documentIds\": [\n        \"cm4k2x9p10003abcd1234efgh\"\n      ]\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Correct a party's contact details",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/bundles/{{bundleId}}/parties/{{partyId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "bundles",
                "{{bundleId}}",
                "parties",
                "{{partyId}}"
              ]
            },
            "description": "Corrects the email address or phone number of a party in an `OPEN` bundle, on every document they haven't signed yet, and sends them a fresh invitation. A new email address gets a new link, and the old one stops working. This is the one change a sent bundle takes.\n\nTo change anything else, withdraw the bundle with `POST /api/v1/bundles/{id}/withdraw`, change it, and send it again. On a `DRAFT` bundle, use `PUT /api/v1/bundles/{id}/parties`.\n\n**Permission required:** `EDIT_DOCUMENT` on the workspace, and access to every document in the bundle. Requires a Team plan.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"kai.lindqvist@example.com\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a bundle party with signing URL",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/bundles/{{bundleId}}/parties/{{partyId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "bundles",
                "{{bundleId}}",
                "parties",
                "{{partyId}}"
              ]
            },
            "description": "Gets one party of a sent bundle, including their signing URL. The URL opens every document the party signs in the bundle. A `DRAFT` bundle has no signing URLs yet and returns `409 INVALID_STATE`.\n\n**Security note:** each call writes an audit entry on every document the party signs in the bundle.\n\n**Permission required:** `SEND_DOCUMENT` on the workspace, and access to every document in the bundle."
          },
          "response": []
        },
        {
          "name": "Send a bundle",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/bundles/{{bundleId}}/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "bundles",
                "{{bundleId}}",
                "send"
              ]
            },
            "description": "Sends a draft bundle of 2 to 50 documents. sajn checks every document first and sends none of them if one fails: `409 INVALID_STATE` lists the reasons in `userMessage`. For example, a document has a blocker such as a missing signature box, needs approval, or has a party without an email address. The monthly limit counts every document.\n\nThe bundle's `status` is `OPEN` from this call. Each party gets one invitation once every document's PDF is ready, and the bundle fires `bundle.sent`.\n\n**Permission required:** `SEND_DOCUMENT` on the workspace, and access to every document in the bundle. Requires a Team plan.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Withdraw a bundle",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/bundles/{{bundleId}}/withdraw",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "bundles",
                "{{bundleId}}",
                "withdraw"
              ]
            },
            "description": "Takes an `OPEN` bundle back to `DRAFT` so you can change it and send it again. Every document returns to `DRAFT` and stays in the bundle, and every signature is cleared, so everyone signs again after the next send. Each document fires `document.withdrawn`.\n\nA bundle with a document that is already completed returns `409 INVALID_STATE`. To stop a bundle for good, cancel it with `POST /api/v1/bundles/{id}/cancel`.\n\n**Permission required:** `WITHDRAW_DOCUMENT` on the workspace, and access to every document in the bundle.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reason\": \"Fel startdatum i avtalet.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Cancel a bundle",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/bundles/{{bundleId}}/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "bundles",
                "{{bundleId}}",
                "cancel"
              ]
            },
            "description": "Cancels a sent bundle and withdraws every document in it that isn't signed yet. Withdrawn documents return to `DRAFT` and leave the bundle, and each fires `document.withdrawn`. Documents that are already signed stay signed and stay in the bundle.\n\nReturns the bundle. Its `status` is `CANCELED` when every unsigned document was withdrawn, and the bundle fires `bundle.cancelled`. If a document can't be withdrawn, the bundle stays `OPEN` and that document stays in `documents` with its current status. A bundle that is a `DRAFT` or already canceled returns `409 INVALID_STATE`.\n\n**Permission required:** `WITHDRAW_DOCUMENT` on the workspace.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Files",
      "item": [
        {
          "name": "Create a file (presigned upload)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/files",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "files"
              ]
            },
            "description": "Create a file record and get a presigned URL to upload the bytes **directly to storage**.\n\n**Flow:**\n1. Compute the file's SHA-256 hash and base64-encode it.\n2. Call this endpoint with the filename, MIME type, size, and checksum. You receive the file object and a presigned `uploadUrl`.\n3. `PUT` the raw bytes to `uploadUrl` with headers `Content-Type: <mimeType>` and `x-amz-checksum-sha256: <checksum>`. S3 verifies the checksum on write.\n4. (Recommended) Call `POST /api/v1/files/:id/confirm` to verify the upload and flip the record to `CONFIRMED` immediately. Otherwise it is confirmed automatically the first time it is fetched via `GET /api/v1/files/:id`.\n\n**Why:** the bytes go straight to storage, so there is no API-server size limit.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"fileName\": \"anstallningsavtal-kai-lindqvist.pdf\",\n  \"mimeType\": \"application/pdf\",\n  \"size\": 184320,\n  \"checksum\": \"n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=\",\n  \"visibility\": \"PRIVATE\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "var response = {};",
                  "try { response = pm.response.json(); } catch (error) {}",
                  "var save = function (key, value) {",
                  "  if (!value) { return; }",
                  "  pm.collectionVariables.set(key, value);",
                  "  if (pm.environment.name) { pm.environment.set(key, value); }",
                  "};",
                  "save('fileId', response.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Confirm an uploaded file",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/files/{{fileId}}/confirm",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "files",
                "{{fileId}}",
                "confirm"
              ]
            },
            "description": "Confirm a previously-created file after its bytes have been uploaded to the presigned URL.\n\nThe server reads the persisted object back from storage (`HeadObject`), verifies the size and \u2014 when the backend records it \u2014 that the SHA-256 matches the checksum supplied at create time, then flips the file from `PENDING` to `CONFIRMED`.\n\n**When to call:** right after the upload `PUT` returns `200`. It is optional but recommended \u2014 a file is otherwise confirmed lazily the first time it is fetched via `GET /api/v1/files/:id`. Idempotent: confirming an already-confirmed file returns it unchanged.\n\n**Response:** Returns the file in the shape of `GET /api/v1/files/:id`."
          },
          "response": []
        },
        {
          "name": "List files",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/files",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "files"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "visibility",
                  "value": "PRIVATE",
                  "description": "Filter by visibility",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only files created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only files created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only files updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only files updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve a paginated list of files in your organization.\n\n**Pagination:** Pass `nextCursor` from the previous response as `cursor` until `hasMore` is false.\n\n**Filtering:** Optionally filter by visibility (PRIVATE or PUBLIC).\n\n**Response:**\n- Files are sorted by creation date (newest first)\n- Use the 'getFile' endpoint to retrieve file access URLs"
          },
          "response": []
        },
        {
          "name": "Get file by ID",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/files/{{fileId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "files",
                "{{fileId}}"
              ]
            },
            "description": "Retrieve file information and access URL.\n\n**URL Generation:**\n- For `PRIVATE` files: Returns a fresh signed URL (valid for 15 minutes)\n- For `PUBLIC` files: Returns the permanent CloudFront URL\n\n**Response includes:**\n- File metadata (filename, size, MIME type)\n- Visibility setting\n- Access URL\n- Upload information"
          },
          "response": []
        },
        {
          "name": "Delete a file",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/files/{{fileId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "files",
                "{{fileId}}"
              ]
            },
            "description": "Delete a file from storage and database.\n\n**Warning:** This operation is irreversible. The file is permanently deleted from both storage and the database.\n\n**Response:** Returns `{ id, deleted: true }`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Folders",
      "item": [
        {
          "name": "List folders",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/folders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "folders"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "type",
                  "value": "DOCUMENT",
                  "description": "Return only DOCUMENT or TEMPLATE folders. Omit for both.",
                  "disabled": true
                },
                {
                  "key": "parentFolderId",
                  "value": "",
                  "description": "Return only folders directly under this parent. Omit for top-level folders.",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only folders created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only folders created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only folders updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only folders updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                }
              ]
            },
            "description": "List folders in the current workspace, optionally filtered by type (DOCUMENT or TEMPLATE) and parent folder.\n\nPass `parentFolderId` to list direct children of a specific folder. Omit it to list top-level folders. The newest folders come first."
          },
          "response": []
        },
        {
          "name": "Create a folder",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/folders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "folders"
              ]
            },
            "description": "Create a new folder for documents or templates.\n\n`type` selects which entity the folder organizes. Pass `parentFolderId` to nest under an existing folder.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Anst\u00e4llningsavtal 2026\",\n  \"type\": \"DOCUMENT\",\n  \"parentFolderId\": null\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a folder by ID",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/folders/{{folderId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "folders",
                "{{folderId}}"
              ]
            },
            "description": "Retrieve a single folder. The folder must belong to the current workspace."
          },
          "response": []
        },
        {
          "name": "Rename or move a folder",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/folders/{{folderId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "folders",
                "{{folderId}}"
              ]
            },
            "description": "Rename a folder (`name`) and/or move it under another parent (`parentFolderId`). Pass `parentFolderId: null` to move to top-level.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Anst\u00e4llningsavtal 2026\",\n  \"parentFolderId\": null\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a folder",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/folders/{{folderId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "folders",
                "{{folderId}}"
              ]
            },
            "description": "Soft-deletes a folder. The folder must be empty \u2014 move out all child folders, documents, and templates first."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Blocks",
      "item": [
        {
          "name": "List reusable content blocks",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/blocks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "blocks"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "query",
                  "value": "",
                  "description": "Free-text search across name, description, and field metadata",
                  "disabled": true
                },
                {
                  "key": "category",
                  "value": "",
                  "description": "Returns only blocks in this category.",
                  "disabled": true
                },
                {
                  "key": "language",
                  "value": "",
                  "description": "Returns only blocks in this language, an ISO 639-1 code such as `sv`.",
                  "disabled": true
                },
                {
                  "key": "visibility",
                  "value": "PRIVATE",
                  "description": "Returns only blocks with this `visibility`. Omit for every block you can see.",
                  "disabled": true
                },
                {
                  "key": "fieldType",
                  "value": "TEXT",
                  "description": "Filter to blocks whose single field has this FieldType",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only blocks created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only blocks created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only blocks updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only blocks updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                }
              ]
            },
            "description": "List reusable content blocks (library entries) visible to the authenticated user.\n\nBlocks come in their library order (`sortOrder`), then newest first. Filter by `visibility`, or omit it for every block you can see:\n- `PRIVATE`: your private blocks in this workspace\n- `WORKSPACE`: blocks shared at workspace level\n- `ORGANIZATION`: blocks shared at organization level\n- `SHARED`: blocks sajn curates for everyone"
          },
          "response": []
        },
        {
          "name": "Get a content block by ID",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/blocks/{{blockId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "blocks",
                "{{blockId}}"
              ]
            },
            "description": "Retrieve a single content block including its field metadata."
          },
          "response": []
        },
        {
          "name": "Delete a content block",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/blocks/{{blockId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "blocks",
                "{{blockId}}"
              ]
            },
            "description": "Delete a content block. PRIVATE blocks can only be deleted by their creator. WORKSPACE and ORGANIZATION blocks can be deleted by their creator or an organization administrator. sajn-curated globals cannot be deleted via the API."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Templates",
      "item": [
        {
          "name": "List all templates",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "query",
                  "value": "",
                  "description": "Search template names (partial match)",
                  "disabled": true
                },
                {
                  "key": "tagId",
                  "value": "",
                  "description": "Filter by one or more tag IDs. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "folderId",
                  "value": "",
                  "description": "Filter by folder ID. Pass `root` to include only top-level templates.",
                  "disabled": true
                },
                {
                  "key": "createdById",
                  "value": "",
                  "description": "Filter by creator user IDs. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "private",
                  "value": "true",
                  "description": "If `true`, returns only private templates. If `false`, returns only public ones.",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only templates created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only templates created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only templates updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only templates updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve a paginated list of all templates in your workspace.\n\nTemplates let you predefine document structure, fields, and default parties, then spawn documents from them via `POST /api/v1/documents` with `templateId`.\n\n**Pagination:** Pass `nextCursor` from the previous response as `cursor` until `hasMore` is false.\n**Search:** Use `query` to filter by template name."
          },
          "response": []
        },
        {
          "name": "Create a new template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates"
              ]
            },
            "description": "Create a new template in your workspace.\n\n**Required Fields:**\n- `name` - Template name\n\n**Optional Fields:**\n- `initialContent` - Content blocks to create with the template, each with `type`, `position`, and `fieldMeta`, in the same shape as `POST /api/v1/templates/{id}/content`.\n\n**Usage:** After creating a template, add default parties via `POST /api/v1/templates/:id/parties` and tags via `POST /api/v1/templates/:id/tags`. Then create documents from it using `POST /api/v1/documents` with `templateId`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Anst\u00e4llningsavtal\",\n  \"initialContent\": [\n    {\n      \"type\": \"TEXT\",\n      \"position\": 0,\n      \"fieldMeta\": {\n        \"type\": \"TEXT\",\n        \"content\": \"<p>Anst\u00e4llningen g\u00e4ller tills vidare fr\u00e5n och med den 1 november 2026, med sex m\u00e5naders provanst\u00e4llning.</p>\",\n        \"locked\": false,\n        \"sectionStyle\": {\n          \"background\": \"NONE\",\n          \"padding\": \"NONE\",\n          \"bleed\": false,\n          \"border\": false\n        },\n        \"hidden\": false\n      }\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a template by ID",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}"
              ],
              "query": [
                {
                  "key": "expand",
                  "value": "content",
                  "description": "Related data to include in the response, comma-separated or repeated. `content` adds the template's content blocks.",
                  "disabled": true
                }
              ]
            },
            "description": "Gets a template with its settings, parties, and tags. To include its content blocks, pass `expand=content`."
          },
          "response": []
        },
        {
          "name": "Update a template",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}"
              ]
            },
            "description": "Update template properties.\n\n**Updatable Fields:**\n- `name` - Template name\n- `templateMeta` - Default settings for documents created from this template, such as `signingMode` and `language`\n\nThe response is the template, in the same shape as `GET /api/v1/templates/:id`. A locked template can't be updated: the request fails with an HTTP `409 Conflict` status code and the code `INVALID_STATE`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Anst\u00e4llningsavtal\",\n  \"templateMeta\": {\n    \"signingMode\": \"PARALLEL\",\n    \"forceReadFullDocument\": false,\n    \"showChatToSigners\": false,\n    \"value\": \"540000\",\n    \"signableAfterExpired\": false,\n    \"sendPlainTextEmailOnly\": false,\n    \"allowDelegation\": false,\n    \"responsibleUserId\": \"cm4k2x9p10002abcd1234efgh\",\n    \"internalRecipients\": [\n      \"hr@example.com\"\n    ],\n    \"visibility\": \"EVERYONE\",\n    \"selectedUserIds\": [\n      \"cm4k2x9p10008abcd1234efgh\"\n    ],\n    \"language\": \"sv\",\n    \"reminderIntervalDays\": 3,\n    \"openVerification\": \"PIN\",\n    \"nationalIdDisplayMode\": \"FULL\",\n    \"sameDeviceSigning\": false,\n    \"documentCategoryId\": \"cm4k2x9p10017abcd1234efgh\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a template",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}"
              ]
            },
            "description": "Moves a template to the trash, where it's deleted permanently after 90 days. Documents already created from the template don't change. The response is the template with `deletedAt` set. A locked template can't be deleted: the request fails with an HTTP `409 Conflict` status code and the code `INVALID_STATE`."
          },
          "response": []
        },
        {
          "name": "Duplicate a template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}/duplicate",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}",
                "duplicate"
              ]
            },
            "description": "Creates a copy of a template, with its fields and parties. The response is the copy, in the same shape as `GET /api/v1/templates/:id`."
          },
          "response": []
        },
        {
          "name": "List template content",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}/content",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}",
                "content"
              ],
              "query": [
                {
                  "key": "key",
                  "value": "",
                  "description": "Returns only the fields that hold a value with one of these keys: a FORM subfield, an AcroForm field, or a box placed on a PDF. Comma-separated or repeated.",
                  "disabled": true
                }
              ]
            },
            "description": "List the content blocks of a template in position order, with full type-specific metadata. Same shape as the document fields endpoint. To find the field that holds a FORM subfield, an AcroForm field, or a placed box by its key, pass `key`."
          },
          "response": []
        },
        {
          "name": "Create template content",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}/content",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}",
                "content"
              ]
            },
            "description": "Adds content blocks to a template. Send the blocks in `content`, the same way as `POST /api/v1/documents/{id}/content`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": [\n    {\n      \"type\": \"TEXT\",\n      \"position\": 0,\n      \"fieldMeta\": {\n        \"type\": \"TEXT\",\n        \"content\": \"<p>Anst\u00e4llningen g\u00e4ller tills vidare fr\u00e5n och med den 1 november 2026, med sex m\u00e5naders provanst\u00e4llning.</p>\",\n        \"locked\": false,\n        \"sectionStyle\": {\n          \"background\": \"NONE\",\n          \"padding\": \"NONE\",\n          \"bleed\": false,\n          \"border\": false\n        },\n        \"hidden\": false\n      }\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a template content block",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}/content/{{contentId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}",
                "content",
                "{{contentId}}"
              ]
            },
            "description": "Get one content block of a template by its field ID."
          },
          "response": []
        },
        {
          "name": "Update a template content block",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}/content/{{contentId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}",
                "content",
                "{{contentId}}"
              ]
            },
            "description": "Updates a template field by its ID, the same way as `PATCH /api/v1/documents/{id}/content/{contentId}`. The response is the updated field.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"TEXT\",\n  \"position\": 0,\n  \"fieldMeta\": {\n    \"type\": \"TEXT\",\n    \"content\": \"<p>Anst\u00e4llningen g\u00e4ller tills vidare fr\u00e5n och med den 1 november 2026, med sex m\u00e5naders provanst\u00e4llning.</p>\",\n    \"locked\": false,\n    \"sectionStyle\": {\n      \"background\": \"NONE\",\n      \"padding\": \"NONE\",\n      \"bleed\": false,\n      \"border\": false\n    },\n    \"hidden\": false\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Add, update, or remove boxes on a template PDF block",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}/content/{{contentId}}/placed-fields",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}",
                "content",
                "{{contentId}}",
                "placed-fields"
              ]
            },
            "description": "Changes individual boxes on a template PDF field, the same way as `PATCH /api/v1/documents/{id}/content/{contentId}/placed-fields`, with `partyId` referring to a template party. The response is the updated field.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"upsert\": [\n    {\n      \"id\": \"cm4k2x9p10009abcd1234efgh\",\n      \"page\": 1,\n      \"rect\": {\n        \"x\": 0.12,\n        \"y\": 0.76,\n        \"width\": 0.3,\n        \"height\": 0.06\n      },\n      \"pageWidth\": 595.28,\n      \"pageHeight\": 841.89,\n      \"pageRotation\": 0,\n      \"name\": \"Anst\u00e4llningsvillkor\",\n      \"key\": \"startdatum\",\n      \"locked\": false,\n      \"style\": {\n        \"fontSize\": 6,\n        \"color\": \"#2563EB\",\n        \"bold\": false,\n        \"italic\": false,\n        \"align\": \"LEFT\"\n      },\n      \"kind\": \"INPUT\",\n      \"inputType\": \"TEXT\",\n      \"label\": \"Startdatum\",\n      \"fillSource\": \"SIGNER\",\n      \"partyId\": \"cm4k2x9p10004abcd1234efgh\",\n      \"variableId\": \"startdatum\",\n      \"identity\": \"name\",\n      \"drawn\": false,\n      \"required\": true,\n      \"options\": [\n        \"Heltid\"\n      ],\n      \"multiline\": false,\n      \"format\": \"email\",\n      \"min\": 1,\n      \"max\": 1,\n      \"decimals\": 1,\n      \"step\": 1,\n      \"unit\": \"RELATIVE\",\n      \"origin\": \"TOP_LEFT\"\n    }\n  ],\n  \"remove\": [\n    \"Anst\u00e4llningsvillkor\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a template content block",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}/content/{{contentId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}",
                "content",
                "{{contentId}}"
              ]
            },
            "description": "Deletes a field from a template. The response holds the ID of the deleted field."
          },
          "response": []
        },
        {
          "name": "List all parties for a template",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}/parties",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}",
                "parties"
              ]
            },
            "description": "Retrieve all default parties configured on a template. These are copied to new documents created from this template unless overridden."
          },
          "response": []
        },
        {
          "name": "Add a party to template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}/parties",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}",
                "parties"
              ]
            },
            "description": "Add a default party/signer to a template. You can either reference an existing contact via `contactId`, or provide `name` with optional email/phone/company details manually.\n\nThese parties are inherited as signers when a document is created from this template (unless overridden).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"contactId\": \"{{contactId}}\",\n  \"role\": \"SIGNER\",\n  \"signingOrder\": 1,\n  \"delivery\": [\n    \"EMAIL\"\n  ],\n  \"signatureMethod\": \"SE_BANKID\",\n  \"signVerification\": \"PIN\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Update a template party",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}/parties/{{partyId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}",
                "parties",
                "{{partyId}}"
              ]
            },
            "description": "Updates a template party. A property you leave out stays unchanged, and `null` clears it. A locked template can't be changed: the request fails with an HTTP `409 Conflict` status code and the code `INVALID_STATE`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Den anst\u00e4llde\",\n  \"signatureMethod\": \"SE_BANKID\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Remove a party from template",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}/parties/{{partyId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}",
                "parties",
                "{{partyId}}"
              ]
            },
            "description": "Removes a default party from a template. The response holds the ID of the removed party."
          },
          "response": []
        },
        {
          "name": "Add tag to template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}/tags",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}",
                "tags"
              ]
            },
            "description": "Associate a tag with a template. Tag must be configured for TEMPLATE use (`availableFor` includes `TEMPLATE`). The response is the template.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"tagId\": \"cm4k2x9p10010abcd1234efgh\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Remove tag from template",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/templates/{{templateId}}/tags/{{tagId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "templates",
                "{{templateId}}",
                "tags",
                "{{tagId}}"
              ]
            },
            "description": "Remove a tag association from a template. The response is the template."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Forms",
      "item": [
        {
          "name": "List forms",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "enabled",
                  "value": "true",
                  "description": "If `true`, returns only published forms. If `false`, returns only unpublished forms.",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only forms created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only forms created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only forms updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only forms updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "orderBy",
                  "value": "createdAt",
                  "description": "The field to sort by. Default: `createdAt`.",
                  "disabled": true
                },
                {
                  "key": "orderDirection",
                  "value": "desc",
                  "description": "The sort direction. Default: `desc`.",
                  "disabled": true
                }
              ]
            },
            "description": "List forms in the authenticated workspace, newest first. For incremental sync, set updatedAfter, sort by updatedAt ascending, and pass nextCursor as cursor until hasMore is false."
          },
          "response": []
        },
        {
          "name": "Create a draft form",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms"
              ]
            },
            "description": "Create a blank form or an independent copy of templateId. The source template is unchanged. Copying a template additionally requires templates:read. Configure settings, the form's template, its fields and parties through the form endpoints, then publish. Use Idempotency-Key when retrying creation.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"templateId\": \"cm4k2x9p10008abcd1234efgh\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a form",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms/{{formId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms",
                "{{formId}}"
              ]
            },
            "description": "Read settings, public URL, questions, bindable field slots, aggregate statistics and publishing issues. Password hashes and respondent answers are never included."
          },
          "response": []
        },
        {
          "name": "Update form settings and questions",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms/{{formId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms",
                "{{formId}}"
              ]
            },
            "description": "Omitted settings stay unchanged; nullable values can be cleared explicitly. Questions replace the complete ordered question list. Saving never publishes or changes the sender. Requires forms:write and documents:write, including for drafts. An edit introducing a blocker closes a published form until it is fixed and republished.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Intresseanm\u00e4lan\",\n  \"description\": \"Anm\u00e4l ditt intresse f\u00f6r en tj\u00e4nst hos Exempelbolaget AB.\",\n  \"thankYouMessage\": \"Tack! Vi \u00e5terkommer inom tv\u00e5 arbetsdagar.\",\n  \"redirectUrl\": null,\n  \"password\": null,\n  \"questions\": [\n    {\n      \"id\": \"name\",\n      \"kind\": \"NAME\",\n      \"label\": \"Namn\",\n      \"required\": true\n    },\n    {\n      \"id\": \"email\",\n      \"kind\": \"EMAIL\",\n      \"label\": \"E-post\",\n      \"required\": true\n    },\n    {\n      \"id\": \"startdatum\",\n      \"kind\": \"FIELD\",\n      \"key\": \"startdatum\",\n      \"label\": \"\u00d6nskat startdatum\",\n      \"required\": true\n    }\n  ],\n  \"expiresAt\": \"2026-10-28T22:00:00.000Z\",\n  \"maxSubmissions\": 100,\n  \"documentExpiresInDays\": 30\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a form",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms/{{formId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms",
                "{{formId}}"
              ]
            },
            "description": "Permanently delete the form, its owned template and submission records. Documents created from submissions remain ordinary documents. Export responses before deleting."
          },
          "response": []
        },
        {
          "name": "Publish a form",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms/{{formId}}/publish",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms",
                "{{formId}}",
                "publish"
              ]
            },
            "description": "Validate readiness and publish or reopen the form. The authenticated user becomes the sender of future documents and must be allowed to create and send documents without approval. Plan, signing methods, expiry and capacity are checked. Requires forms:write and documents:write."
          },
          "response": []
        },
        {
          "name": "Unpublish a form",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms/{{formId}}/unpublish",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms",
                "{{formId}}",
                "unpublish"
              ]
            },
            "description": "Stop new submissions and return the form. Republishing preserves the URL. Existing documents continue through signing."
          },
          "response": []
        },
        {
          "name": "Rotate a form link",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms/{{formId}}/rotate-token",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms",
                "{{formId}}",
                "rotate-token"
              ]
            },
            "description": "Invalidate the previous public URL and return the form with its new `url`. Existing signing links remain valid."
          },
          "response": []
        },
        {
          "name": "Select the respondent party",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms/{{formId}}/respondent",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms",
                "{{formId}}",
                "respondent"
              ]
            },
            "description": "Choose an existing SIGNER from this form's template by its party ID. The visitor fills this party's slot. Invalid edits close a published form. Requires forms:write and documents:write, including for drafts.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"partyId\": \"{{partyId}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get the form's template",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms/{{formId}}/template",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms",
                "{{formId}}",
                "template"
              ]
            },
            "description": "Read the template the form owns: its name, settings, fields and parties. Every document created from a submission is created from it. Field and party IDs belong to this form, not to the template it was copied from."
          },
          "response": []
        },
        {
          "name": "Update the form's template",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms/{{formId}}/template",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms",
                "{{formId}}",
                "template"
              ]
            },
            "description": "Change the template's name, signing order and document defaults, and return the template. Settings you omit stay unchanged. Changes apply to future submissions only. Requires forms:write and documents:write, including for drafts.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Intresseanm\u00e4lan\",\n  \"templateMeta\": {\n    \"signingMode\": \"PARALLEL\",\n    \"forceReadFullDocument\": false,\n    \"showChatToSigners\": false,\n    \"value\": \"540000\",\n    \"signableAfterExpired\": false,\n    \"sendPlainTextEmailOnly\": false,\n    \"allowDelegation\": false,\n    \"responsibleUserId\": \"cm4k2x9p10002abcd1234efgh\",\n    \"internalRecipients\": [\n      \"hr@example.com\"\n    ],\n    \"visibility\": \"EVERYONE\",\n    \"selectedUserIds\": [\n      \"cm4k2x9p10023abcd1234efgh\"\n    ],\n    \"language\": \"sv\",\n    \"reminderIntervalDays\": 3,\n    \"openVerification\": \"PIN\",\n    \"nationalIdDisplayMode\": \"FULL\",\n    \"sameDeviceSigning\": false,\n    \"documentCategoryId\": \"cm4k2x9p10017abcd1234efgh\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Replace the form template's content",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms/{{formId}}/template/content",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms",
                "{{formId}}",
                "template",
                "content"
              ]
            },
            "description": "Replace the complete ordered list of content blocks, and return the template. Include existing IDs to keep blocks; omit an ID to create a block. Blocks you leave out are deleted. An existing block's type can't change. PDF ownership, metadata, section locks, and boxes placed on a PDF are validated. Read the form again to see the keys a question can bind to. Requires forms:write and documents:write, including for drafts.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": [\n    {\n      \"id\": \"cm4k2x9p10009abcd1234efgh\",\n      \"type\": \"TEXT\",\n      \"position\": 0,\n      \"fieldMeta\": {\n        \"type\": \"TEXT\",\n        \"content\": \"<p>Anst\u00e4llningen g\u00e4ller tills vidare fr\u00e5n och med den 1 november 2026, med sex m\u00e5naders provanst\u00e4llning.</p>\",\n        \"locked\": false,\n        \"sectionStyle\": {\n          \"background\": \"NONE\",\n          \"padding\": \"NONE\",\n          \"bleed\": false,\n          \"border\": false\n        },\n        \"hidden\": false\n      }\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Replace the form template's parties",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms/{{formId}}/template/parties",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms",
                "{{formId}}",
                "template",
                "parties"
              ]
            },
            "description": "Replace the complete party list, and return the template. Include IDs to keep parties; omit IDs to create them. Properties you omit on a kept party, including its PIN, stay unchanged, and null clears a nullable property. Parties you leave out are deleted. If you remove the respondent, select another SIGNER before publishing. Existing submissions are unchanged. Requires forms:write and documents:write, including for drafts.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"parties\": [\n    {\n      \"name\": \"Kai Lindqvist\",\n      \"email\": \"kai@example.com\",\n      \"phone\": \"+46701740605\",\n      \"company\": null,\n      \"externalId\": \"HR-2026-0142\",\n      \"nationalId\": \"191212121212\",\n      \"country\": \"SE\",\n      \"role\": \"SIGNER\",\n      \"signingOrder\": 1,\n      \"delivery\": [\n        \"EMAIL\"\n      ],\n      \"signatureMethod\": \"SE_BANKID\",\n      \"signVerification\": \"PIN\",\n      \"id\": \"cm4k2x9p10004abcd1234efgh\",\n      \"contactId\": \"cm4k2x9p10006abcd1234efgh\",\n      \"type\": \"INDIVIDUAL\",\n      \"signPin\": \"4821\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "List form submissions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms/{{formId}}/submissions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms",
                "{{formId}}",
                "submissions"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "STARTED",
                  "description": "Returns only submissions with one of these statuses. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "submittedAfter",
                  "value": "",
                  "description": "Only submissions submitted at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "submittedBefore",
                  "value": "",
                  "description": "Only submissions submitted at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only submissions updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only submissions updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "orderBy",
                  "value": "startedAt",
                  "description": "The field to sort by. Default: `startedAt`.",
                  "disabled": true
                },
                {
                  "key": "orderDirection",
                  "value": "desc",
                  "description": "The sort direction. Default: `desc`.",
                  "disabled": true
                }
              ]
            },
            "description": "Read answers and respondent contact details, most recently started first. To sync responses, set updatedAfter, sort by updatedAt ascending, and pass nextCursor as cursor until hasMore is false. Use submittedAfter to filter submitted responses. documentId links to the ordinary document API, which separately enforces document access."
          },
          "response": []
        },
        {
          "name": "Get a form submission",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/forms/{{formId}}/submissions/{{submissionId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "forms",
                "{{formId}}",
                "submissions",
                "{{submissionId}}"
              ]
            },
            "description": "Read one submission's answers, contact details, status and document ID. Requires forms:submissions:read. IP addresses, user agents and signing tokens are never returned."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Contacts",
      "item": [
        {
          "name": "List all contacts",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/contacts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "contacts"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "query",
                  "value": "",
                  "description": "Free-text search across first name, last name, email, phone, and company",
                  "disabled": true
                },
                {
                  "key": "email",
                  "value": "",
                  "description": "Returns only contacts whose email address equals this value exactly.",
                  "disabled": true
                },
                {
                  "key": "phone",
                  "value": "",
                  "description": "Returns only contacts whose phone number equals this value exactly. Encode a leading `+` as `%2B`.",
                  "disabled": true
                },
                {
                  "key": "externalId",
                  "value": "",
                  "description": "Returns only the contact whose `externalId` equals this value exactly.",
                  "disabled": true
                },
                {
                  "key": "companyId",
                  "value": "",
                  "description": "Filter by one or more company IDs. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "tagId",
                  "value": "",
                  "description": "Filter by one or more tag IDs. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only contacts created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only contacts created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only contacts updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only contacts updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve a paginated list of all contacts in your organization.\n\nContacts are individuals that can be added as signers to documents. Each contact can optionally be associated with a company.\n\n**Filters:** `email`, `phone` and `externalId` match exactly. Every filter you pass must match.\n\n**Pagination:** Pass `nextCursor` from the previous response as `cursor` until `hasMore` is false."
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "var response = {};",
                  "try { response = pm.response.json(); } catch (error) {}",
                  "var save = function (key, value) {",
                  "  if (!value) { return; }",
                  "  pm.collectionVariables.set(key, value);",
                  "  if (pm.environment.name) { pm.environment.set(key, value); }",
                  "};",
                  "save('contactId', response.data && response.data[0] && response.data[0].id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Create a new contact",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/contacts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "contacts"
              ]
            },
            "description": "Create a new contact in your organization.\n\n**Required Fields:**\n- `firstName` - Contact's first name\n\n**Optional Fields:**\n- `lastName` - Contact's last name (omit or send an empty string for single-name contacts)\n- `email` - Email address\n- `phone` - Phone number (for SMS notifications)\n- `nationalId` - National identity number, such as a Swedish personnummer, for eID verification\n- `externalId` - Your external reference ID for tracking\n- `companyId` - Associate with existing company\n- `companyRole` - Role within the company\n- `addressLine1`, `addressLine2`, `postalCode`, `city`, `state`, `country` - The contact's address",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"firstName\": \"Kai\",\n  \"lastName\": \"Lindqvist\",\n  \"email\": \"kai@example.com\",\n  \"phone\": \"+46701740605\",\n  \"externalId\": \"EMP-0142\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "var response = {};",
                  "try { response = pm.response.json(); } catch (error) {}",
                  "var save = function (key, value) {",
                  "  if (!value) { return; }",
                  "  pm.collectionVariables.set(key, value);",
                  "  if (pm.environment.name) { pm.environment.set(key, value); }",
                  "};",
                  "save('contactId', response.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Get a contact by ID",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/contacts/{{contactId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "contacts",
                "{{contactId}}"
              ]
            },
            "description": "Retrieve detailed information about a specific contact including associated company information."
          },
          "response": []
        },
        {
          "name": "Update a contact",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/contacts/{{contactId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "contacts",
                "{{contactId}}"
              ]
            },
            "description": "Update contact information. Omit a field to keep its value, or pass `null` to clear it.\n\nUpdating a contact doesn't change the parties of existing documents. Changes apply only to new documents.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone\": \"+46701740605\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a contact",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/contacts/{{contactId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "contacts",
                "{{contactId}}"
              ]
            },
            "description": "Permanently delete a contact. Existing document signers are unaffected \u2014 they keep their own name/email snapshot and are unlinked from the contact rather than removed, so past and in-flight documents stay intact."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Companies",
      "item": [
        {
          "name": "List companies",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/companies",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "companies"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "query",
                  "value": "",
                  "description": "Free-text search across company name and organization number",
                  "disabled": true
                },
                {
                  "key": "orgNumber",
                  "value": "",
                  "description": "Returns only the company whose organization number equals this value. A hyphen is ignored.",
                  "disabled": true
                },
                {
                  "key": "name",
                  "value": "",
                  "description": "Returns only companies whose name equals this value, ignoring case.",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only companies created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only companies created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only companies updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only companies updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve a paginated list of the companies in your workspace, newest first.\n\nCompanies can be associated with contacts to track organizational relationships.\n\n**Pagination:** Pass `nextCursor` from the previous response as `cursor` until `hasMore` is false.\n**Search:** Use `query` to match part of the company name or organization number, or `orgNumber` and `name` for an exact match. Every filter you pass must match."
          },
          "response": []
        },
        {
          "name": "Create a new company",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/companies",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "companies"
              ]
            },
            "description": "Create a new company in your organization.\n\n**Required Fields:**\n- `name` - Company name\n\n**Optional Fields:**\n- `orgNumber` - Organization number (must be unique if provided)\n- `country` - Country code, defaults to `SE`\n\n**Note:** If a company with the same organization number exists, a 409 Conflict error is returned.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Nordljus AB\",\n  \"orgNumber\": \"5566778899\",\n  \"country\": \"SE\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a company by ID",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/companies/{{companyId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "companies",
                "{{companyId}}"
              ]
            },
            "description": "Retrieve a company. To list its contacts, call `GET /api/v1/contacts?companyId=` with the company ID."
          },
          "response": []
        },
        {
          "name": "Look up a company in the company registry",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/company-registry/{{orgNumber}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "company-registry",
                "{{orgNumber}}"
              ]
            },
            "description": "Look up a company in the external company registry by organization number, including its signatories. This searches the registry, not the companies in your workspace. Results are cached for 3 days.\n\n**Response includes:**\n- Basic company info (name, status, organization number)\n- Contact information (phone, address)\n- Legal information (company form, domicile, registration dates)\n- Tax information (VAT registration, verified against the EU VIES registry; `employer` and `fTax` aren't populated)\n- Business info (SNI codes, activity description, company signature)\n- Responsible persons (executives, board members, auditors, owners)\n- Location coordinates"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Tags",
      "item": [
        {
          "name": "List all tags",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/tags",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "tags"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only tags created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only tags created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only tags updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only tags updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve a paginated list of all tags in your organization.\n\nTags help organize and categorize documents, templates, and contacts.\n\n**Pagination:** Pass `nextCursor` from the previous response as `cursor` until `hasMore` is false."
          },
          "response": []
        },
        {
          "name": "Create a new tag",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/tags",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "tags"
              ]
            },
            "description": "Create a new tag for organizing documents, templates, or contacts.\n\n**Required Fields:**\n- `name` - Tag name (must be unique)\n- `availableFor` - Where tag can be used: DOCUMENT, TEMPLATE, or CONTACT\n\n**Optional Fields:**\n- `color` - Hex color code (e.g., #FF5733)",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Anst\u00e4llning\",\n  \"color\": \"#16A34A\",\n  \"availableFor\": [\n    \"DOCUMENT\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Update a tag",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/tags/{{tagId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "tags",
                "{{tagId}}"
              ]
            },
            "description": "Update tag properties. Omit a field to keep its value.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Anst\u00e4llning\",\n  \"color\": \"#16A34A\",\n  \"availableFor\": [\n    \"DOCUMENT\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a tag",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/tags/{{tagId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "tags",
                "{{tagId}}"
              ]
            },
            "description": "Deletes a tag and removes it from every document, template, and contact it was attached to."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Document categories",
      "item": [
        {
          "name": "List document categories",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/document-categories",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "document-categories"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only document categories created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only document categories created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only document categories updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only document categories updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve the document categories (Dokumenttyp) in the workspace, newest first.\n\nA category scopes which custom fields apply to a document. Use an `id` from this list as `documentMeta.documentCategoryId` when creating or updating a document, or as `templateMeta.documentCategoryId` on a template."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Custom fields",
      "item": [
        {
          "name": "List all custom fields",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/custom-fields",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "custom-fields"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "type",
                  "value": "DOCUMENT",
                  "description": "Returns only custom fields of this type.",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only custom fields created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only custom fields created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only custom fields updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only custom fields updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve a paginated list of custom field definitions.\n\nCustom fields allow you to add additional structured data to documents or contacts.\n\nFilter by `type` (DOCUMENT or CONTACT). The newest custom fields come first.\n\n**Pagination:** Pass `nextCursor` from the previous response as `cursor` until `hasMore` is false."
          },
          "response": []
        },
        {
          "name": "Create a custom field definition",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/custom-fields",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "custom-fields"
              ]
            },
            "description": "Create a new custom field definition.\n\n**Required Fields:**\n- `name` - Field name\n- `type` - DOCUMENT or CONTACT\n- `inputType` - Input type (TEXT, NUMBER, DATE, BOOLEAN, SELECT, TEXTAREA, EMAIL, PHONE, URL, JSON)\n\n**Optional Fields:**\n- `defaultValue` - Default value for the field\n- `required` - Whether field is required (default: false)\n- `options` - For SELECT type, the options as an array of strings, for example `[\"Small\",\"Large\"]`",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Startdatum\",\n  \"type\": \"DOCUMENT\",\n  \"inputType\": \"TEXT\",\n  \"defaultValue\": \"2026-11-01\",\n  \"required\": false,\n  \"options\": [\n    \"Heltid\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a custom field by ID",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/custom-fields/{{customFieldId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "custom-fields",
                "{{customFieldId}}"
              ]
            },
            "description": "Retrieve detailed information about a custom field definition."
          },
          "response": []
        },
        {
          "name": "Update a custom field definition",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/custom-fields/{{customFieldId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "custom-fields",
                "{{customFieldId}}"
              ]
            },
            "description": "Update custom field properties. Omit a field to keep its value, or pass `null` to clear `defaultValue` or `options`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Startdatum\",\n  \"inputType\": \"TEXT\",\n  \"defaultValue\": \"2026-11-01\",\n  \"required\": true,\n  \"options\": [\n    \"Heltid\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a custom field definition",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/custom-fields/{{customFieldId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "custom-fields",
                "{{customFieldId}}"
              ]
            },
            "description": "Delete a custom field definition.\n\n**Warning:** This will remove all values associated with this field from all documents/contacts."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Identity checks",
      "item": [
        {
          "name": "List identity checks",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/identity-checks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "identity-checks"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "CREATED",
                  "description": "Filter by status. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only checks created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only checks created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only checks updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only checks updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                }
              ]
            },
            "description": "Lists the sajn ID identity checks in your workspace, newest first. An identity check asks a person to verify who they are with BankID, matched against their national identity number or, without one, their name.\n\nFilter by `status`, `createdAfter` and `createdBefore`. Pass `nextCursor` from the previous response as `cursor` until `hasMore` is false."
          },
          "response": []
        },
        {
          "name": "Create an identity check",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/identity-checks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "identity-checks"
              ]
            },
            "description": "Creates an identity check and sends its link to the person over `channel`: `EMAIL` needs `email` and `SMS` needs `phone`.\n\nWith `nationalId`, BankID verifies that the person's national identity number matches it. Without it, BankID verifies that their name matches `fullName`.\n\nThe response is the only one that includes `verificationUrl` and `token`. Each check counts toward your monthly identity check quota.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"fullName\": \"Kai Lindqvist\",\n  \"email\": \"kai@example.com\",\n  \"channel\": \"EMAIL\",\n  \"reference\": \"HR-2026-0142\",\n  \"language\": \"sv\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "var response = {};",
                  "try { response = pm.response.json(); } catch (error) {}",
                  "var save = function (key, value) {",
                  "  if (!value) { return; }",
                  "  pm.collectionVariables.set(key, value);",
                  "  if (pm.environment.name) { pm.environment.set(key, value); }",
                  "};",
                  "save('identityCheckId', response.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Get an identity check",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/identity-checks/{{identityCheckId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "identity-checks",
                "{{identityCheckId}}"
              ]
            },
            "description": "Returns one identity check, with its audit log and verification data, such as the BankID result. The national identity number is encrypted and never returned."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "List all webhooks",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only webhooks created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only webhooks created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "updatedAfter",
                  "value": "",
                  "description": "Only webhooks updated at or after this ISO 8601 date or date-time. Use it for incremental sync.",
                  "disabled": true
                },
                {
                  "key": "updatedBefore",
                  "value": "",
                  "description": "Only webhooks updated at or before this ISO 8601 date or date-time.",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve a paginated list of all webhooks in your organization.\n\nWebhooks allow you to receive real-time notifications when events occur in your workspace (e.g., document signed, contact created).\n\n**Pagination:** Pass `nextCursor` from the previous response as `cursor` until `hasMore` is false."
          },
          "response": []
        },
        {
          "name": "Create a new webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks"
              ]
            },
            "description": "Create a new webhook subscription for your workspace.\n\n**Required Fields:**\n- `url` - URL that receives a POST request for each event\n- `events` - The event types to subscribe to, such as `document.completed`\n\n**Optional Fields:**\n- `secret` - Signing secret in the Standard Webhooks format, `whsec_<base64>`. sajn generates one when omitted, and the response returns it once\n- `enabled` - Whether the webhook is active (default: true)\n- `apiVersion` - API version, such as `2026-10`, that determines the body this endpoint receives. Defaults to the API version of this request. The endpoint keeps this version until you change it with `PATCH /api/v1/webhooks/:id`\n\n**Delivery:** each event is a POST with the body `{ id, type, createdAt, apiVersion, workspaceId, environment, actor, data }`, the same object `GET /api/v1/events/:id` returns. `data.object` is the resource the event is about. The request follows [Standard Webhooks](https://www.standardwebhooks.com): `webhook-id` is the event `id`, `webhook-timestamp` is the send time in Unix seconds, and `webhook-signature` is `v1,<base64 HMAC-SHA256>` over `<webhook-id>.<webhook-timestamp>.<raw body>`, keyed with the base64-decoded secret after `whsec_`. Any Standard Webhooks library verifies it. Return a 2xx status code within 30 seconds. sajn retries any other answer, a timeout, and a network error with backoff for about three days, and stops at once on `410 Gone`. Delivery is at least once, so deduplicate on `webhook-id`.\n\n**Event types:** `events` takes the following values:\n- Document, with the document in `data.object`: `document.created` (with `data.source`), `document.sent`, `document.fully_signed`, `document.completed`, `document.rejected`, `document.expired`, `document.withdrawn`, `document.updated`, `document.deleted`, `document.restored`, `document.archived`, `document.unarchived`, `document.expiration_extended`, `document.expiring_soon`, and `document.comment.created`, with the comment in `data.object`\n- Party, with the document in `data.object` and the party in `data.party`: `document.party.sent`, `document.party.delivery_failed`, `document.party.opened`, `document.party.read`, `document.party.signed`, `document.party.rejected`, `document.party.delegated`, `document.party.auth_failed`, `document.party.verified`, `document.party.updated`, `document.party.added`, `document.party.removed`, `document.party.reminded`\n- Bundle, with the bundle in `data.object`: `bundle.sent`, `bundle.party.signed`, `bundle.completed`, `bundle.cancelled`\n- Archive import, with the import in `data.object`: `archive_import.completed`, once per run, and `archive_import.undone`\n- Approval: `approval_request.created`, `approval_request.approved`, `approval_request.rejected`, `approval_request.cancelled`\n- Identity check: `identity_check.created`, `identity_check.sent`, `identity_check.opened`, `identity_check.verified`, `identity_check.failed`, `identity_check.cancelled`\n- Contact, company and template: `contact.created`, `contact.updated`, `contact.deleted`, `company.created`, `company.updated`, `company.deleted`, `template.created`, `template.updated`, `template.deleted`, `template.restored`\n- Form: `form.submitted`, with the same fields as `GET /api/v1/forms/:id/submissions/:submissionId`\n- Workspace: `workspace.created`, `member.added`, `member.invited`, `member.invite_accepted`\n- sajn Login: `login.completed`, `login.failed`, with the login session in `data.object`\n- Security, a feed for a SIEM: `security.document_downloaded`, `security.documents_exported`, `security.signature_identity_accessed`, `security.member_removed`, `security.member_role_changed`, `security.role_updated`, `security.workspace_retention_updated`\n- Usage: `usage.limit_reached`\n\n**Plan Requirement:** Requires the Team plan or higher, or a sandbox organization.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://example.com/webhooks/sajn\",\n  \"events\": [\n    \"document.fully_signed\",\n    \"document.completed\"\n  ],\n  \"failureNotificationEmail\": \"dev@example.com\",\n  \"apiVersion\": \"2026-10\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a webhook by ID",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/webhooks/{{webhookId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "{{webhookId}}"
              ]
            },
            "description": "Retrieve detailed information about a specific webhook including the event types it subscribes to. The response leaves out `secret`, which only creating the webhook and rotating its secret return."
          },
          "response": []
        },
        {
          "name": "Update a webhook",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/webhooks/{{webhookId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "{{webhookId}}"
              ]
            },
            "description": "Update webhook properties. Every field is optional, and an omitted field keeps its value.\n\nTo move the endpoint to a newer payload shape, set `apiVersion`. Every delivery after the change uses the new version, including retries of earlier events.\n\nTo replace the signing secret, use `POST /api/v1/webhooks/:id/rotate-secret`.\n\n**Plan Requirement:** Requires the Team plan or higher, or a sandbox organization.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"events\": [\n    \"document.fully_signed\",\n    \"document.completed\",\n    \"document.rejected\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a webhook",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/webhooks/{{webhookId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "{{webhookId}}"
              ]
            },
            "description": "Deletes a webhook subscription, with its event subscriptions and delivery log.\n\n**Plan Requirement:** Requires the Team plan or higher, or a sandbox organization."
          },
          "response": []
        },
        {
          "name": "Rotate a webhook's signing secret",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/webhooks/{{webhookId}}/rotate-secret",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "{{webhookId}}",
                "rotate-secret"
              ]
            },
            "description": "Generates a new signing secret and returns the webhook with it in `secret`. Store it: no other response returns it.\n\nFor 24 hours, every delivery carries two signatures in `webhook-signature`, one per secret, so you can deploy the new secret without dropping deliveries. A Standard Webhooks library accepts a request when any signature matches. After 24 hours, only the new secret signs.\n\n**Plan Requirement:** Requires the Team plan or higher, or a sandbox organization."
          },
          "response": []
        },
        {
          "name": "Send a test event to a webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/webhooks/{{webhookId}}/test",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "{{webhookId}}",
                "test"
              ]
            },
            "description": "Sends a `webhook.test` event to this webhook only, signed and delivered like any other event in the webhook's API version, and returns the delivery with `status: PENDING`. `data.object` is the webhook's `id` and `url`. Follow the delivery with `GET /api/v1/webhooks/:id/deliveries/:deliveryId`. The event isn't listed in `GET /api/v1/events`, and no other webhook receives it.\n\nReturns `409 INVALID_STATE` when the webhook is disabled or paused.\n\n**Plan Requirement:** Requires the Team plan or higher, or a sandbox organization."
          },
          "response": []
        },
        {
          "name": "Reactivate a paused webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/webhooks/{{webhookId}}/reactivate",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "{{webhookId}}",
                "reactivate"
              ]
            },
            "description": "Resumes deliveries to a webhook that sajn paused, and returns the webhook with `status: ENABLED`. sajn pauses a webhook when every delivery attempt failed for three days, or when the endpoint answered `410 Gone`. Events from the pause are kept as failed deliveries; to send one, retry it with `POST /api/v1/webhooks/:id/deliveries/:deliveryId/retry`.\n\nReturns `409 INVALID_STATE` when the webhook isn't paused, or is disabled. To turn on a disabled webhook, set `enabled` with `PATCH /api/v1/webhooks/:id`.\n\n**Plan Requirement:** Requires the Team plan or higher, or a sandbox organization."
          },
          "response": []
        },
        {
          "name": "List webhook deliveries",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/webhooks/{{webhookId}}/deliveries",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "{{webhookId}}",
                "deliveries"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "type",
                  "value": "document.created",
                  "description": "Filter by event type, such as `document.completed`. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "eventId",
                  "value": "",
                  "description": "Only deliveries of this event, the `id` from `GET /api/v1/events`.",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "SUCCESS",
                  "description": "Filter by delivery status: `SUCCESS`, `FAILED` or `PENDING`. Comma-separated or repeated.",
                  "disabled": true
                }
              ]
            },
            "description": "Returns a webhook's deliveries from the last 7 days, newest first. A delivery is one event sent to this endpoint, with every attempt to send it in `attempts`. Filter by `type` or `status`, or by `eventId` to see what happened to one event."
          },
          "response": []
        },
        {
          "name": "Get a single webhook delivery",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/webhooks/{{webhookId}}/deliveries/{{deliveryId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "{{webhookId}}",
                "deliveries",
                "{{deliveryId}}"
              ]
            },
            "description": "Returns a webhook delivery with every attempt, including the request and response headers and bodies."
          },
          "response": []
        },
        {
          "name": "Replay a webhook delivery",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/webhooks/{{webhookId}}/deliveries/{{deliveryId}}/retry",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "{{webhookId}}",
                "deliveries",
                "{{deliveryId}}",
                "retry"
              ]
            },
            "description": "Sends a past delivery again, with the body it had, and returns the new delivery with `status: PENDING` and no attempts. Its `replayOfId` is this delivery's ID, and its attempts appear in `GET /api/v1/webhooks/:id/deliveries/:deliveryId` once sajn sends it. The event `id`, and so `webhook-id`, stays the same, so a receiver that deduplicates on it ignores the replay of an event it already processed.\n\nReturns `409 INVALID_STATE` when the webhook is disabled or paused, or the delivery is older than 7 days. Reactivate a paused webhook with `POST /api/v1/webhooks/:id/reactivate` first."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Events",
      "item": [
        {
          "name": "List events",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/events",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "events"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Maximum number of items to return, from 1 to 100. Default: 25.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The `nextCursor` from the previous response, to get the next page. Keep the other parameters unchanged.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "total",
                  "description": "`total` adds the number of items that match the filters. Counting takes time, so ask for it only when you need it.",
                  "disabled": true
                },
                {
                  "key": "type",
                  "value": "document.created",
                  "description": "Filter by event type, such as `document.completed`. Comma-separated or repeated.",
                  "disabled": true
                },
                {
                  "key": "createdAfter",
                  "value": "",
                  "description": "Only events created at or after this ISO 8601 date or date-time.",
                  "disabled": true
                },
                {
                  "key": "createdBefore",
                  "value": "",
                  "description": "Only events created at or before this ISO 8601 date or date-time.",
                  "disabled": true
                }
              ]
            },
            "description": "Returns every event the workspace emitted in the last 30 days, newest first, whether or not a webhook was subscribed to it. Each event is the object a webhook delivery on your API version carries as its body.\n\nIf a webhook on API version `2026-10` was subscribed to the event type when the event happened, `data.object` is a snapshot from that moment. Otherwise sajn didn't record the object, and `data.object` is the resource as it is when you read the event. An event whose resource no longer exists is left out, so a page can hold fewer than `limit` events.\n\nPagination is keyset: follow `nextCursor` until it is `null`. New events arriving while you page never shift the window, so a full walk with `createdAfter` set to your last known timestamp is a complete reconcile even though webhooks are delivered at least once."
          },
          "response": []
        },
        {
          "name": "Get an event",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/events/{{eventId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "events",
                "{{eventId}}"
              ]
            },
            "description": "Returns a single event, the same object a webhook delivery carries as its body. Use it to read an event again by the `webhook-id` of a delivery. `data.object` follows the same snapshot rule as `GET /api/v1/events`, and an event whose resource no longer exists returns `404`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Helpers",
      "item": [
        {
          "name": "List countries",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/helpers/countries",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "helpers",
                "countries"
              ]
            },
            "description": "Returns every country a party can be in, as the ISO 3166-1 alpha-2 code that a party's `country` takes, with its English name."
          },
          "response": []
        },
        {
          "name": "List ISO 4217 currencies",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/helpers/currencies",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "helpers",
                "currencies"
              ]
            },
            "description": "Returns the supported currency codes (ISO 4217). Useful when modelling monetary contract values."
          },
          "response": []
        },
        {
          "name": "List supported languages",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/helpers/languages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "helpers",
                "languages"
              ]
            },
            "description": "Returns the language codes supported by the platform for signing UI, emails, and document metadata."
          },
          "response": []
        },
        {
          "name": "List IANA timezones",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/helpers/timezones",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "helpers",
                "timezones"
              ]
            },
            "description": "Returns IANA timezone identifiers (e.g. `Europe/Stockholm`). Useful for scheduling, expiry, and reminder configuration."
          },
          "response": []
        },
        {
          "name": "List selectable signature methods",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/helpers/signature-methods",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "helpers",
                "signature-methods"
              ]
            },
            "description": "Returns the signature methods you can offer a signer, with display labels \u2014 the generic methods plus every currently-available eID scheme.\n\nThis is the *pickable* set, not every accepted value. `NONE` and `MANUAL` are still accepted on `signatureMethod` but are omitted here because the app derives them rather than offering them: `NONE` is what a party gets when its role isn't a signing role, and `MANUAL` is for an imported archive document that was already signed on paper.\n\nBuild signature-method pickers from this rather than hard-coding the list: eID schemes are switched on per market over time, and sending a scheme that isn't available yet is rejected with *\"This eID scheme is not yet available\"*.\n\n`SE_BANKID` is Swedish BankID. API version `2026-09` calls it `BANKID`."
          },
          "response": []
        },
        {
          "name": "List selectable verification methods",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Sajn-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/helpers/two-step-verifications",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "helpers",
                "two-step-verifications"
              ]
            },
            "description": "Returns the methods accepted by a party's `signVerification` and a document's `openVerification`, with display labels. `signVerification` runs before the party signs; `openVerification` runs before the document opens. null on either means no verification, so it isn't listed.\n\nSame rule as `/helpers/signature-methods`: build pickers from this rather than hard-coding, since the eID-backed methods become available as those schemes go live per market."
          },
          "response": []
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://app.sajn.se"
    },
    {
      "key": "apiKey",
      "value": ""
    },
    {
      "key": "apiVersion",
      "value": "2026-10"
    },
    {
      "key": "approvalRequestId",
      "value": ""
    },
    {
      "key": "blockId",
      "value": ""
    },
    {
      "key": "bundleId",
      "value": ""
    },
    {
      "key": "companyId",
      "value": ""
    },
    {
      "key": "contactId",
      "value": ""
    },
    {
      "key": "contentId",
      "value": ""
    },
    {
      "key": "customFieldId",
      "value": ""
    },
    {
      "key": "deliveryId",
      "value": ""
    },
    {
      "key": "documentId",
      "value": ""
    },
    {
      "key": "embedSessionId",
      "value": ""
    },
    {
      "key": "eventId",
      "value": ""
    },
    {
      "key": "fileId",
      "value": ""
    },
    {
      "key": "fileType",
      "value": "SIGNED"
    },
    {
      "key": "folderId",
      "value": ""
    },
    {
      "key": "formId",
      "value": ""
    },
    {
      "key": "identityCheckId",
      "value": ""
    },
    {
      "key": "linkId",
      "value": ""
    },
    {
      "key": "memberInviteId",
      "value": ""
    },
    {
      "key": "orgNumber",
      "value": ""
    },
    {
      "key": "partyId",
      "value": ""
    },
    {
      "key": "roleId",
      "value": ""
    },
    {
      "key": "sessionId",
      "value": ""
    },
    {
      "key": "signingUrl",
      "value": ""
    },
    {
      "key": "submissionId",
      "value": ""
    },
    {
      "key": "tagId",
      "value": ""
    },
    {
      "key": "templateId",
      "value": ""
    },
    {
      "key": "threadId",
      "value": ""
    },
    {
      "key": "userId",
      "value": ""
    },
    {
      "key": "webhookId",
      "value": ""
    }
  ]
}
