Idempotency-Key header with requests that create a resource or start an operation, and Cloud recognizes a repeated request and returns the original result instead of doing the work again.
Send an idempotency key
Generate a unique value for each operation, such as a UUID, and send it in theIdempotency-Key header. Replace ENDPOINT_PATH with the path of an endpoint that accepts the header:
Send a request again
When an agent retries a step, a CI job reruns, or your client times out before it reads the response, send the request with the same key and the same body. Use a new key for each new operation. Cloud stores the response to the first successful request with a key for 24 hours. Every repeated request with that key gets the same status code and body, with anIdempotent-Replayed: true header. Cloud scopes keys to the API token, so two tokens can use the same key without conflict.
Cloud stores only successful responses. If a request fails with a 4xx or 5xx status code, fix the request and send it again with the same key.
Errors
Each error response has amessage and a code:
A request with the same key is still running. Retry after the number of seconds in the
Retry-After header.The first request succeeded, but Cloud could not store its response. Fetch the resource instead.

