Download the files
- API reference collection
- Getting started collection
- Document lifecycle collection
- Contacts and parties collection
- Environment
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:
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.
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.

