OCR v2
JSON response
JSON response
Make a request to OCR and receive JSON response data.
File upload options
We support requests with Content-Type application/json or multipart/form-data. Note that application/json requests are preferred as multipart/form-data requests do not support all flags and fields.
- [application/json]inputURL link to file
- [application/json]base64 base64 encoded file data
- [multipart/form-data]file upload local file from browser
header Parameters
| orgId required | string (orgId)   non-empty ^[a-zA-Z0-9\-_]+$ Organization ID | 
| authKey required | string (authKey)   non-empty ^[a-zA-Z0-9\-_]+$ Authentication key | 
| apiVersion | string (apiVersion)   non-empty YYYY-MM-DD  Default:  2025-02-27 API Version | 
| subOrgId | string (subOrgId)   non-empty ^[a-zA-Z0-9\-_]+$ Sub-organization ID | 
| version | integer (version)   non-empty   Default:  1 OCR model version (1 or 2) | 
Request Body schema: required
| inputUrl required | string (inputURL)  URL for the file to extract data from: Must be a PDF, JPEG, PNG, or TIFF. | 
| fileId | string (fileId)   Default:  "UUID"Examples: "file1.pdf" Custom ID for document. If not present, will default to a random UUID. | 
| forceBase64 | boolean (forceBase64)   Default:  false Setting this parameter to true converts files to Base64 format before sending them on to the model. | 
| metadata | object (metadata)  Custom JSON to be included in the returned response. | 
| webhook | string Webhook to ping after API runs. | 
| webhookSendFull | boolean  Default:  true Set to true to send all response data to webhook upon request completion, otherwise only send request status. | 
| version | integer  Default:  1 OCR model version (1 or 2) | 
Responses
Request samples
- Payload
{- "inputUrl": "string",
- "fileId": "file1.pdf",
- "forceBase64": false,
- "metadata": { },
- "webhook": "string",
- "webhookSendFull": true,
- "version": 1
}Response samples
- 200
- 400
- 403
- 404
- 500
- 502
{- "status": "SUCCESS",
- "documentId": "string",
- "modelType": "string",
- "id": "string",
- "requestDateTime": "string",
- "startTime": 0,
- "endTime": 0,
- "pages": 0,
- "ocrResults": {- "version": "string",
- "modelVersion": "string",
- "readResults": [- {- "pageNumber": 0,
- "angle": 0,
- "width": 0,
- "height": 0,
- "unit": "string",
- "lines": [- {- "content": "string",
- "polygon": [- 0
 ],
- "spans": [- {- "offset": 0,
- "length": 0
 }
 ]
 }
 ],
- "words": [- {- "content": "string",
- "polygon": [- 0
 ],
- "confidence": 0,
- "span": {- "offset": 0,
- "length": 0
 }
 }
 ],
- "spans": [- {- "offset": 0,
- "length": 0
 }
 ],
- "kind": "string"
 }
 ],
- "readStyles": [- {- "confidence": 0,
- "spans": [- {- "offset": 0,
- "length": 0
 }
 ],
- "isHandwritten": false
 }
 ],
- "rawText": "string"
 },
- "resultUrl": "string",
- "metadata": { },
- "ocrVersion": "2"
}ZIP file response
Make a request to OCR and receive response data in a ZIP file.
File upload options
We only support requests with Content-Type application/json at this endpoint.
- [application/json]inputURL link to file
- [application/json]base64 base64 encoded file data
Response zip file contents
| File | Description | 
|---|---|
| .csv | CSV containing a breakdown of the itemization | 
| .json | JSON file containing the entire JSON response | 
| .txt | TXT file containing the entire JSON response | 
| file | The original uploaded file | 
The default name for the file is an epoch timestamp if fileId field is not included in the request.
query Parameters
| boolean or null Runs request asynchronously | 
header Parameters
| orgId required | string (orgId)   non-empty ^[a-zA-Z0-9\-_]+$ Organization ID | 
| authKey required | string (authKey)   non-empty ^[a-zA-Z0-9\-_]+$ Authentication key | 
| apiVersion | string (apiVersion)   non-empty YYYY-MM-DD  Default:  2025-02-27 API Version | 
| subOrgId | string (subOrgId)   non-empty ^[a-zA-Z0-9\-_]+$ Sub-organization ID | 
| version | integer (version)   non-empty   Default:  1 OCR model version (1 or 2) | 
Request Body schema: application/jsonrequired
| inputURL required | string https?://(?:www\\.)?[a-zA-Z0-9./]+ URL for the file to extract data from: Must be a PDF, JPEG, PNG, TIFF, or TXT. | 
| webhook required | string https?://(?:www\\.)?[a-zA-Z0-9./]+ Webhook to ping after API runs. | 
| statusId | string List of document IDs for each file uploaded. | 
| outputURL | string https?://(?:www\\.)?[a-zA-Z0-9./]+ URL where resulting zip file should be sent. Must be open to PUT requests. Required if submitting an async request. | 
| outputURLHeaders | object Request headers to include in the PUT request to the output URL. | 
| fileId | string Custom ID for document. | 
| forceBase64 | boolean  Default:  false Setting this parameter to true converts files to Base64 format before sending them on to the model. | 
| metadata | object Custom JSON to be included in the returned response. | 
| webhookSendFull | boolean  Default:  true Set to true to send all response data to webhook upon request completion, otherwise only send request status. | 
| version | integer  Default:  1 OCR model version (1 or 2). | 
Responses
Request samples
- Payload
{- "inputURL": "string",
- "statusId": "string",
- "outputURL": "string",
- "outputURLHeaders": { },
- "fileId": "string",
- "forceBase64": false,
- "metadata": { },
- "webhook": "string",
- "webhookSendFull": true,
- "version": 1
}Response samples
- 400
- 403
- 404
- 500
- 502
{- "status": "FAILURE",
- "message": "Request body is missing required field(s): question"
}