Learn how to make idempotent API requests to Straddle to safely retry operations.
Idempotency-Key
header in your HTTP requests. The Straddle uses this key to detect and prevent duplicate operations. If a request with a given key has already been successfully processed, Straddle will return the original response without re-executing the operation.
Idempotency-Key
header:
409 Conflict
error is returned, indicating a concurrent request.Idempotent-Replayed: true
header.409 Conflict
error is returned, indicating that the key has been reused for a different request.Idempotency-Key
header. We require a key length of 10-40 characters.
Here’s an example of how to include the Idempotency-Key
header in your API requests:
409 Conflict
errors in idempotency-related scenarios:
Idempotency-Key
that was previously used for a different request (e.g., different path, method, or request body), you will receive a 409 Conflict
error.
Idempotency-Key
for each distinct logical operation.
Idempotency-Key
that is currently being processed by another request, you will receive a 409 Conflict
error.
Idempotency-Key
header is supplied and does not meet the length requirements (10-40 characters), a 400 Bad Request
error will be returned.
Idempotency-Key
is present and meets the specified length requirements.
Idempotency-Key
. Do not reuse keys across different logical actions.409 Conflict
responses. For “key already used for a different request,” generate a new key. For “previous identical request currently in progress,” consider retrying.Idempotency-Key
is between 10 and 40 characters long.Idempotency-Key
with a different request body, path, or HTTP method. This will result in a 409 Conflict
error.