Skip to Content
Approval requests

Request approval of a document

POST
/api/v1/approval-requests

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.

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

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

Permission required: SEND_DOCUMENT on the workspace.

Authorization

headerAuthorizationBearer <token>

API key, e.g. Authorization: Bearer sajn_svc_.... Not scope-limited: acts with its owner's workspace role.

Header Parameters

Sajn-Version?string

API version for this request. Without it, the request uses the organization's default version; an organization without a default is pinned to the latest version by its first request.

Value in"2026-09""2026-10"
Sajn-Workspace?string

ID of the workspace this request acts in, from GET /api/v1/workspaces. Without it, an API key acts in its default workspace. The token's user must be a member of the workspace; an OAuth token only accepts the workspace it was granted for. A workspace that doesn't exist or can't be reached returns 403 WORKSPACE_ACCESS_DENIED.

Idempotency-Key?string

Makes retries safe. A retry with the same key and the same request replays the stored response for 24 hours (header Idempotent-Replayed: true); the same key with a different request returns 400.

Lengthlength <= 255

Request Body

Body

application/json
  1. body

Request internal approval of a document

documentId*string

ID of a DRAFT document

Length1 <= length
approverIds?array<>

User IDs of the approvers. Every one of them must approve, in any order. Omit it to submit the approvers already on the document, such as the ones its template adds. To list members who can approve, call GET /api/v1/members?permission=APPROVE_DOCUMENT.

Items1 <= items
customMessage?string

Message to include in the signing invitation when the approved document is sent. Requires approverIds.

Response Body

An internal approval request for a document

application/json
  1. response

An internal approval request for a document

id*string

Approval request ID

documentId*string

The document ID.

status*string

DRAFT while the document is a draft and the request isn't submitted, such as approvers a template added or a request whose document was withdrawn; PENDING while it waits for approvers; APPROVED once every stage approves; REJECTED after any approver rejects; CANCELLED only in the response to the cancel request and in the approval_request.cancelled event, because a cancelled request is deleted.

Value in"DRAFT""PENDING""APPROVED""REJECTED""CANCELLED"
autoSend*boolean

If true, sajn sends the document for signing when the request is approved. If false, the document waits for you to send it.

customMessage*|

The message included in the signing invitation when the document is sent

requestedBy*

The user who submitted the request

approvers*array<>

The approvers, ordered by stage

createdAt*string

When the approval was created.

Formatdate-time
updatedAt*string

When the approval was last updated.

Formatdate-time
Example Request
curl -X POST 'https://app.sajn.se/api/v1/approval-requests' \  -H 'Content-Type: application/json' \  -d '{  "documentId": "cm4k2x9p10003abcd1234efgh",  "approverIds": [    "cm4k2x9p10041abcd1234efgh"  ]}'
Example Response
{  "id": "cm4k2x9p10029abcd1234efgh",  "documentId": "cm4k2x9p10003abcd1234efgh",  "status": "APPROVED",  "autoSend": false,  "customMessage": "Påminnelse: signera ditt anställningsavtal senast den 28 oktober.",  "requestedBy": {    "id": "cm4k2x9p10002abcd1234efgh",    "email": "alex@example.com",    "name": "Alex Berg"  },  "approvers": [    {      "user": {        "id": "cm4k2x9p10002abcd1234efgh",        "email": "alex@example.com",        "name": "Alex Berg"      },      "stage": 1,      "orGroup": "Quinn Holm",      "status": "APPROVED",      "comment": "Godkänt enligt lönepolicyn.",      "resolvedAt": "2026-09-29T07:41:00.000Z"    }  ],  "createdAt": "2026-09-28T09:12:00.000Z",  "updatedAt": "2026-09-28T09:15:00.000Z"}

Was this page helpful?