Skip to main content
Version: 2025-02-27

OCR v2

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.

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: 2

API version

Request Body schema:
required
Any of
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: 2

OCR model version (1 or 2)

Responses

Request samples

Content type
Example
{
  • "inputUrl": "string",
  • "fileId": "file1.pdf",
  • "forceBase64": false,
  • "metadata": { },
  • "webhook": "string",
  • "webhookSendFull": true,
  • "version": 2
}

Response samples

Content type
application/json
{
  • "status": "SUCCESS",
  • "documentId": "string",
  • "modelType": "string",
  • "id": "string",
  • "requestDateTime": "string",
  • "startTime": 0,
  • "endTime": 0,
  • "pages": 0,
  • "ocrResults": {
    },
  • "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: 2

API version

Request Body schema: application/json
required
Any of
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: 2

OCR model version (1 or 2).

Responses

Request samples

Content type
application/json
Example
{
  • "inputURL": "string",
  • "statusId": "string",
  • "outputURL": "string",
  • "outputURLHeaders": { },
  • "fileId": "string",
  • "forceBase64": false,
  • "metadata": { },
  • "webhook": "string",
  • "webhookSendFull": true,
  • "version": 2
}

Response samples

Content type
application/json
{
  • "status": "FAILURE",
  • "message": "Request body is missing required field(s): question"
}