Idempotency
A submission that times out may or may not have made a job. Send an Idempotency-Key header with
POST /v1/extractions - 1 to 255 printable ASCII characters with no spaces; a new UUID for each file is ideal -
and sending the same request again can never create, or charge for, a second job:
- Same key, same file:
202with the first request’s job, and the headerIdempotent-Replayed: true. - Same key, a different file or a different template:
409 idempotency_key_reused. Use a new key for a new request. - Same key while the first request is still being handled:
409 idempotency_key_in_progresswithRetry-After; send it again then, and the answer is the first request’s job. - A request that ended without a job - refused for its file or its credits, or unable to store it - frees the key, so the retry after a top-up goes through with the same key.
A key belongs to the workspace and is remembered for 24 hours. A request is recognised by the file’s content and name, not by the raw request body, so a client that builds its multipart body afresh on every retry is still recognised. Test keys ignore the header until they can replay sample results.