Postman
Import ready-made Postman collections and an environment for the sajn API
The Postman starter kit lets you make your first authenticated request, create resources, and explore every endpoint without writing requests by hand.
Download the files
- API reference collection
- Getting started collection
- Document lifecycle collection
- Contacts and parties collection
- Environment
Each link downloads a JSON file.
Getting started
A health check, your first list requests, and creating a contact and a document.
Document lifecycle
Create a contact and a document, add the contact as a party, send the document, get the signing URL, and get the signed PDF.
Contacts and parties
Create a contact, find it by email, update it, and add it to a document as a party.
API reference
Every endpoint, generated from the OpenAPI specification and grouped like the API reference.
Import the collections
- Download the collections you want and the environment.
- In Postman, click Import and select the JSON files.
- Open the imported sajn Local environment.
- Set
apiKeyto an API key from Inställningar > Utvecklare > API-nycklar. For more information, see Authentication. - Leave
baseUrlset tohttps://app.sajn.se. A sandbox key reaches your sandbox through the same URL. - Select sajn Local as the active environment.
Variables
The collections share variables through the environment, so one request can use what an earlier request returned, even in another collection:
| Variable | Purpose | Default |
|---|---|---|
apiKey | Bearer token for every request | Empty |
apiVersion | Sent as the Sajn-Version header on every request | 2026-10 |
baseUrl | Base URL of the API | https://app.sajn.se |
contactId, documentId, partyId, signingUrl | Values that the workflow collections capture from responses | Empty |
identityCheckId, fileId, approvalRequestId | IDs that the create requests in the API reference collection capture | Empty |
fileType | File that Get a document file returns: ORIGINAL, SIGNED, or JOURNAL | SIGNED |
Every other path parameter, such as templateId or webhookId, has an empty variable of the same name in the environment. Set it before you run a request that uses it.
Test scripts save each captured value to the collection and to the active environment. List requests include every query parameter that the endpoint accepts, turned off; turn on the ones you need. To retry a write safely, turn on the Idempotency-Key header, which sends a new GUID with each request. For more information, see Idempotency.
To test against another API version, change apiVersion. For the supported versions, see API versioning.
Run the requests in order
- In the getting started collection, run Health check.
- Run List all documents or List all contacts to confirm that the key works.
- Run Create a new contact, then Create a new document.
- In the document lifecycle collection, run the requests from Create a new contact to Get a party with signing URL.
- To sign as the contact, open the
signingUrlvalue in a browser. The example parties useexample.comaddresses, so they don't receive the signing email. - After every party has signed, run Get a document file.
Create a new document creates a draft with one party, Maja Holm, who signs for a company. It also sets expiresAt, because a document needs an expiration date before you can send it. Change the date to one that suits your test.
Get a document file returns 409 INVALID_STATE until the file exists. The signed PDF exists after every party has signed, including Maja Holm. Create a new document saves her party ID in partyId, and Add a party to document replaces it with the contact's. To get her signing URL, copy her ID from parties in the Create a new document response into partyId, and run Get a party with signing URL again.
If Send document for signing returns 409 APPROVAL_REQUIRED, the document needs an approval before you can send it. To request one, use Request approval of a document.
How the collections stay current
sajn generates the collections from the same OpenAPI specification as the API reference. When the API changes, the collections are regenerated, so request URLs, methods, and example bodies match the docs.
Was this page helpful?
Last updated on