Idempotency
Safely retry write operations without risk of duplicate keyword creation or accidental duplicate credit charges.
Why Use Idempotency Keys?
If an HTTP connection drops before you receive a response, you cannot know whether the server executed your request or failed before starting.
To prevent duplicate manual runs or duplicate keyword additions when retrying network requests, pass an Idempotency-Key header containing a unique identifier (such as a UUID).
How the Server Handles Idempotent Requests
- First Request: The server saves your
Idempotency-Keyand a hash of the request payload, executes the operation, and caches the response for 24 hours. - Retries with Identical Payload: If the server receives another request with the same
Idempotency-Keyand identical request body, it immediately returns the cached response with the original status code and headers without re-executing or re-charging credits. - Mismatched Payload Conflict (409): If the same key is reused with a different request body, the API refuses execution and returns HTTP
409 Conflictwith error codeidempotency_mismatch.
SDK Automatic Idempotency
The official @trackserps/sdk generates a cryptographically random UUID for every POST write request automatically, ensuring zero duplicates during connection blips or automatic retries: