Answered

Why does my webhook keep getting retried, and when does it stop?

Ultraner Team Ultraner· 2h ago· 0 views

My endpoint is receiving the same event several times over a day. I am processing it correctly as far as I can tell. What decides whether you retry?

Accepted answer

Ultraner Team Ultraner· 2h ago

The status code you return, and nothing else.

The schedule is five attempts: immediately, then after 30 seconds, 5 minutes, 1 hour, and 24 hours. If you are seeing deliveries spread across a day, you are on that curve.

What stops it:

  • a 2xx stops it permanently, and is the only thing that means "I have this"
  • a 4xx stops it permanently too, treated as "this will never work", so do not return 400 for a problem that is really temporary
  • a 5xx, a timeout, or a connection failure keeps it going until the attempts run out

Two things worth doing regardless:

  1. Verify the signature. Every delivery carries X-Ultraner-Signature, an HMAC-SHA256 of the body. Compare it with a constant-time comparison, never ==.
  2. Make your handler idempotent. X-Ultraner-Delivery identifies the attempt and the event id identifies the event. Record the event id and ignore one you have already processed. Retries are normal, not a fault, and at-least-once delivery is the guarantee we make on purpose.

The usual cause of the pattern you are describing is returning 200 only after slow downstream work finishes, and timing out before you get there. Acknowledge first, work afterwards.

Answering opens shortly, with your Ultraner account. More in Integrations and the API

Why does my webhook keep getting retried, and when does it stop? - Ultraner Community | Ultraner