Webhooks and events Required
Make receivers idempotent
Give every event a unique ID, and make receivers ignore an ID they have already processed.
How to do it
Webhooks arrive at least once, so duplicates are normal. Store processed IDs. Answer 2xx fast and do slow work afterwards, so the sender doesn't time out and retry.
How to check
Deliver the same event twice. The receiver acts once and answers 2xx both times.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers api design playbook: https://agentwranglers.se/playbook/api-design/webhooks-and-events/idempotent-receivers.