Skip to main content
A sandbox is a separate sajn organization, linked to your production one, where you can build and test an integration without spending money or producing legally binding documents. It runs the same code and the same API as production. Only the parts that cost money or carry legal weight are short-circuited: BankID is mocked, sealed PDFs are watermarked and left uncertified, and nothing is billed.
There is no separate sandbox host. A sandbox uses the same base URL, https://app.sajn.se. The API key you send decides which environment you reach.

Create a sandbox

  1. In the sajn app, go to Inställningar > Utvecklare > Sandbox.
  2. Click Skapa sandbox-miljö.
  3. Open the sandbox, and create an API key in it the same way you do in production. Sandbox keys start with sajn_dev_. For more information, see Authentication.
Creating a sandbox requires the Manage billing permission. You can’t create a sandbox from inside another sandbox. How many you can keep depends on your plan: If you downgrade, the oldest sandboxes stay active and the surplus is paused. Re-upgrading reactivates exactly what was paused. A paused sandbox can’t be opened, and its API keys stop working.

What differs from production

A document signed in a sandbox is not a valid signed document. It carries no PAdES seal, the BankID identity behind it is fabricated, and every page is watermarked. Never use a sandbox for a real agreement.

Limits

A sandbox doesn’t inherit your plan’s headroom. Its own ceilings apply:

The 100-document limit

The document limit counts documents sent in the current calendar month (UTC), across every status a sent document can settle in: pending, completed, expired, cancelled, or rejected. Drafts don’t count, and neither do documents you delete after sending. The counter resets at the start of each month. You can’t raise it. To start over before the month ends, create a new sandbox. When the limit is reached, POST /api/v1/documents/{id}/send returns an HTTP 403 Forbidden status code with the error code LIMIT_EXCEEDED:
In API version 2026-09, the status code is 400 Bad Request and the body holds only the Swedish message. For every error code, see Errors. To keep a test suite well inside the limit, reuse a small set of documents and drive the signing flow repeatedly instead of sending a new document for each assertion.

Tell the environments apart

Every webhook event has an environment property, set to SANDBOX or PRODUCTION. Use it when both environments post to the same endpoint. For more information, see Webhook payloads. To check which organization and workspace a key points at, call GET /api/v1/me.

Delete a sandbox

In Inställningar > Utvecklare > Sandbox, click the delete icon next to the sandbox. sajn permanently deletes everything in it, including documents, templates, contacts, and uploaded files. Deleting a sandbox frees a slot, so deleting and creating one is also how you reset a sandbox to an empty state.

Next steps

Authentication

Create an API key in your sandbox

Quickstart

Send your first document

Webhooks

Route sandbox and production deliveries

Signing certificate

What the finished PDF records