Idempotency (idempotency key)
An operation is idempotent if doing it twice has the same effect as doing it once. Retries become safe.
Networks fail after the server did the work but before the client heard back, so clients retry. Without idempotency a retry charges the card twice or sends two emails. An idempotency key is a unique id the client sends with the request; the server stores the result under it and returns the same result for a repeat instead of doing the work again.
Related terms
- Webhook: An HTTP request one system sends to another when something happens, instead of the other system asking repeatedly.
- Dead letter queue (DLQ): A separate queue where messages land after failing processing too many times, so they are kept instead of lost or retried forever.
- Runtime validation (Zod): Checking at run time that data from outside (requests, APIs, files, models) matches the type your code assumes.
