Skip to Content
Webhooks

Send a test event to a webhook

POST
/api/v1/webhooks/{id}/test

Sends a webhook.test event to this webhook only, signed and delivered like any other event in the webhook's API version, and returns the delivery with status: PENDING. data.object is the webhook's id and url. Follow the delivery with GET /api/v1/webhooks/:id/deliveries/:deliveryId. The event isn't listed in GET /api/v1/events, and no other webhook receives it.

Returns 409 INVALID_STATE when the webhook is disabled or paused.

Plan Requirement: Requires the Team plan or higher, or a sandbox organization.

Authorization

headerAuthorizationBearer <token>

API key, e.g. Authorization: Bearer sajn_svc_.... Not scope-limited: acts with its owner's workspace role.

Path Parameters

id*string

The webhook ID.

Header Parameters

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

Value in"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.

Lengthlength <= 255

Response Body

200

application/json
  1. response
id*string

ID of the delivery: one event sent to one endpoint, with every attempt to send it.

webhookId*string

The webhook ID.

eventId*|

ID of the event, as GET /api/v1/events/:id takes it. Null for a delivery made before sajn recorded it.

type*|

The event type, such as document.completed. Null for an event type that 2026-10 no longer has.

Value in"document.created""document.sent""document.fully_signed""document.completed""document.rejected""document.expired""document.withdrawn""document.updated""document.deleted""document.restored""document.archived""document.unarchived""document.expiration_extended""document.expiring_soon""document.party.sent""document.party.delivery_failed""document.party.opened""document.party.read""document.party.signed""document.party.rejected""document.party.delegated""document.party.auth_failed""document.party.verified""document.party.updated""document.party.added""document.party.removed""document.party.reminded""document.comment.created""bundle.sent""bundle.party.signed""bundle.completed""bundle.cancelled""archive_import.completed""archive_import.undone""identity_check.created""identity_check.sent""identity_check.opened""identity_check.verified""identity_check.failed""identity_check.cancelled""contact.created""contact.updated""contact.deleted""company.created""company.updated""company.deleted""template.created""template.updated""template.deleted""template.restored""form.submitted""workspace.created""member.added""member.invited""member.invite_accepted""approval_request.created""approval_request.approved""approval_request.rejected""approval_request.cancelled""login.completed""login.failed""security.document_downloaded""security.documents_exported""security.signature_identity_accessed""security.member_removed""security.member_role_changed""security.role_updated""security.workspace_retention_updated""usage.limit_reached""webhook.test"null
status*string

SUCCESS when an attempt got a 2xx answer, FAILED when sajn stopped retrying, and PENDING while attempts remain.

Value in"SUCCESS""FAILED""PENDING"
url*string

The endpoint URL the delivery was sent to.

replayOfId*|

ID of the delivery this one replays. Null for an original delivery.

requestBody*

The JSON body sent to the endpoint, in the webhook's API version. Null until the first attempt.

attempts*array<>

Every attempt, oldest first. Empty until the first attempt.

createdAt*string

When the webhook was created.

Formatdate-time
Example Request
curl -X POST 'https://app.sajn.se/api/v1/webhooks/cm4k2x9p10013abcd1234efgh/test'
Example Response
{  "id": "cm4k2x9p10013abcd1234efgh",  "webhookId": "cm4k2x9p10013abcd1234efgh",  "eventId": "cm4k2x9p10014abcd1234efgh",  "type": "document.created",  "status": "SUCCESS",  "url": "https://example.com/webhooks/sajn",  "replayOfId": null,  "requestBody": {    "id": "cm4k2x9p10014abcd1234efgh",    "type": "document.fully_signed",    "createdAt": "2026-09-29T07:41:00.000Z",    "apiVersion": "2026-10",    "workspaceId": "cm4k2x9p10001abcd1234efgh",    "environment": "PRODUCTION",    "actor": null,    "data": {      "object": {        "id": "cm4k2x9p10003abcd1234efgh",        "externalId": "HR-2026-0142",        "expiresAt": "2026-10-28T22:00:00.000Z",        "name": "Anställningsavtal – Kai Lindqvist",        "status": "PENDING",        "documentMeta": {          "subject": "Ditt anställningsavtal från Exempelbolaget AB",          "message": "Hej Kai! Här är ditt anställningsavtal. Signera det med BankID senast den 28 oktober.",          "signingMode": "PARALLEL",          "forceReadFullDocument": true,          "showChatToSigners": false,          "language": "sv",          "value": null,          "redirectUrl": null,          "redirectEnabled": false,          "internalRecipients": [            "hr@example.com"          ],          "signableAfterExpired": false,          "sendPlainTextEmailOnly": null,          "reminderIntervalDays": 3,          "allowDelegation": false,          "openVerification": null,          "aiChatEnabled": null,          "nationalIdDisplayMode": null,          "sameDeviceSigning": false,          "documentCategoryId": "cm4k2x9p10017abcd1234efgh"        },        "createdAt": "2026-09-28T09:12:00.000Z",        "updatedAt": "2026-09-29T07:41:00.000Z",        "completedAt": null,        "deletedAt": null,        "templateId": "cm4k2x9p10008abcd1234efgh",        "folderId": "cm4k2x9p10011abcd1234efgh",        "responsibleUserId": "cm4k2x9p10002abcd1234efgh",        "parties": [          {            "id": "cm4k2x9p10004abcd1234efgh",            "documentId": "cm4k2x9p10003abcd1234efgh",            "email": "kai@example.com",            "name": "Kai Lindqvist",            "phone": "+46701740605",            "type": "INDIVIDUAL",            "company": null,            "externalId": "EMP-0142",            "contactId": "cm4k2x9p10006abcd1234efgh",            "nationalId": null,            "country": "SE",            "role": "SIGNER",            "signingOrder": 1,            "signedAt": "2026-09-29T07:41:00.000Z",            "readStatus": "READ",            "signingStatus": "SIGNED",            "delivery": [              "EMAIL"            ],            "signatureMethod": "SE_BANKID",            "signVerification": null,            "openVerification": null,            "sendStatus": "DELIVERED",            "identityVerified": true,            "identityMismatch": false,            "createdAt": "2026-09-28T09:12:00.000Z"          }        ],        "tags": [],        "customFields": [],        "content": null,        "productTables": [],        "approvalRequestId": null,        "bundleId": null      }    }  },  "attempts": [    {      "id": "cm4k2x9p10013abcd1234efgh",      "attempt": 1,      "status": "SUCCESS",      "responseCode": 200,      "durationMs": 1,      "requestHeaders": {        "startdatum": "Anställningsavtal – Kai Lindqvist"      },      "responseHeaders": {        "startdatum": "Anställningsavtal – Kai Lindqvist"      },      "responseBody": null,      "createdAt": "2026-09-28T09:12:00.000Z"    }  ],  "createdAt": "2026-09-28T09:12:00.000Z"}

Was this page helpful?