Idempotency-Key header to any write request and the server will return the cached response on a retry instead of executing the operation a second time. This is how you guard against duplicate side effects from network failure, browser double-submit, or dispatcher re-delivery. By the end of this page you will know what the key is, when to send it, and the rules the cache enforces.
How it works
Where it applies
| Method class | Behavior |
|---|---|
GET | Naturally idempotent. Header is ignored if sent. |
POST, PUT, PATCH, DELETE | Header is honored. Cached responses are replayed inside the 24-hour window. |
Key requirements
Cache window
The cached response lives 24 hours from the first successful request. After that, the entry expires and the same key is treated as a new attempt. The window covers dispatcher retries, CI re-runs, and same-day human double-submits. The cache is eventually consistent across regions — propagation is typically under 60 seconds. A retry hitting a different region inside that window may execute again. For payment-class operations, treat idempotency keys as necessary but not sufficient and combine with application-level deduplication.TypeScript SDK
@gavai/sdk-typescript generates and attaches an Idempotency-Key for every POST, PATCH, PUT, and DELETE call. Pass { idempotencyKey } explicitly when you need to control the key across a retry loop:
Next
Errors and retries
Status codes, retry classes, and the
Retry-After contract on 429s.