Documentation Index Fetch the complete documentation index at: https://docs.sajn.se/llms.txt
Use this file to discover all available pages before exploring further.
Webhooks
sajn can send webhook notifications to your server when events occur in your account. This allows you to build integrations that react to document signings, contact changes, identity checks, and more.
Setup
Webhooks are configured per workspace under Settings > Developer > Webhooks . When creating a webhook you provide:
Field Required Description URL Yes The endpoint that will receive POST requests. Must be publicly reachable (HTTPS recommended). Events Yes Which events to subscribe to. Secret No A shared secret sent in the X-Sajn-Secret header so you can verify requests.
The URL is validated on creation — sajn will resolve the hostname, block private/internal IPs (SSRF protection), and send a test POST to confirm the endpoint is reachable.
All webhooks are sent as POST requests with a JSON body:
{
"event" : "DOCUMENT_SIGNED" ,
"payload" : { ... },
"createdAt" : "2026-04-16T12:00:00.000Z" ,
"webhookEndpoint" : "https://your-server.com/webhook"
}
Header Description Content-Typeapplication/jsonX-Sajn-SecretThe secret you configured (empty string if not set). Use this to verify that the request came from sajn.
Verifying Requests
Compare the X-Sajn-Secret header value against the secret you configured when creating the webhook. Reject requests that don’t match.
Delivery
Webhooks are dispatched asynchronously via a background job queue.
Each webhook call is logged with request/response details and kept for 72 hours .
If delivery fails (network error or non-2xx response), an in-app notification is sent to organization members who have enabled webhook failure notifications.
There is no automatic retry . If delivery fails, you can inspect the call log in the dashboard and resend manually or handle it on your end.
Events
Document Events
These events fire on document-level state changes. The payload is a Document object .
Event Description DOCUMENT_CREATEDA new document was created. DOCUMENT_SENTThe document was sent out to its signers. DOCUMENT_SIGNEDAll signers have signed the document. DOCUMENT_COMPLETEDThe document has been sealed and is fully completed. DOCUMENT_REJECTEDThe document was rejected (by any signer). DOCUMENT_EXPIREDThe document passed its expiration date while still pending. DOCUMENT_WITHDRAWNThe document was withdrawn by the sender.
Party Events (per signer)
These events fire when a specific signer takes action. The payload is a Document + Party object .
Event Description DOCUMENT_PARTY_SENTThe signing notification was sent to a signer. DOCUMENT_PARTY_DELIVERY_FAILEDThe signing notification failed to deliver to a signer. DOCUMENT_PARTY_OPENEDA signer opened the signing link. DOCUMENT_PARTY_READA signer read/scrolled through the document. DOCUMENT_PARTY_SIGNEDA signer signed the document. DOCUMENT_PARTY_REJECTEDA signer rejected the document.
Reminder Events
Reminder events also use the Document + Party object .
Event Description DOCUMENT_REMINDER_AUTOMATICAn automatic scheduled reminder was sent to a signer. DOCUMENT_REMINDER_MANUALA manual reminder was sent to a signer by the document owner.
Identity Check Events
These events fire during the identity verification flow. The payload is an Identity Check object .
Event Description ID_CREATEDA new identity check was initiated. ID_SENTThe verification link was sent (via email or SMS). ID_OPENEDThe verification link was opened. ID_VERIFIEDThe identity was successfully verified (e.g. BankID). ID_FAILEDThe identity verification failed. ID_CANCELEDThe identity check was canceled.
These events fire when contacts are modified. The payload is a Contact object .
Event Description CONTACT_CREATEDA new contact was created. CONTACT_UPDATEDA contact’s details were updated. CONTACT_DELETEDA contact was deleted.
Payloads
Document Payload
Used by document-level events (DOCUMENT_CREATED, DOCUMENT_SENT, DOCUMENT_SIGNED, DOCUMENT_COMPLETED, DOCUMENT_REJECTED, DOCUMENT_EXPIRED, DOCUMENT_WITHDRAWN).
{
"id" : "clx1abc..." ,
"title" : "Employment Agreement" ,
"createdAt" : "2026-04-16T10:00:00.000Z" ,
"updatedAt" : "2026-04-16T12:00:00.000Z" ,
"organizationId" : "clx2def..." ,
"status" : "COMPLETED" ,
"signers" : [
{
"id" : "clx3ghi..." ,
"name" : "Anna Svensson" ,
"email" : "anna@example.com" ,
"signingStatus" : "SIGNED"
}
]
}
Field Type Description idstring Document ID. titlestring Document title. createdAtstring (ISO 8601) When the document was created. updatedAtstring (ISO 8601) When the document was last updated. organizationIdstring The organization that owns the document. statusstring One of: DRAFT, SENDING, PENDING_APPROVAL, PENDING, COMPLETED, EXPIRED, CANCELLED, REJECTED, IMPORTED. signersarray List of signers (see below).
Signer object:
Field Type Description idstring Signer ID. namestring Signer’s name. emailstring Signer’s email address. signingStatusstring One of: NOT_SIGNED, SIGNED, REJECTED.
Document + Party Payload
Used by party-level and reminder events. Wraps the document payload with the specific signer that triggered the event.
{
"document" : {
"id" : "clx1abc..." ,
"title" : "Employment Agreement" ,
"createdAt" : "2026-04-16T10:00:00.000Z" ,
"updatedAt" : "2026-04-16T12:00:00.000Z" ,
"organizationId" : "clx2def..." ,
"status" : "PENDING" ,
"signers" : [ ... ]
},
"party" : {
"id" : "clx3ghi..." ,
"name" : "Anna Svensson" ,
"email" : "anna@example.com" ,
"signingStatus" : "SIGNED"
}
}
Field Type Description documentobject The full Document payload . partyobject The signer that triggered this event (same shape as a signer object).
Identity Check Payload
Used by identity check events (ID_CREATED, ID_SENT, ID_OPENED, ID_VERIFIED, ID_FAILED, ID_CANCELED).
{
"id" : "clx4jkl..." ,
"fullName" : "Erik Johansson" ,
"email" : "erik@example.com" ,
"phone" : "+46701234567" ,
"channel" : "EMAIL" ,
"reference" : "ref-123" ,
"status" : "VERIFIED" ,
"failureReason" : null ,
"createdAt" : "2026-04-16T10:00:00.000Z" ,
"updatedAt" : "2026-04-16T12:30:00.000Z" ,
"organizationId" : "clx2def..." ,
"contactId" : "clx5mno..."
}
Field Type Description idstring Identity check ID. fullNamestring Full name of the person being verified. emailstring or null Email address. phonestring or null Phone number. channelstring Delivery channel: EMAIL or SMS. referencestring or null Your custom reference string. statusstring One of: CREATED, SENT, OPENED, VERIFIED, FAILED, EXPIRED, CANCELED. failureReasonstring or null Reason for failure (only set when status is FAILED). createdAtstring (ISO 8601) When the identity check was created. updatedAtstring (ISO 8601) When the identity check was last updated. organizationIdstring The organization that owns the identity check. contactIdstring or null Associated contact ID, if linked.
Used by contact events (CONTACT_CREATED, CONTACT_UPDATED, CONTACT_DELETED).
{
"id" : "clx5mno..." ,
"firstName" : "Anna" ,
"lastName" : "Svensson" ,
"email" : "anna@example.com" ,
"phone" : "+46701234567" ,
"companyName" : "Acme AB" ,
"companyRole" : "CEO" ,
"externalId" : "ext-456" ,
"addressLine1" : "Storgatan 1" ,
"addressLine2" : null ,
"city" : "Stockholm" ,
"state" : null ,
"zipCode" : "111 22" ,
"country" : "SE" ,
"createdAt" : "2026-04-16T10:00:00.000Z" ,
"updatedAt" : "2026-04-16T12:00:00.000Z" ,
"organizationId" : "clx2def..." ,
"company" : {
"id" : "clx6pqr..." ,
"name" : "Acme AB" ,
"orgNumber" : "5561234567" ,
"country" : "SE"
}
}
Field Type Description idstring Contact ID. firstNamestring First name. lastNamestring Last name. emailstring or null Email address. phonestring or null Phone number. companyNamestring or null Company name (free text on the contact). companyRolestring or null Role at the company. externalIdstring or null Your external ID for this contact. addressLine1string or null Address line 1. addressLine2string or null Address line 2. citystring or null City. statestring or null State/region. zipCodestring or null Zip/postal code. countrystring or null Country code. createdAtstring (ISO 8601) When the contact was created. updatedAtstring (ISO 8601) When the contact was last updated. organizationIdstring The organization that owns the contact. companyobject or null Associated company (see below).
Company object:
Field Type Description idstring Company ID. namestring or null Company name. orgNumberstring or null Organization number. countrystring or null Country code.
Next Steps
Managing Webhooks via API Create, list, update, and delete webhooks programmatically
Event Reference Learn about all document events