Skip to content

idempotency_key_conflict

HTTP/1.1 409 Conflict
{
"error": {
"type": "idempotency_error",
"code": "idempotency_key_conflict",
"message": "An earlier request used the same Idempotency-Key with a different request body.",
"docs_url": "https://docs.patomic.dev/errors/idempotency-key-conflict",
"request_id": "…",
"suggestion": "Generate a fresh Idempotency-Key per logical request. Reusing a key for a different intent is a client-side bug — the cached response would be wrong for the new intent."
}
}

The Idempotency-Key you sent was already used in the last 24 hours with a different request body. Returning the cached response would be wrong for the new request, and processing the new request would defeat the point of idempotency.

Generate a fresh idempotency key per logical request. Reusing a key for a different intent indicates a client-side bug — usually a stale UUID held in a variable across two semantically different operations.

// Wrong — same key for two different operations
const key = randomUUID();
await create("CI key", { rate_limit_rpm: 1000 }, key);
await create("Prod key", { rate_limit_rpm: 100 }, key); // 409
// Right — one key per logical operation
await create("CI key", { rate_limit_rpm: 1000 }, randomUUID());
await create("Prod key", { rate_limit_rpm: 100 }, randomUUID());