Quick Summary: Send a unique
Idempotency-Key header on any write. Retrying with the same key and the same body replays the original response instead of performing the operation twice.The contract
- First execution stores the successful response for 24 hours.
- A retry (same key, same method, path and body) replays it verbatim, with the header
Idempotency-Replayed: true, executing nothing. - Same key, different content → 409 idempotency-key-reused.
- Two concurrent duplicates → exactly one executes; the other briefly waits, then replays or returns a 409 conflict asking you to retry shortly.
- Errors are never replayed — a failed request releases the key so the same key can retry.