A webhook sends an event to your HTTPS endpoint when something happens in the workspace, for example a response being submitted. Owners and admins create webhooks in the web app; with a key you can read them, the events they can send and their deliveries.
One delivery
Each delivery is a POST with a JSON body and these headers:
| Header | Value |
|---|---|
Clist-Webhook-Id |
The delivery ID, the same for every attempt |
Clist-Webhook-Timestamp |
Unix seconds, new for every attempt |
Clist-Webhook-Attempt |
1 for the first attempt, then 2, 3 and so on |
Clist-Webhook-Signature |
v1= and the signature; two values separated by a space while a rotated secret overlaps |
The body names the event (type), when it happened (occurred_at), who did it (actor), what it is about (subject) and its data. The events and their fields are listed by GET /workspaces/{workspaceId}/hooks/events.
Verify the signature
The signature is the hex HMAC-SHA256 of <id>.<timestamp>.<raw body>, keyed with the webhook's whole secret (the whsec_ value shown once when the webhook was created or its secret rotated). Compute it over the raw bytes you received, before parsing the JSON; compare in constant time; and reject a timestamp more than 5 minutes from your clock.
const crypto = require('node:crypto');
function verify(secret, headers, rawBody, now = Math.floor(Date.now() / 1000)) {
const id = headers['clist-webhook-id'];
const timestamp = headers['clist-webhook-timestamp'];
if (Math.abs(now - Number(timestamp)) > 300) return false;
const expected = crypto.createHmac('sha256', secret).update(`${id}.${timestamp}.${rawBody}`).digest();
return headers['clist-webhook-signature'].split(' ').some((value) => {
const given = Buffer.from(value.replace(/^v1=/, ''), 'hex');
return given.length === expected.length && crypto.timingSafeEqual(given, expected);
});
}
Answer quickly
Reply with any 2xx within 8 seconds; the body is ignored. Do the work afterwards, in a queue.
Retries and duplicates
408,425,429and5xx, and timeouts, are retried with growing delays (30 seconds, doubling up to an hour) for up to 6 attempts. Other4xxare not retried.- After the last attempt the delivery is set aside, and an admin can replay it from the delivery log.
- Delivery is at least once: the same
Clist-Webhook-Idcan arrive again. Skip an ID you have already processed. - Events can arrive out of order. Each has a
sequencethat grows within the workspace; for the same subject, keep the event with the highersequence.