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

Signature header
None (unsigned)
How events are identified
None from Ory: your Jsonnet template sets the body
Body format
JSON
Other headers
ory-webhook-request-id, ory-webhook-trigger-id
Agent skill
npx skills add hookdeck/webhook-skills --skill ory-webhooks

Verify Ory webhooks →

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: true on any webhook that only notifies another system. Use api_key with in: 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/ory gives 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

  1. A short outage loses requests

    Ory makes three attempts, waiting 1 second and then 2 seconds, so an endpoint answering 503 uses 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.

    Plan for lost requests →
  2. A slow endpoint blocks sign-in

    A webhook without response.ignore: true makes the flow wait, and a failure surfaces as webhook_timeout or webhook_request_failed. Use non-blocking webhooks for anything that only notifies.

    Keep sign-in independent →
  3. The same request arrives twice

    Ory retries an attempt that timed out, even if your handler finished the work. Put ctx.flow.id in the template and deduplicate on it with your event name and the identity ID.

    Handle duplicates →
  4. Requests with nothing to route on

    The body is only what your template renders, and Ory adds no event name. Add an event key to every template, or give each action its own path.

    Name your events →

Ory webhook best practices

  • Default to non-blocking. Set response.ignore: true on 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 event key 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.id in 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 after registration, 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.

Not affiliated with Ory. Facts are compiled from public sources and linked inline.