Developer API

Idempotency and safe retries

Use one idempotency key per create or update so a retry never does the work twice.

The rule

An idempotency key is 8–200 characters using only letters, digits, period, underscore, colon or hyphen (pattern ^[A-Za-z0-9._:-]{8,200}$). Document ingestion and webhook endpoint updates, deletes, tests and delivery replays take it as the Idempotency-Key header; document operations, secure links, webhook endpoint creation and the other create calls take it as the idempotencyKey field of the JSON body, as each request schema in the OpenAPI document shows. A missing or malformed key is rejected before any work starts. Generate the key in your application, store it before you send the request, and send the same value only when retrying that same request.

Same key, same request

  • Keep the environment, path, target and parameters the same when you retry.
  • Store the returned resource ID with the key.
  • If anything in the request changes, use a new key.
  • A repeat returns the original result: POST /api/v2/documents answers 200 with created false and POST /api/v2/document-operations answers 200 with accepted false.

When you do not know if it worked

If the connection fails after you sent a request, do not guess whether it was accepted. Repeat the same request with the same key. You get the original result back, and nothing is created or charged twice.

Choosing keys

PatternGood for
order-1842-compress-v1One specific business action
document:<your-id>:ingest:v3Uploading one source file or version
webhook:<event-id>:effect:<name>One action taken in response to one event
A new random value for every HTTP attemptWrong: this disables retry protection