Skip to main content
A timeout does not tell you whether the server processed your request — retrying blindly can create the same document or folder twice. Most create operations accept an Idempotency-Key header that makes retries safe. This guide demonstrates it with two requests.

Step 1: Send a create request with an idempotency key

Generate a unique string per logical operation — a UUID works well — and send it in the Idempotency-Key header:
Request
Response
The first attempt behaves as if the header was not there — the folder is created normally.

Step 2: Retry the identical request

Sending the exact same request with the same key does not create a second folder — the stored response is replayed:
Request
Response
The body is identical to the first response, and the Idempotency-Replayed response header tells you it was a replay. Keys are remembered for a limited time after completion; reusing a key with a different payload is rejected with 422, and a retry that arrives while the original is still being processed is answered with 409 — wait and retry.
Generate the key when the logical operation starts, not per HTTP attempt, and reuse it for every retry of that operation — that is the whole trick.

Complete example

A create that survives a timeout, as a Node.js script. The key is generated once, outside the retry loop, so every attempt is the same logical operation.

Next steps

  • Decide which failures are worth retrying at all — Handle errors.
  • Retry a document create the same way — Create a document from a file.
  • Which operations accept Idempotency-Key is documented per endpoint in the API reference.