Send an idempotency key
Add anIdempotency-Key header, a unique value such as a UUID, to any mutating request
(POST, PUT, PATCH, DELETE). Reuse the same key when you retry that request.
GET
requests are already safe to repeat, so they don’t need a key.
What happens on a retry
Scope and lifetime
A key is bound to your auth context and the exact request (method, path, and body). If you send the same key with a different body, Spritz rejects it with a422 rather than
risk returning the wrong result. Keys are remembered for 24 hours; after that, the
same key is treated as new.
Error responses
Best practices
- Generate a unique key per operation, for example a UUID.
- Reuse the same key when you retry the same operation, so the retry is deduplicated.
- Never reuse a key for a different operation.
- Persist the key until you’ve confirmed the outcome, so a crash and retry uses the same key.