Skip to main content

Idempotency

Use the Idempotency-Key header to safely retry POST requests without creating duplicate extractions. Keys are valid for 24 hours.

Pass an Idempotency-Key header on POST requests to safely retry without creating duplicate work. If a request with the same key has already been processed, the API returns the cached response.

Most integrations use idempotency keys when calling POST /v1/extract to guard against network timeouts or duplicate submissions. A typical workflow is to generate a UUID per logical operation, attach it as the Idempotency-Key header, and retry the same request on failure without risk of double-processing.

The cached response is stored for 24 hours and is scoped to your API key. A duplicate request within that window returns the original response body and HTTP status immediately, with no additional credit cost. After 24 hours the key expires and can be reused for a new request.

Pair idempotency with webhook callbacks (webhook_url option) for robust async workflows. Note that reusing a key with different request parameters will still return the first request's cached result — always generate a fresh key for each distinct operation.

Idempotency details

Header`Idempotency-Key: <your-unique-key>`
Supported endpoints`POST /v1/extract` (primary use case). Other POST endpoints may honor it in the future.
Key formatAny string up to 255 characters. UUIDs recommended.
TTL24 hours. After expiry, the same key can be reused.
ScopePer API key (customer). The same idempotency key used by different API keys are independent.

Behavior

Example — safe retry with idempotency

Always use a new idempotency key for each distinct logical operation. Reusing a key with different parameters will return the cached result from the first request, not process the new parameters.