Webhooks
Webhooks push Cortex domain events to an HTTP endpoint you host. Delivery is reliable: events are persisted before they’re sent, retried with backoff if your endpoint is down, and signed so you can verify they really came from Cortex.
Creating a subscription
Subscribe to the events you care about (exact names, domain.* wildcards, or * for
everything) and provide a secret used to sign deliveries:
You can also configure how Cortex authenticates to your endpoint — authType of
none (default), api_key, basic_auth or custom_headers — on top of the signature.
Verifying signatures
Every delivery is signed with HMAC-SHA256 using your subscription secret. Verify the
signature on the raw request body before trusting the payload:
Always compare with a constant-time function like timingSafeEqual, never ===.
Reliable delivery (the outbox)
Cortex writes each matching event to a durable outbox before delivering it, so an endpoint that’s temporarily down never loses events:
- On
2xx, the delivery is marked delivered. - On error or non-
2xx, it’s retried with exponential backoff until it succeeds or the attempt limit is reached. - Each attempt is recorded so you can audit delivery history.
Because failed deliveries are retried, your endpoint may receive the same event more than
once. Deduplicate by the event id and make handling idempotent.
Inspecting deliveries
List the delivery queue (pending / delivered / failed attempts) to debug integration issues:
Webhooks vs SSE vs functions
All three are driven by the same domain-event catalog:
| Surface | Best for | Delivery |
|---|---|---|
| Webhooks | Server-to-server integrations with your backend | Durable, retried, signed |
| SSE | Live dashboards / UI | Real-time stream, no replay |
| Functions | Custom logic you don’t want to host | Durable (same outbox path) |