How Idempotency Works
1
Generate a unique key for each logical operation
Before sending a mutating request (
POST or PATCH), generate a UUID v4 and store it alongside the operation context in your application. This key represents a single logical intent — for example, “create release for album Midnight Sessions.”2
Include the key in the Idempotency-Key header
Pass the UUID as the value of the
Idempotency-Key request header. The header must be present on every attempt of the same operation.3
Retry safely on network failure
If you receive a network-level error, a timeout, or a
500/503 response, retry the request using the same Idempotency-Key. The UMW platform will recognize the key and return the original response rather than processing the request a second time.4
Receive the deduplicated response
On a replayed request, the API returns the original HTTP status code and response body, along with an
Idempotent-Replayed: true header indicating that the response was served from cache rather than live processing.Key Expiry
Idempotency keys are stored by the UMW platform for 24 hours from the time of the first request. After expiry, a request with the same key value will be processed as a new operation. For long-running workflows that span multiple days, generate a fresh key for each new execution rather than reusing a key from a previous run.Example Request
The followingcurl command creates a new release with an idempotency key. If the command is interrupted and re-run with the same key, UMW will return the original response without creating a second release.
201 Created. All subsequent requests with the same key return 201 Created with the original response body and the Idempotent-Replayed: true header — no duplicate release is created.
Supported Endpoints
Idempotency keys are supported on all mutating endpoints listed below. Using theIdempotency-Key header on endpoints not in this list has no effect and the header will be silently ignored.
Idempotency Key Mismatch
If you send a request using anIdempotency-Key that was previously used with a different request body, the UMW API will reject the request with a 422 Unprocessable Entity error and the idempotency_key_mismatch error code:
- Reusing a key constant across multiple different operations in your codebase
- Copying a key from a previous run and modifying the request payload
- Using a static key during development that persists between test iterations