POST or PATCH replay its cached response. Check availability and caching limits before relying on it to prevent duplicate work.
Idempotency-Key enforcement is live on the Extended API today and rolling out to the Main API. Including the header on Main API requests is forward-compatible: today it has no effect, and once the rollout completes, retries with the same key replay the cached response.
How it works
1
Generate a key
Generate a unique key per logical request, typically a UUID, a hash, or your own primary key.
2
Send it on the first attempt
Add an
Idempotency-Key header to your POST or PATCH.3
Retry with the same key and body
If the request times out or fails partially, retry with the exact same key and exact same body.
4
Receive the cached response
Where idempotency enforcement is enabled, Spotzee replays the cached status and body. The response header
Idempotent-Replayed: true confirms a replay; do not rely on the request’s correlation header staying the same.Scope and TTL
- Scope: keys are scoped per API key, so distinct API keys have separate replay caches. Within one API key, use a unique idempotency key across all paths and methods; changing the URL does not create a separate replay scope.
- Per-surface scope: the Main API and Extended API maintain independent caches. The same
Idempotency-Keysent to both surfaces is treated as two distinct requests. Pick a fresh key per surface if you want isolation, or reuse it deliberately knowing each surface will replay independently. - TTL: cached responses live for 24 hours. After that, a request with the same key runs as a brand-new operation.
- Eligible methods:
POSTandPATCH.GET,HEAD, andDELETEare idempotent by definition and ignore the header.
What Spotzee does on replay
Errors
Generating keys
Use a non-empty opaque string of up to 255 characters. Pick a generator that suits your platform:When not to reuse a key
Reuse a key for the same logical operation. For example, retrying the same contact upsert after a timeout. Mint a fresh key when:- The user submits the form a second time after deciding to change a field.
- You’re processing a queue and each message is a distinct operation.
- You’re running a backfill. Each row is its own logical request.
Caching rules
2xxresponses are cached.4xxresponses are eligible for caching except408,425, and429.5xx,408,425, and429responses are not cached so retries can succeed when the platform recovers.- Oversized or unreadable response bodies are not cached. The Main API also excludes responses carrying
Retry-After.
Next steps
Rate limits
Request limits and retry headers.
Errors
Status codes and the
code catalogue.