Skip to main content
A network failure can leave you unsure whether a request reached Elastly. An idempotency key lets you send the same request again without acting twice: the API runs the first request and returns its stored response to every retry. This page covers which endpoints take a key, how keys are matched and the errors they return.

Send a key

Send an Idempotency-Key header with a value you generate, such as a UUID. The value is 1 to 255 printable ASCII characters with no spaces. Any other value is refused with 400 and invalid_idempotency_key.
Use a new key for each new request and the same key for each retry of that request.

Which endpoints take a key

A request to an endpoint that requires a key and sends none is refused with 400 and idempotency_key_required.

How a retry is answered

A key belongs to the API key that sent it and to one endpoint. The API also records the request body and the API version with it. The API keeps a key and its stored response for at least 30 days. After that, the same key starts a new request.

Retry with backoff

Retry a request that failed with a network error, 409 with idempotency_request_in_progress, 429 or 503. Wait between attempts and honour the Retry-After header when the response carries one. See Rate limits and Errors.