How webhooks work
Choose events to subscribe to
Subscribe to exact events like
kyc.provider.completed, namespace wildcards like kyc.* or account.*, or * for everything.Zquence sends a signed POST request
Each delivery is an HTTPS
POST with a JSON body and signed X-Webhook-* headers for verification.Delivery format
Every delivery is an HTTPSPOST with the following headers:
| Header | Example value | Purpose |
|---|---|---|
Content-Type | application/json | Body encoding. |
User-Agent | Zquence-Webhooks/1.0 | Identifies the sender. |
X-Webhook-Timestamp | 1745311982 | Unix timestamp used in the signature. |
X-Webhook-Signature | sha256=b8a7e1c4... | HMAC-SHA256 signature — verify before trusting the payload. |
X-Webhook-Signature-Version | v1 | Signature algorithm version. |
X-Zquence-Event | kyc.provider.completed | Convenience routing header — mirrors body.type. |
X-Zquence-Webhook-Id | evt_0b3e2d90... | Unique event ID — use for idempotency. |
Example delivery
environmentId and environmentType so you can distinguish live from sandbox traffic without inspecting the payload.
Handler pattern
Your webhook handler should be intentionally minimal:- Read the raw request body (before any JSON parsing).
- Verify
X-Webhook-SignatureusingX-Webhook-Timestampand your endpoint secret. - Return
200 OKimmediately. - Enqueue the event for asynchronous processing.
Node.js (Express)
Signing secrets
Each endpoint has exactly one signing secret:- Provide your own secret when creating the endpoint, or leave it blank and Zquence auto-generates a
whsec_...value. - The secret is scoped to that endpoint only — different endpoints use different secrets.
- Rotating the secret takes effect immediately on the next delivery.
Idempotency and duplicates
Retries and manual replays can produce duplicate deliveries for the same event. Deduplicate onevent.id before processing:
Node.js
Retries
If your endpoint returns a non-2xx response or exceeds the 10-second timeout, Zquence marks that attempt as failed and schedules a retry using exponential backoff.
Default delivery schedule (3 retries, 4 attempts total):
| Attempt | Delay from previous |
|---|---|
| 1 | Immediate |
| 2 | 2 seconds |
| 3 | 4 seconds |
| 4 | 8 seconds |
The number of retries is configurable per environment. The values above reflect the platform default (
DEFAULT_WEBHOOK_RETRIES = 3).Manual replay
Zquence stores every delivery and supports on-demand replay. Use this to recover from outages, reprocess missed events, or resync a downstream system. Replay behavior:- Scoped to the tenant triggering the replay.
- Re-delivers the original payload to your configured endpoint — it does not re-emit the event from source.
- Does not alter historical records inside Zquence.
- Filterable by environment, endpoint, event type, status, and date range.
Receiver response codes
| Your response | Zquence behaviour |
|---|---|
2xx (200–299) | Success — delivery complete, no retry. |
4xx / 5xx | Failed — retried with backoff while attempts remain. |
| Timeout (> 10 s) | Failed — retried with backoff while attempts remain. |
| Connection refused | Failed — retried with backoff while attempts remain. |
Local development
Use a tunnel to receive webhooks on your local machine:ZQUENCE_WEBHOOK_SECRET environment variable locally to the secret shown in the dashboard for that endpoint.
Next steps
Verify signatures
Reference verification handlers for Node.js, Python, and Go.
Event catalog
Every supported event with payload schemas and examples.
Retries
Retry timing, timeouts, and manual replay.
Best practices
Patterns to keep your integration fast and resilient.