Ory webhooks
Ory webhooks are the HTTP requests an Ory Action sends to your endpoint when a registration, login, settings, recovery or verification flow reaches the point you chose, with a body rendered from your own Jsonnet template.
These pages cover Ory Actions webhooks, whose body you write in a template. Ory's live event streams, for enterprise contracts, are a separate feature that sends named events such as IdentityCreated to an HTTPS endpoint or AWS SNS.
How Ory webhooks work
An Action tells your systems about a flow as it happens, so a new sign-up can reach your CRM without you polling the identity API. Each one is set on a flow and a position: before or after, plus submit and failure for login. A webhook with response.ignore: true is non-blocking: it runs in the background and Ory ignores your response. Without it, the flow waits for you.
Ory defines no event list, envelope or version for these requests, and adds no event field. The body is what your Jsonnet template renders from ctx, which holds flow, request_headers, request_method, request_url, location and ip_labels, plus identity and transient_payload on after hooks. To route requests, put an event name in every template or give each action its own path.
Key facts
Setting up Ory webhooks
- In the Ory Console, go to Authentication > Actions & Webhooks and click + Create new Action. Choose the flow and when it runs, enter the URL and method, then set authentication and the Jsonnet body. Project config uses
hook: web_hook. - Set
response.ignore: trueon any webhook that only notifies another system. Useapi_keywithin: header, so your endpoint can read and compare the value. - Ory Network can't reach localhost, so test through a public URL.
hookdeck listen 3000 ory --path /webhooks/orygives you one and forwards requests to your machine. Then run the flow, for example by registering a test user. - If your endpoint sits behind a firewall, allow Ory Network's IP addresses for your region. Ory documents no way to resend a request.
Delivery behaviour
30 seconds per attempt; 10 seconds on the login failure trigger Retries up to 3 attempts 1 second, then 2 seconds apart, after a timeout, connection failure, 429 or most 5xx After retries no resend documented a non-blocking webhook's flow carries on; nothing surfaces the loss Duplicates possible a retry can repeat a request, so key on an ID you send Known failure modes
From Hookdeck's Ory guide →-
A short outage loses requests
Ory makes three attempts, waiting 1 second and then 2 seconds, so an endpoint answering
Plan for lost requests →503uses them all within seconds. A non-blocking webhook's flow carries on regardless, so reconcile against the identities API for anything you can't miss. -
A slow endpoint blocks sign-in
A webhook without
Keep sign-in independent →response.ignore: truemakes the flow wait, and a failure surfaces aswebhook_timeoutorwebhook_request_failed. Use non-blocking webhooks for anything that only notifies. -
The same request arrives twice
Ory retries an attempt that timed out, even if your handler finished the work. Put
Handle duplicates →ctx.flow.idin the template and deduplicate on it with your event name and the identity ID. -
Requests with nothing to route on
The body is only what your template renders, and Ory adds no event name. Add an
Name your events →eventkey to every template, or give each action its own path.
Ory webhook best practices
- Default to non-blocking.
Set
response.ignore: trueon anything that only informs another system, so your endpoint's availability stays out of your login path. - Name the event in every template.
Ory adds no event field. Send an
eventkey of your own, or give each action its own path. - Deduplicate retried requests.
A timed-out attempt is sent again even if your handler finished the work. Put
ctx.flow.idin the template and key on it with your event name and the identity ID. - Return a 2xx quickly. Each attempt times out after 30 seconds. Check the key, store the request, respond, and do the work afterwards.
- Reconcile what must not be missed. Retries end within seconds of a failing response. Check the Ory identities API on a schedule for anything you can't afford to lose.
- Run the session hook last.
On
afterregistration, the session hook modifies the response and no hook runs after it, so a webhook placed behind it never fires.
In this hub
| MCP events → | How an agent subscribes to Ory events as MCP events. |
| Verify signatures → | Signature facts, verification code and common failures. |
| Production guide → | Production problems, such as timeouts and retries, and how to handle them. |
| Agent skill → | Install the webhook skill in your coding agent. npx skills add hookdeck/webhook-skills --skill ory-webhooks |
Keep a short outage from losing your Ory sign-ups.
Ory's retries end within seconds of a failing response. Event Gateway checks the API key header on each non-blocking webhook, stores the request and retries to your service on your schedule.