Skip to main content
This page explains what happens when a webhook cannot be delivered: what counts as a failure, when the request is sent again, and how repeated failures change the status of a webhook subscription. The policy has two goals: do not lose events when your endpoint has a short outage, and do not keep sending requests to an endpoint that is broken.

What counts as a failed delivery

A webhook is delivered as an HTTP POST request with a JSON body. A delivery fails in any of these cases:
  • Your endpoint answers with a status code outside the 2xx and 3xx ranges.
  • The connection is not opened within 5 seconds, or the full response does not arrive within 10 seconds (a timeout).
  • The connection fails for another reason, for example a DNS or TLS error.
  • The request is redirected more than 2 times. Redirects are followed with the same POST method and body.
A late response is a failure. A valid 2xx response that arrives after the timeout is not accepted, and the event is sent again.
What happens next depends on the autoRetry option of the subscription. It is turned on by default.

Retry schedule

With the auto retry, a failed event is sent again up to 8 times. The delay grows after each failure: All 8 retries together take about 4 days. For this reason we do not recommend the auto retry for time-sensitive webhooks, for example a reminder that is useful only before some event starts. Without the auto retry, a timeout uses the first four delays of the same table: 2 minutes, 6 minutes, 30 minutes and 1 hour.

The schedule belongs to the webhook

Failures are counted per webhook subscription, not per event:
  • Your endpoint gets one attempt per delay, no matter how many events are waiting.
  • While a webhook waits for its next attempt, all its events wait together, new events included. They are sent in the order they were created.
  • One successful delivery resets the failure counter. The other waiting events are then sent without a delay.

Request headers

Each request carries these headers:

Webhook statuses after failures

Repeated failures change the status of the subscription. The users who can manage webhooks get an email when a webhook becomes degraded or paused, and when it is disabled automatically. A webhook is disabled automatically when:
  • It stays PAUSED for 14 days without a resume.
  • The auto retry is turned off and a delivery fails for any reason other than a timeout.
  • The auto retry is turned off and 5 timeouts happen in a row.

Resuming a paused webhook

A paused webhook is resumed from its edit page in the platform, with the Save & resume delivery button. See Webhooks.
  • The kept events are sent in the order they were created, to the current target URL of the webhook. You can correct the URL before you resume.
  • The failure counter is kept. If the first delivery after the resume fails, the webhook is paused again at once. A successful delivery gives the full retry schedule back.

Enabling a disabled webhook

When a webhook is disabled, its waiting events are marked as failed and are never sent. After you enable it again, only new events are sent. The events that happened while it was disabled are not sent either.

Best practices

  1. Answer fast, process later. Return a 2xx response as soon as you have stored the request, and do the real work in the background. A response after 10 seconds counts as a failure.
  2. Make your endpoint idempotent. The same event can arrive more than once, for example when your 2xx response was late. Store the value of X-Opigno-LIP-Delivery and skip a delivery that you have already processed.
  3. Watch the retry header. A value of X-Opigno-LIP-Retry above 0 means that earlier attempts failed. Use it for monitoring and alerts.
  4. Turn the auto retry off for time-sensitive webhooks. A retried event can arrive up to 4 days late.
  5. React to the emails. A DEGRADED or PAUSED webhook needs a fix on your side before the 14 days end.

Summary

  • A delivery fails on a status code outside 2xx/3xx, on a timeout (5 seconds to connect, 10 seconds to answer), on a connection error or on more than 2 redirects.
  • With the auto retry: up to 8 retries in about 4 days, then the webhook is paused and keeps new events for up to 14 days.
  • Without the auto retry: only timeouts are sent again, and any other failure disables the webhook at once.
  • Use X-Opigno-LIP-Delivery to remove duplicates and X-Opigno-LIP-Retry to track the attempts.