Menu

Webhook receivers: what senders usually promise vs what your handler should assume

Reddit r/Backend·u/ClickOk5811·14 days ago
#aYWvlfnB
#event#usually#assume#promised#handler
Reading 0:00
15s threshold

Providers differ, so check yours. These are common patterns, written as “what’s usually promised” and “what I’d assume in the handler”.

1. Delivery

Usually promised: at-least-once. If your endpoint doesn’t answer 2xx, the sender retries, often with backoff.

Assume: duplicates will happen. Store processed event ids and skip repeats, or make the handler idempotent (an upsert instead of an insert).

2. Ordering

Usually promised: nothing, or “best effort”.

Assume: updated can arrive before created , and an old event can arrive after a newer one. Compare a version number or timestamp from the payload before overwriting, or treat the event as a signal and fetch the current state from the provider’s API.

3. Authenticity

Usually promised: a signature header, typically an HMAC of the payload with a shared secret.

Assume: anyone can POST to your URL. Verify the signature against the raw request body , because parsing and re-serializing JSON can change the bytes. Compare in constant time.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.