sajn ID
Verify a person with Swedish BankID, outside of signing a document
sajn ID verifies a person's identity with Swedish BankID, without a document to sign. Use it to check who someone is before you give them access to a service or complete a transaction. sajn sends the person a link, they identify themselves with BankID, and you read the result.
In the API, a sajn ID verification is an identity check, at /api/v1/identity-checks.
Overview
sajn ID checks the BankID identity in one of two ways:
- By national ID. If you send
nationalId, BankID verifies the identity, and sajn checks that the personal number matches. - By name. Without
nationalId, sajn checks that the name matchesfullName.
How it works
flowchart LR
a["You create a verification"] --> b["sajn sends the link<br/>by email or SMS"]
b --> c["The person opens the link"]
c --> d["The person identifies<br/>with BankID"]
d --> e["You read the result"]The verification's status follows these steps, from CREATED to VERIFIED or FAILED. A verification that isn't completed in time becomes EXPIRED.
Verification statuses
| Status | Description |
|---|---|
CREATED | Verification created but not sent |
SENT | Verification sent to recipient |
OPENED | Recipient opened verification link |
VERIFIED | Successfully verified |
FAILED | Verification failed |
EXPIRED | Verification link expired |
CANCELLED | Verification was cancelled |
Create a verification
Creating a verification through the API sends it to the person right away, over the channel you choose. To create one, call POST /identity-checks. The response is the identity check, and it's the only response that includes verificationUrl.
Verify by national ID
Send the personal number in the nationalId field:
{
"fullName": "Alex Lindqvist",
"nationalId": "197001011234",
"email": "alex@example.com",
"channel": "EMAIL",
"reference": "onboarding-4711",
"language": "sv"
}language is optional, and takes an ISO 639-1 code, such as sv or en.
In API version 2026-09, this field is ssn.
Verify by name
Leave out nationalId:
{
"fullName": "Alex Lindqvist",
"email": "alex@example.com",
"channel": "EMAIL",
"reference": "onboarding-4712"
}Delivery channels
sajn sends the verification link by email:
{
"channel": "EMAIL",
"email": "alex@example.com"
}SMS
sajn sends the verification link by SMS:
{
"channel": "SMS",
"phone": "+46701234567"
}API-created verifications use EMAIL or SMS. The channel that the API returns can also be IN_APP, for verifications delivered inside the sajn app.
Verification data
When the identity_check.verified webhook event arrives, get the identity check once to read the BankID response in data. The event doesn't carry it. The following excerpt shows the relevant fields:
{
"id": "cm4k2x9p80010abcd0123ghij",
"status": "VERIFIED",
"fullName": "Alex Lindqvist",
"verifiedAt": "2026-10-01T10:30:00.000Z",
"data": {
"bankIdName": "Alex Lindqvist",
"bankIdResponse": {
"user": {
"personalNumber": "197001011234",
"name": "Alex Lindqvist",
"givenName": "Alex",
"surname": "Lindqvist"
},
"device": {
"ipAddress": "192.0.2.1"
}
}
}
}In the list from GET /identity-checks, data is null. Reading it requires the VIEW_SAJN_ID workspace permission, and sajn records each read in the organization's audit log.
Use cases
Customer onboarding
Verify a customer's identity when they sign up:
{
"fullName": "Alex Lindqvist",
"nationalId": "197001011234",
"email": "alex@example.com",
"channel": "EMAIL",
"reference": "signup-4714"
}Identity without a personal number
Verify a person by name, without collecting their personal number:
{
"fullName": "Alex Lindqvist",
"email": "alex@example.com",
"channel": "EMAIL",
"reference": "signup-4713"
}Before a contract
Verify a person, and link the verification to their contact, before you send them a contract:
{
"fullName": "Alex Lindqvist",
"nationalId": "197001011234",
"email": "alex@example.com",
"channel": "EMAIL",
"contactId": "cm4k2x9p40006abcd3456qrst",
"reference": "contract-4715"
}Link to a contact
To link a verification to a contact, send contactId:
{
"fullName": "Alex Lindqvist",
"email": "alex@example.com",
"channel": "EMAIL",
"contactId": "cm4k2x9p40006abcd3456qrst"
}The verification then appears with the contact.
Audit log
An identity check that you get by ID includes its audit log in audits. In a list, audits is null. The following excerpt shows one entry:
{
"audits": [
{
"id": "cm4k2x9p90012abcd5678mnop",
"type": "ID_SENT",
"createdAt": "2026-10-01T10:01:00.000Z",
"data": { "channel": "EMAIL", "recipient": null, "isResending": false },
"name": null,
"email": null,
"ipAddress": null,
"userAgent": null
}
]
}The audit log types are ID_CREATED, ID_SENT, ID_RESENT, ID_OPENED, ID_VERIFIED, ID_FAILED, ID_EXPIRED, ID_CANCELED, and ID_REVOKED.
Expiration
A verification and its link expire 7 days after creation by default. To set another expiration, send expiresAt when you create the verification. It must be in the future:
{
"expiresAt": "2030-01-22T23:59:59.000Z"
}The current expiration is returned as expiresAt on the verification object.
Billing
Creating a sajn ID verification counts toward your monthly sajn ID quota and is billed according to your plan.
Security
Token security
Verification tokens are single use, and expire after completion or when the verification expires.
Personal number encryption
sajn encrypts the nationalId you send at rest and never returns it. The BankID response in data is returned only to users with the VIEW_SAJN_ID permission.
Audit trail
The audit log records every step of the verification.
BankID security
The identity check runs through Swedish BankID.
Best practices
Reference IDs
Send a reference to link the verification to your own records
Set an expiration
Use expiresAt to control how long the verification link stays valid
Collect less
Send nationalId only when you need it. Verifying by name collects less personal data
Use webhooks
Subscribe to the identity_check.verified and identity_check.failed webhook events instead of polling
Next steps
Was this page helpful?
Last updated on