Idempotency-Key header on authenticated
POST, PUT, and PATCH requests. The current compatibility mechanism can
reduce duplicate side effects, but it is not an exactly-once guarantee.
Current Behavior
For the generic middleware, a key is scoped to the authenticated project, HTTP method, and request path:- The first request creates a key record and continues processing.
- If response persistence finishes successfully, a later matching request can receive the captured JSON status and body.
- A concurrent replay, or a replay whose response was not persisted, returns
409with error codeidempotency_conflict. - Reusing the key on a different method or path also returns
idempotency_conflict.
5xx response, can also be captured
and replayed.
Header Requirements
The database key can remain reserved after the 24-hour lookup window if cleanup
has not removed it. Treat keys as permanently single-use; do not assume they
become reusable after 24 hours.
Example
Generate the key before the first request and store it with your own operation record:- Reconcile the operation through current API state or an identifier you persist locally.
- If reconciliation does not establish an outcome, retry the exact same method, path, and body with the same key.
- Treat
409 idempotency_conflictas an ambiguous result requiring reconciliation; do not switch to a new key automatically. - Treat a replayed
5xxas an error result, not proof that no side effect occurred.
409
Endpoint-Specific Contracts
Some endpoints implement their own durable identity or retry contract. Those endpoint-specific rules take precedence over this generic header behavior. For example, Encrypted Upload v2 recovery deliberately bypasses generic response caching so that each retry rechecks current authorization and binding state.Integration Rules
- Generate keys client-side before sending the first request.
- Store the key and the exact request parameters together.
- Use a different key for every distinct logical operation.
- Serialize retries for one key; do not send concurrent attempts.
- Persist returned resource IDs and poll current state after ambiguous results.
- Do not assume the header makes upload completion, job creation, or other multi-step workflows exactly once.

