Webhooks deliver real-time HTTP notifications to your own services whenever data changes in a project. When a record is inserted, updated, or deleted on any Data Model table, Archie sends a signedDocumentation Index
Fetch the complete documentation index at: https://archie.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
POST to a URL you control, with the event payload in the body.
This page covers webhooks Archie sends from your project to external systems. For incoming webhook handling on the integration side (Stripe events, GitHub events, etc.), see Integrations → Webhooks.
How it works
- Register a webhook subscription: which table, which events, which URL.
- Data changes — every matching mutation (REST or GraphQL) publishes an event.
- Delivery — the webhook service
POSTs to your URL with the payload. - Verify — your endpoint validates the HMAC signature, then processes the event.
- Retry — non-2xx responses retry with exponential backoff up to 5 attempts.
Webhook management API
All management endpoints live under/api/rest/_webhooks and require a management API token.
| Method | Endpoint | Purpose |
|---|---|---|
POST | /api/rest/_webhooks | Create a subscription |
GET | /api/rest/_webhooks | List subscriptions |
GET | /api/rest/_webhooks/{id} | Get subscription + recent deliveries |
PATCH | /api/rest/_webhooks/{id} | Update a subscription |
DELETE | /api/rest/_webhooks/{id} | Delete a subscription |
Required headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <management-token> |
X-Project-ID | Yes | Project identifier |
environment | Yes | Target environment — must match the body for create/update |
environment header is required on every webhook management request, including GET and DELETE.
Create a webhook
| Field | Type | Required | Description |
|---|---|---|---|
projectId | String | Yes | Project identifier. |
environment | String | Yes | Target environment. |
table | String | Yes | Table name to watch. |
events | Array | Yes | Any of INSERT, UPDATE, DELETE. |
url | String | Yes | HTTPS endpoint to receive events. |
secret | String | Yes | HMAC signing secret — keep this safe. |
active | Boolean | No | Default true. Set false to pause delivery. |
filter | Object | No | Only deliver for records matching this filter. |
select | Array | No | Limit which fields are included in the payload. |
Filtering events
Only deliver when the record matches a condition:Selecting fields
Limit the payload to specific fields — useful for keeping payloads small or avoiding sensitive data in webhook bodies:Event payload
When a matching change happens, Archie delivers an HTTPPOST to your URL with this body:
| Field | Description |
|---|---|
id | Unique event identifier — use this to deduplicate. |
timestamp | ISO 8601 timestamp of the event. |
project_id | Project that generated the event. |
environment | Environment in which the change happened. |
table | Table that was modified. |
event | INSERT, UPDATE, or DELETE. |
record | Full record (or selected fields) after the mutation. |
data | Same as record, kept for compatibility. |
changed_fields | Fields that changed (for UPDATE; empty for INSERT and DELETE). |
DELETE, record reflects the row’s state immediately before deletion.
Delivery headers
Each delivery includes:| Header | Value |
|---|---|
Content-Type | application/json |
X-Archie-Event | INSERT / UPDATE / DELETE |
X-Archie-Delivery | The event id (for tracking and dedup). |
X-Archie-Signature | sha256=<hex> HMAC signature with prefix. |
X-Webhook-Signature | Raw hex digest, no prefix. |
Verifying signatures
Always verify the HMAC signature before processing the payload — never trust an unsigned webhook body.Node.js
Python
timingSafeEqual, hmac.compare_digest) to avoid leaking the signature one byte at a time.
Retries and circuit breakers
If your endpoint returns a non-2xx status or doesn’t respond, the webhook service retries with exponential backoff:| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | ~1 second |
| 3 | ~5 seconds |
| 4 | ~30 seconds |
| 5 | ~5 minutes |
GET /_webhooks/{id} for inspection.
A circuit breaker protects your endpoint from sustained failures: after 5 consecutive failures, deliveries pause for a 2-minute cooldown, then retry. This avoids hammering an endpoint that’s clearly down.
Inspecting deliveries
GET /api/rest/_webhooks/{id} returns the subscription and recent delivery history:
Best practices
- Always verify signatures. Never trust an unsigned payload.
- Respond fast. Return
200within 5 seconds. Process the event asynchronously if needed. - Deduplicate by event id. The same event may be redelivered if your endpoint returns a non-2xx — process the work once.
- Use HTTPS. Webhook URLs must be HTTPS.
- Monitor for dead-letter deliveries. Check
/_webhooks/{id}regularly or wire it to alerting.
FAQ
Webhooks vs subscriptions — which should I use?
Webhooks vs subscriptions — which should I use?
Use webhooks for server-to-server delivery — your backend reacts to data changes from another machine. Use GraphQL subscriptions for client UIs — a browser stays connected over a WebSocket and receives events while it’s open. Webhooks retry; subscriptions don’t.
Why might the same event be delivered twice?
Why might the same event be delivered twice?
Network failures or 5xx responses trigger a retry. The retry uses the same event id (
X-Archie-Delivery), so you can deduplicate by tracking processed event ids on your side. At-least-once delivery is the trade-off for guaranteed delivery on transient failures.Can I rotate the signing secret?
Can I rotate the signing secret?
Yes —
PATCH the subscription with a new secret. To rotate without downtime, configure your endpoint to accept either the old or new secret during the rotation window, then drop the old one once the new is in place.What happens if my webhook endpoint is down for hours?
What happens if my webhook endpoint is down for hours?
Deliveries retry up to 5 times over a few minutes, then move to dead-letter. They aren’t auto-redelivered after that — you’d need to read the dead-letter list and replay them yourself. For at-least-once-with-long-windows guarantees, plan endpoint reliability accordingly.
Can I have multiple webhooks for the same table?
Can I have multiple webhooks for the same table?
Yes. Multiple subscriptions to the same table-and-event combination each receive a copy of the event. Useful for sending the same event to different downstream systems.