
Idempotency Keys: When Should Your API Use Them?
An idempotency key is a client-generated token, usually a UUID, sent with a POST or PATCH so the server can recognize a retry of the same operation. GET, PUT, and DELETE are already idempotent: repeating them does not apply the change twice. POST and PATCH are not. If the client times out and sends a new key, the server may create a second order, payment, or user. Store the key with the result, reject the same key with a different body, and return 409 if a retry arrives while the first request is still running.






























