Article · Updated November 8, 2026 · By the Hooks team

Webhook retry strategy that works

Short answer: A workable webhook retry strategy retries only transient failures (timeouts, 429, 5xx), backs off exponentially with jitter, keeps the same delivery id so the receiver can deduplicate, and stops after a bounded window or attempt count. Permanent failures (400, 401, 404) should not be retried at all.

Retries protect against blips. Unbounded retries turn one broken destination into a queue that never drains.

Classify the response first

2xx: delivered. 3xx: follow only if the client follows redirects safely, otherwise treat as failure. 408, 425, 429, 5xx: retry. Other 4xx: fail immediately and surface the error, because resending the same request will not help.

Back off, with jitter

Double the delay between attempts and cap it, then add randomness so thousands of deliveries to a recovering destination do not arrive at the same instant. Honour Retry-After when the destination sends it.

Delay

delay = min(cap, base * 2 ** attempt)
delay = random(0, delay)        // full jitter
if (retryAfter) delay = max(delay, retryAfter)

Keep identity stable and bound the window

Every attempt for one event carries the same delivery id, which is what lets the receiver deduplicate a request whose response was lost. After the window closes, move the delivery to a dead-letter state with its failure reason, and replay it once the destination is fixed.

Retry, replay, and source redelivery are different

An automatic retry is scheduled by the sender and keeps the original delivery id. A manual retry of one delivery grants a single extra attempt. Replaying an event creates new delivery attempts against every destination of that event, which is what you want after fixing a dead delivery or a misconfigured destination.

Asking the provider to redeliver is the fallback, not the default. GitHub's redelivery reuses X-GitHub-Delivery, but a provider may rate-limit or expire its own history. If Hooks rejected the request with the quota 429, the event was never stored, so replay cannot help: resend it after the balance has headroom.

All three paths require an idempotent destination. None of them provides exactly-once execution. The local walkthrough reproduces replay and duplicate suppression end to end with `pnpm e2e:agent-recovery`.

Replay a stored event with the REST API

# The API key needs the deliveries:retry scope.
# New delivery attempts for every destination of the event
curl -X POST "https://api.hooks.events/v1/events/evt_123/replay" \
  -H "Authorization: Bearer $HOOKS_API_KEY"

# One extra attempt for a single delivery instead
curl -X POST "https://api.hooks.events/v1/deliveries/dlv_123/retry" \
  -H "Authorization: Bearer $HOOKS_API_KEY"

Frequently asked questions

How many retries are enough?

Bound by time rather than count. Most incidents clear within minutes to hours, so a window of a few hours to a day covers the useful cases without holding a broken destination forever.

Should a 429 count as a failure?

It is a retryable failure. Back off at least as long as Retry-After says, and count it toward the attempt budget so one throttling destination cannot stall the queue.

Try the flow without an account

Send a test webhook to a temporary endpoint and watch signature verification and forwarding. No account, card, or paid model call is involved.

Keep reading