Skip to Content

Create a new webhook

You're viewing API version 2026-09, which is deprecated and stops working on October 1, 2027. To move your integration, see Upgrading to 2026-10.
POST
/api/v1/webhooks

Create a new webhook subscription for your workspace.

Required Fields:

  • webhookUrl - URL that will receive POST requests when events occur
  • eventTriggers - Array of event types to subscribe to

Optional Fields:

  • secret - Signing key for this endpoint. A 32-byte key is generated when omitted
  • enabled - Whether the webhook is active (default: true)

Delivery: every request carries X-Sajn-Signature: t=<unix seconds>,v1=<hex hmac-sha256 over "<t>.<raw body>"> and X-Sajn-Delivery, a delivery id that stays the same across the retries of one event. Failed deliveries (5xx, 408, 429, network error) are retried up to 5 times with exponential backoff capped at 300 s, so receivers must dedupe on X-Sajn-Delivery.

Available Event Types:

  • Document: DOCUMENT_CREATED, DOCUMENT_SENT, DOCUMENT_OPENED, DOCUMENT_SIGNED, DOCUMENT_COMPLETED, DOCUMENT_REJECTED, DOCUMENT_WITHDRAWN, DOCUMENT_ARCHIVE_UPLOADED
  • ID Check: ID_CREATED, ID_SENT, ID_OPENED, ID_VERIFIED, ID_FAILED, ID_CANCELED
  • Contact: CONTACT_CREATED, CONTACT_UPDATED, CONTACT_DELETED
  • Form: FORM_SUBMITTED, with the same fields as GET /api/v1/forms/:id/submissions/:submissionId

Plan Requirement: Requires SOLO plan or higher.

Authorization

headerAuthorizationBearer <token>

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

Header Parameters

authorization*string

Bearer token for API authentication

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

Request Body

Body

application/json
  1. body

Create webhook request

webhookUrl*string

URL that will receive webhook events

Formaturi
eventTriggers*array<>

List of event types to subscribe to

Items1 <= items
secret?|

Signing key for this endpoint. A 32-byte key is generated when omitted; deliveries are signed with it in X-Sajn-Signature

enabled*boolean

Whether this webhook is active (default: true)

Defaulttrue
failureNotificationEmail?|

Email address that will be notified if webhook delivery fails

Match^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
Formatemail

Response Body

Webhook response

application/json
  1. response

Webhook response

id*string

Unique webhook identifier

webhookUrl*string

URL that receives webhook events

secret*|

Signing key for this endpoint. Deliveries carry X-Sajn-Signature: t=,v1=<hex hmac-sha256 over ".">

enabled*boolean

Whether this webhook is active

failureNotificationEmail*|

Email address that receives a notification if webhook delivery fails

eventTriggers*array<string>

List of event types this webhook subscribes to

createdAt*string

Date and time when webhook was created

Formatdate-time
updatedAt*string

Date and time when webhook was last updated

Formatdate-time
Example Request
curl -X POST 'https://app.sajn.se/api/v1/webhooks' \  -H 'authorization: string' \  -H 'Content-Type: application/json' \  -d '{  "webhookUrl": "http://example.com",  "eventTriggers": [    "DOCUMENT_CREATED"  ],  "enabled": true}'
Example Response
{  "id": "string",  "webhookUrl": "string",  "secret": "string",  "enabled": true,  "failureNotificationEmail": "string",  "eventTriggers": [    "string"  ],  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}

Was this page helpful?