- Qubitara Synapse
- Developer guide
- Webhook payloads and signatures
Webhook payloads and signatures
How to receive what Synapse sends. Creating and managing webhooks is described under Administration → Webhooks.
A delivery#
Synapse POSTs JSON to your address with these headers:
Header | Value |
|---|---|
| The event name, such as |
| A unique id for this delivery — use it to ignore duplicates |
| Unix seconds when it was signed |
|
|
|
|
And this body:
{
"event": "page.published",
"occurredAt": "2026-10-05T09:12:44.000Z",
"organization": { "id": "…", "slug": "acme" },
"resource": { "type": "PAGE", "id": "…", "reference": "OPS-12", "title": "Deployment runbook" },
"space": { "id": "…", "key": "OPS" },
"actor": { "id": "…" }
}resource.type is PAGE, SPACE or COMMENT. space and actor are present when there is one; a scheduled job has no actor. The body never carries page content — fetch it with the API if you need it, under a credential that may read it.
Verify the signature#
The signature is an HMAC-SHA256 of "<timestamp>.<raw body>" with the webhook's signing secret, hex-encoded. Compute it over the raw request body before parsing, compare in constant time, and reject timestamps older than a few minutes to defeat replays.
// Node.js
const crypto = require('crypto');
function verify(secret, headers, rawBody) {
const timestamp = headers['x-synapse-timestamp'];
const presented = (headers['x-synapse-signature'] || '').replace(/^sha256=/, '');
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const expected = crypto.createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex');
return presented.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(presented, 'hex'), Buffer.from(expected, 'hex'));
}Respond fast, work later#
Answer 2xx within a few seconds and queue the real work. A delivery that fails or times out is retried with increasing delays; a subscription that keeps failing is disabled after ten consecutive failures and must be re-enabled from the API once the receiver is fixed. GET /admin/webhooks/:id/deliveries shows recent attempts with their status codes.
Idempotency#
Retries carry the same x-synapse-delivery id. Keep the ids you have processed and skip repeats.
Targets#
Public HTTPS only. Private, loopback and link-local addresses are refused when the webhook is created.