How it works
- The first request with a key runs, and its response is kept for 24 hours.
- A repeat with the same key and the same body returns that response, with the header
Idempotency-Replayed: true. - The same key with a different body is refused with
409 IDEMPOTENCY_KEY_REUSED. - A repeat that arrives while the first is still running gets
409 IDEMPOTENCY_REQUEST_IN_PROGRESS, which is retryable. - If the first request fails, the key is released so you can retry with it.
Where it applies
In the SDK
The SDK retries reads, and writes that carry an idempotency key, on timeouts, connection errors,429 and server errors. A write without a key is never retried, so it can never be applied
twice.
A retry can find the first request still running: Useroutr carries on after a client times out.
On 409 IDEMPOTENCY_REQUEST_IN_PROGRESS the SDK keeps asking with the same key for up to
timeoutMs and returns the first request’s result once it completes. These waits do not count
against maxRetries; setting maxRetries: 0 turns them off with every other retry.