Skip to main content
POST
Create an embed session
Embedding v2 is in beta, and this endpoint can change in ways that break your integration before its first stable release, estimated for November 2026. See Embedding v2.

Authorizations

Authorization
string
header
required

Personal API key, e.g. Authorization: Bearer sajn_sk_.... Not scope-limited — acts as the issuing user.

Headers

Sajn-Version
enum<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.

Available options:
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.

Maximum string length: 255

Body

application/json

Body

documentId
string
required

A sent document.

Minimum string length: 1
partyId
string
required

The party who signs in the frame.

Minimum string length: 1
type
enum<string>
default:signing

What the frame shows. signing lets the party sign a sent document. viewing shows a sent or completed document to any party, read-only.

Available options:
signing,
viewing
origins
string[]

The pages that may show the frame, such as https://app.example.com. Each must match one of your organization's embed domains. Leave it out to allow every embed domain.

Required array length: 1 - 10 elements
Required string length: 1 - 512
ancestorOrigins
string[]

Extra pages further up the frame chain, when your page is itself framed, such as inside a CRM.

Maximum array length: 10
Required string length: 1 - 512
features
object

What the party may do besides signing. Leave a feature out for its default.

appearance
object
signatureInputModes
enum<string>[]

Narrows how the party can draw a signature. Your workspace setting is the ceiling.

Maximum array length: 3
Available options:
DRAW,
TYPE,
UPLOAD
locale
enum<string>

The frame's language. Defaults to the document's language.

Available options:
sv,
en,
no,
da,
fi,
de,
is,
es,
fr,
it
externalId
string

Your own reference, returned on every frame event.

Maximum string length: 255
bankIdReturnUrl
string

Where the BankID app sends the party after signing on the same phone. An https URL on one of your embed domains, or your native app's URL scheme, such as myapp://signed. Leave it out and the BankID app returns the party to the browser they came from.

Maximum string length: 2048

Response

200

id
string
required

The session id. Pass it to the SDK, or put it in the frame URL: it is not a secret.

clientSecret
string
required

Hand this to the SDK in the browser. The frame redeems it once, within 10 minutes. Never log it or put it in a URL.

clientSecretExpiresAt
string<date-time>
required

When clientSecret expires if the frame hasn't redeemed it. Create a new session after this time.

expiresAt
string<date-time>
required

When the session ends, at the latest. It also ends after an hour without activity.

documentId
string
required

The document ID.

partyId
string
required

The party ID.