POST /ocr

Create an OCR document (text or images) from a file. This allows you to specify the files you would like to create an OCR’d document request. Due to the asynchronous nature of processing an OCR request, the results for each of the files will be returned independently. Thus the endpoint will return a number of OCR identifiers (request_id) which will be then used to check the status or retrieve the results for each file.


Authorization (required) - Requires the standard authentication header used in the system.


  • file_ids Body Required

    the ids for the documents to OCR

  • layout Body

    providing a value of true will allow use of the GET/ ocr/layout endpoint

Code Sample
curl -X POST -H "Accept: application/json"  
-H "Authorization: Bearer <token>" 
-H "Content-Type: application/json"  
-d "{"file_ids": ["<file_id>"],
     "layout": true
ocrs, _ = zdai.ocr.create(file_ids = ['file_id_1', '...'])
Response Codes
  • 202 Accepted
    OCR has been created successfully.
  • 400 Bad Request
    Malformed request body, or file_id is missing.
  • 403 Forbidden
    Invalid or missing authentication token.
  • 404 Not Found
    The file specified does not exist.
  • 409 Conflict
    The OCR result is not ready.
  • 500 Internal Server Error
    Something went wrong unrelated to the users request.

Response Data

  • request_id

    the request identifier that can be used to retrieve the OCR results

  • file_id

    for each file_id you should check to confirm whether the submission was successful

  • status

    the status of the request. Could be queued, processing, or complete

  • error

    if an error occurs, you may get a standard error response

    "file_ids": [
            "file_id": "<file_id>",
            "status": "queued",
            "request_id": "<request_id>"

Need Help?

Couldn’t find the information you were looking for or need more assistance?

Contact Support