Create an embed session
Start an embedded signing session for one party of a sent document, to show in your own page with the sajn embed SDK.
Flow:
POSThere from your server when the party opens your page.- Return
clientSecretto your page and hand it to the SDK, infetchClientSecret. - The SDK frames
/embed/v2/{id}and the frame redeems the secret. The party signs in the frame. - Confirm the outcome with the
document.party.signedwebhook. Events in the browser are hints, not proof.
The session decides what the frame may do: features, appearance and origins can’t be changed from the browser. A session lasts at most 24 hours, and ends after an hour without activity. When it ends, the SDK calls fetchClientSecret again, so keep that endpoint cheap.
Embedded signing is turned on per organization by sajn. Each origin must match one of the organization’s embed domains. Create sessions with an API key: an OAuth app can’t, because a session ends when the key that created it is rotated or deleted.
Authorizations
Personal API key, e.g. Authorization: Bearer sajn_sk_.... Not scope-limited — acts as the issuing user.
Headers
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.
2026-09, 2026-10 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.
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.
255Body
Body
A sent document.
1The party who signs in the frame.
1What the frame shows. signing lets the party sign a sent document. viewing shows a sent or completed document to any party, read-only.
signing, viewing 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.
1 - 10 elements1 - 512Extra pages further up the frame chain, when your page is itself framed, such as inside a CRM.
101 - 512What the party may do besides signing. Leave a feature out for its default.
Narrows how the party can draw a signature. Your workspace setting is the ceiling.
3DRAW, TYPE, UPLOAD The frame's language. Defaults to the document's language.
sv, en, no, da, fi, de, is, es, fr, it Your own reference, returned on every frame event.
255Where 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.
2048Response
200
The session id. Pass it to the SDK, or put it in the frame URL: it is not a secret.
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.
When clientSecret expires if the frame hasn't redeemed it. Create a new session after this time.
When the session ends, at the latest. It also ends after an hour without activity.
The document ID.
The party ID.

