For the complete documentation index, see llms.txt. This page is also available as Markdown.

OCR Models

Help for manually integrating OCR models: API reference, test client, and cURL samples.

Send a file for an ocr utility inference.

post

Send a file to the asynchronous processing queue for an ocr utility inference.

Results can be retrieved in two ways:

  • Loop on the polling_url endpoint in the response until the status is Processed or Failed (polling).

  • Use a webhook to be notified when the inference is finished. Webhooks can be configured on the platform on a per-model basis.

Inferences taking longer than 590 seconds will time out.

Authorizations
AuthorizationstringRequired
Responses
post
/v2/products/ocr/enqueue

Get the status of a file's processing.

get

Get the status of an inference that was previously enqueued.

If you are using webhooks there is no need to call this route.

When the job status is Processing or Failed the return code will be HTTP 200.

When the job status is Processed the return code will be HTTP 302.

The processing result can then be retrieved in two ways:

  • Recommended: Using a GET on the URL specified in the result_url field of the response

  • Allowing your client to redirect on the Location header of the response

Note: set the redirect parameter to false to disable the redirection behavior, and always return HTTP 200.

Authorizations
AuthorizationstringRequired
Path parameters
job_idstring · uuid4Required

UUID of the job to retrieve

Query parameters
redirectbooleanOptional

Automatically redirect to the result URL

Default: true
Responses
200

Successful Response

application/json

Response for a Job.

get
/v2/jobs/{job_id}

Get the result of a completed ocr product inference.

get

Get the result of an ocr utility inference that was previously enqueued.

Important: always prefer using the value returned in job.result_url, rather than calling this endpoint directly.

The inference will only be available after it has finished processing.

If you are using webhooks there is no need to call this route. However, the JSON payload described here is what will be sent to each specified webhook's URL.

If you activated the "Delete extracted data when fetched" option for the model, the inference will be deleted after this route completes. Any further requests to the same inference ID will return a 404.

Authorizations
AuthorizationstringRequired
Path parameters
inference_idstring · uuid4Required

UUID of the inference to retrieve

Body

Form to enqueue an inference for utility models.

model_idstring · uuid4Required

Model ID to use for the inference.

fileany ofOptional

Upload a file as bytes. Required if url is not provided.

stringOptional
or
nullOptional
urlany ofOptional

Download the file from a URL, must be secure (HTTPS) and publicly available. Required if file is not provided.

string · uri · min: 1 · max: 2048Optional
or
nullOptional
file_base64any ofOptional

Upload a file as a base 64 string. Used as an alternative to file. Not recommended, for specific use only.

Example: Base64String==
string · min: 15Optional
or
nullOptional
webhook_idsstring · uuid4[]Optional

Webhook IDs to call after all processing is finished. If empty, no webhooks will be used. Can be a list or comma-separated string.

filenameany ofOptional

Optional filename to associate with the uploaded or fetched file.

stringOptional
or
nullOptional
aliasany ofOptional

Optional: a free-form string to tag the request with your own identifier. For example, an internal document ID, reference number, or database key. If set, it will be included in the job and result responses.

Example: my_file_alias
stringOptional
or
nullOptional
Responses
200

Successful Response

application/json

Response for an ocr utility inference.

get
/v2/products/ocr/results/{inference_id}

Ocr Utility Processed

When an OCR utility inference is processed, this payload is sent to the specified webhooks.

Webhooks are specified in the webhooks_ids parameter when enqueuing an OCR utility inference.

Payload

Response for an ocr utility inference.

Responses
200

Successful Response

application/json
anyOptional

Payload

Last updated

Was this helpful?