POST, PATCH, and DELETE requests accept an Idempotency-Key header. Retry with the same key and Deck returns the original response instead of performing the operation again. GET requests are naturally idempotent and do not require a key.
How it works
Include anIdempotency-Key header on any POST, PATCH, or DELETE request.
- Same parameters: Deck returns the cached response. The operation is not repeated.
- Different parameters: Deck returns a
409 Conflictwith anidempotency_errorto prevent accidental misuse. - After 24 hours: the key expires and can be reused.
When to use them
Use idempotency keys on any create operation where a duplicate would cause problems:
You don’t need idempotency keys for
GET requests. Reads are naturally idempotent.
Key format
Keys can be any string up to 256 characters. Keys longer than 256 characters are rejected with a400 error.
Generating keys
Retry pattern
A typical retry flow with idempotency:Error handling
Key reuse with different parameters returns HTTP409:
400: