HTTP status: 409 · Title: “Idempotency key conflict”Documentation Index
Fetch the complete documentation index at: https://docs.kash.bot/llms.txt
Use this file to discover all available pages before exploring further.
When it fires
The sameIdempotency-Key was used for two requests with different bodies. The server refuses to either re-execute (would violate idempotency) or replay the cached response (would mislead the caller about which request “won”).
Why it happens
- Most common: a retry layer regenerated the body on each attempt instead of capturing it once and replaying.
- A bug in the caller that mutates the body in-place between the request being prepared and the request being sent.
- Two distinct logical operations accidentally sharing a key (e.g., a global key generator that didn’t account for concurrency).
How to fix
- Pin the request body before generating the idempotency key. Either:
- Capture body + key together in your retry wrapper and re-send the exact pair on each attempt.
- Generate a fresh key per logical operation (one trade = one key).
- For genuinely retryable bodies that legitimately change between attempts (e.g., updated timestamps), generate a fresh key per attempt — that’s the contract.
Related codes
CLIENT_REQUEST_ID_CONFLICT— analogous conflict, but on the body-levelclientRequestIdfield rather than the HTTP headerIDEMPOTENCY_KEY_EXPIRED— key valid earlier, now past TTL