Use when requests involve payment-like operations, write retries, duplicate submission handling, idempotency keys, safe retriable APIs, or protecting systems from repeated side effects. Design idempotent API operations and retry-safe clients: duplicate request handling, idempotency keys, conflict semantics, retry strategy, timeout recovery, and exactly-once illusions across distributed systems.
Retries are normal in distributed systems; duplicate side effects are not. Design mutating operations so clients can retry safely and servers can distinguish legitimate repetition from conflicting intent.
| Situation | Action |
|---|---|
| Mutation may be retried after timeout | Use an idempotency strategy rather than hoping the client guesses correctly. |
| Same key arrives with different payload or intent | Reject it as a conflict, not a replay. |
| Operation is naturally safe to repeat | Document the natural idempotency and keep retries bounded. |
| Side effect is costly or irreversible | Treat idempotency as a first-class contract requirement. |
| Client cannot tell whether the server completed work | Provide a replay-safe path or follow-up status retrieval model. |
references/idempotency-playbook.mdreferences/idempotency-checklist.md