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; an
empty header is refused with 400 invalid_idempotency_key, never taken for none - 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 and file, the same template named another way: the same request, answered with the first job. Leaving
templateIdout on one and naming the template the job was delivered with on the other -drawing, or the workspace’s default - is one request, as is naming the version the job used or leaving it to be the newest. - 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 recognized 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 recognized.