Webhooks
Every state change produces an event. Holdyn sends each event as an HTTPS POST to the webhook endpoints you register under Developers, in the mode (test or live) the event belongs to. Test events go only to test endpoints and live events only to live endpoints.
The envelope#
The body is the same JSON that GET /events/:id returns.
{
"id": "evt_6543a1b2c3d4e5f6a7b8cf90",
"object": "event",
"type": "collection.succeeded",
"api_version": "2026-11-01",
"created": "2026-11-20T15:00:02.123Z",
"livemode": false,
"tenant": "ten_6543a1b2c3d4e5f6a7b8c9d0",
"data": {
"object": { "id": "col_6543a1b2c3d4e5f6a7b8cd10", "object": "collection", "status": "succeeded" },
"previous_attributes": { "status": "processing" }
},
"related": { "mandate": "man_6543a1b2c3d4e5f6a7b8cc00", "stage": null },
"record": { "chain": "test", "seq": 205, "hash": "…" },
"request": { "id": "req_8f2c51d0" }
}data.objectis a snapshot of the object at the time of the event. Read the object through the API when you need its latest state.previous_attributeslists the top-level fields that changed. It can be empty.recordgives the position of the event in the independent record. Order events byrecord.seq, not by arrival time.requestisnullfor events caused by jobs and Stripe webhooks. It never contains your idempotency key.
Headers#
| Header | Value |
|---|---|
Content-Type | application/json |
User-Agent | Holdyn-Webhooks/1.0 |
Holdyn-Event-Id | The event id, evt_…. Use it to deduplicate. |
Holdyn-Event-Type | For example collection.succeeded. |
Holdyn-Delivery-Attempt | 1 for the first attempt, then 2, 3, … |
Holdyn-Livemode | true or false. |
Holdyn-Signature | t=<unix seconds>,v1=<signature>. During a secret rotation it holds two v1 values. |
Verify the signature#
The signature is an HMAC-SHA256 over the string t + "." + rawBody, keyed with the whole endpoint secret including the whsec_ prefix, written as hex. To verify a delivery:
- Read the raw request body before any JSON parsing. A re-serialised body will not match.
- Split
Holdyn-Signatureon commas. Taketand everyv1value. - Reject the request if
|now − t|is more than 300 seconds. This is your replay protection. - Compute the expected signature and compare it with each
v1using a constant-time comparison. Convert both to buffers first and return false when their lengths differ, becausetimingSafeEqualthrows on unequal lengths. - Accept if any
v1matches. Two values appear only while you rotate a secret. - Deduplicate by
Holdyn-Event-Id, answer2xxquickly and process afterwards.
What a good receiver does#
- Answers
2xxwithin 10 seconds. Any other status, a redirect, or a timeout counts as a failure. Put the work on a queue and answer first. - Deduplicates by event id. An event can arrive more than once.
- Orders by
record.seq. Events can arrive out of order, and retries arrive later than newer events. - Reads the object again when it needs the current state; the snapshot is as of the event.
- Ignores unknown event types and fields.
Retries#
A failed delivery is retried up to 11 attempts in total over about 72 hours. The waits after each failed attempt are 1 minute, 5 minutes, 30 minutes, 2 hours, 5 hours, 10 hours, 10 hours, 14 hours, 14 hours and 16.5 hours, each with about 10 percent random jitter. After the last attempt the delivery is marked exhausted. Each attempt is signed again with a fresh t.
If an endpoint fails at least 20 times in a row and has been failing for more than 72 hours, it is disabled (disabled_reason: auto_failing), your developers are emailed and an item appears in the inbox. Re-enable it with PATCH /webhook-endpoints/:id and { "status": "enabled" } once the receiver is fixed. Deliveries over the hourly cap are deferred to the next hour, never dropped.
Redeliver one event with POST /events/:id/redeliver or one delivery with POST /webhook-deliveries/:id/redeliver. A redelivery is a new series of attempts, sent immediately from the stored snapshot.
Where deliveries go#
Endpoint URLs must use HTTPS on port 443 or 8443 and must not point at private or reserved addresses. The host name is resolved once, each address is checked, and the connection goes to the checked address. Redirects are not followed. Up to 10 endpoints per mode.
Secrets#
An endpoint secret (whsec_…) is shown once, when the endpoint is created or its secret is rotated. Rotation keeps the previous secret valid for up to 24 hours (you choose 0 to 24), and both signatures are sent in that window so you can switch without missing a delivery. Creating an endpoint, changing its URL, widening its subscriptions and rotating its secret need two-step verification in live mode.
Test it#
POST /webhook-endpoints/:id/test sends one signed test.ping event synchronously and returns the delivery. It is not recorded and not retried. Limit: 10 per hour per endpoint.
See the event catalogue for every event type and Webhook endpoints for the endpoint routes.
