Idempotency-Key header on a POST request and a retry of the same request will not create a second call, lead or ticket.
Where it applies
The header is optional. Without it, the request behaves as before. On any other endpoint the header is ignored.
Key format
8 to 128 characters: letters, digits,., _, : and -. Use a UUID or a stable id from your system, such as an order id. Any other format returns 400 with INVALID_IDEMPOTENCY_KEY.
Keys are scoped to your account and to the API version. The same key used on v1 and v2 is two independent keys.
What happens on a retry
“Same request” means the same method, path and JSON body. Key order inside the body does not matter, and the query string is not part of the comparison. In v2 the body is compared after validation, so values that normalize to the same input (for example extra whitespace around a name, or unknown fields that are dropped) count as the same request.
In v2, a replayed success response carries the
requestId and timestamp of the replaying request, with the same data. A replayed error response is stored as sent, so it keeps the requestId of the original request.
What is not stored
- Responses with a
5xxstatus or429are not stored. You can retry with the same key and the request is processed again. - Requests rejected before the key is checked are not recorded. In v2 that includes authentication errors, rate limiting and body validation errors. You can fix the request and reuse the key.
What is stored
Every other response is stored and replayed, including4xx errors produced by the handler. For example, a 402 for insufficient credits or a 404 for an unknown agent is replayed for the same key. In v1, body validation runs inside the handler, so a 400 is also replayed. Use a new key after you change the request.
Slow requests and fail-open behavior
- While a request with a key is running, the server keeps its in-progress claim alive (it is refreshed every 40 seconds against a 120-second claim). A slow
POST /calls/bulktherefore keeps blocking a duplicate with409 IDEMPOTENCY_IN_PROGRESSuntil it finishes. If the worker crashes, the claim expires after 120 seconds and the key can be used again. - Idempotency is fail-open. If the idempotency store is unavailable when the request starts, the request is processed without protection instead of being rejected, and a retry with the same key can run twice. If the store fails while the response is being saved, the response is still returned to you, but a retry may run again.
Idempotency protects against duplicate submissions by your own retries. Do not rely on it as the only guard against duplicates when your operation is not safe to repeat.
Retry pattern
- Generate the key once per logical operation, before the first attempt.
- On a timeout, a network error,
429,503or500, retry with the same key and the same body. - On
409 IDEMPOTENCY_IN_PROGRESS, wait forRetry-Afterand retry. - Never reuse a key for a different operation.