Networking and APIs / Intermediate / 5 min / Updated
Webhooks: retries, backoff, duplicates and signatures
Take your webhook receiver down for an hour. See which retry schedule loses events, which floods you on recovery, and why handlers need dedupe and HMAC.
Start the simulation → Change the load, break a part, watch what happens. Free, no sign-up.
In short
What is webhooks?
Webhooks are HTTP callbacks a provider sends to your server when an event happens, retried until acknowledged.
Why does it matter?
Payments, shipping and Git events must reach your system without you polling the provider all day.
What is the trade-off?
Retries prevent loss but cause duplicates and recovery spikes, so receivers must dedupe, verify and answer fast.
How do you explain it in an interview?
"Verify the HMAC, store the event id, return 200 at once and process from a queue; reconcile via the list API."
Check yourself
Why should webhook retries use exponential backoff with jitter?
Answer: To cover long outages without hitting the recovering receiver with every retry at once. Fixed schedules give up early or synchronise; jitter spreads the backlog.
Why must a webhook handler be idempotent?
Answer: The same event can arrive more than once after timeouts and retries. Delivery is at-least-once; dedupe by the event id.
What does the HMAC signature on a webhook prove?
Answer: The request came from someone holding the shared secret and the body was not changed. Without it, anyone who finds the URL can post fake events.