Forms v2
Forms
Download OpenAPI specification:Download
JSON response
Make a request to the Forms model 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 |
version | integer (version) Default: 2 API version |
Request Body schema: required
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. |
fileId | string Default: "UUID" Examples: "file1.pdf" Custom ID for document. If not present, will default to a random UUID. |
metadata | object Custom JSON to be included in the returned response. |
webhook | string https?://(?:www\\.)?[a-zA-Z0-9./]+ Webhook URL to send status updates and JSON response to. |
webhookSendFull | boolean Default: false When set to |
forceBase64 | boolean Default: false Setting this parameter to true converts files to Base64 format before sending them on to the model. |
forceOCR | boolean Default: false Set this parameter to true if the input file is a fillable pdf. |
webhookHeaders | object Request headers to include in the POST request to the webhook. |
Responses
Request samples
- Payload
{- "inputURL": "string",
- "fileId": "file1.pdf",
- "metadata": { },
- "webhook": "string",
- "webhookSendFull": false,
- "forceBase64": false,
- "forceOCR": false,
- "webhookHeaders": { }
}
Response samples
- 200
- 400
- 403
- 404
- 500
{- "documentId": "string",
- "id": "string",
- "pages": 0,
- "entitiesExtracted": [
- {
- "boundingRegions": [
- {
- "pageNumber": 0,
- "polygon": { }
}
], - "category": "string",
- "confidence": 0,
- "spans": [
- {
- "offset": 0,
- "length": 0
}
], - "subCategory": "string"
}
], - "isUrgent": false,
- "keyValuePairs": [
- {
- "confidence": 0,
- "key": {
- "boundingRegions": { },
- "content": "",
- "spans": { }
}, - "value": {
- "boundingRegions": { },
- "content": "",
- "spans": { }
}
}
], - "modelType": "string",
- "ocrResults": {
- "modelVersion": "string",
- "readResults": [
- {
- "pageNumber": 0,
- "angle": 0,
- "height": 0,
- "width": 0,
- "unit": "string",
- "words": [
- {
- "content": "string",
- "polygon": [
- 0
], - "confidence": 0,
- "span": {
- "offset": 0,
- "length": 0
}
}
], - "selectionMarks": [
- {
- "polygon": [
- 0
], - "confidence": 0,
- "span": {
- "offset": 0,
- "length": 0
}, - "state": "unselected"
}
], - "lines": [
- {
- "polygon": [
- 0
], - "content": "string",
- "spans": [
- {
- "offset": 0,
- "length": 0
}
]
}
], - "spans": [
- {
- "offset": 0,
- "length": 0
}
]
}
], - "readStyles": [
- {
- "confidence": 0,
- "isHandwritten": true,
- "spans": [
- {
- "offset": 0,
- "length": 0
}
]
}
], - "version": "string"
}, - "rawText": "string",
- "requestDateTime": "string",
- "status": "string",
- "tablesExtracted": [
- {
- "boundingRegions": [
- {
- "pageNumber": 0,
- "polygon": { }
}
], - "cells": [
- {
- "kind": "string",
- "rowIndex": 0,
- "columnIndex": 0,
- "columnSpan": 0,
- "content": "string",
- "boundingRegions": [
- {
- "pageNumber": 0,
- "polygon": { }
}
], - "spans": [
- {
- "offset": 0,
- "length": 0
}
]
}
], - "columnCount": 0,
- "rowCount": 0,
- "spans": [
- {
- "offset": 0,
- "length": 0
}
]
}
], - "metadata": { },
- "startTime": 0,
- "endTime": 0
}
Zip file response
Make a request to the Forms model 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
The default name for the file is an epoch timestamp if fileId
field is not included in the request.
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 |
version | integer (version) Default: 2 API version |
Request Body schema: required
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. |
fileId | string Default: "UUID" Examples: "file1.pdf" Custom ID for document. If not present, will default to a random UUID. |
forceBase64 | boolean Default: false Setting this parameter to true converts files to Base64 format before sending them on to the model. |
forceOCR | boolean Default: false Set this parameter to true if the input file is a fillable pdf. |
metadata | object Custom JSON to be included in the returned response. |
webhook | string https?://(?:www\\.)?[a-zA-Z0-9./]+ Webhook URL to send status updates and JSON response to. |
webhookSendFull | boolean Default: false When set to |
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. |
statusId | string WARNING: Deprecating in favor of 'fileId'. Custom ID for document. If not present, will default to a random UUID. |
webhookHeaders | object Request headers to include in the POST request to the webhook. |
Responses
Request samples
- Payload
{- "inputURL": "string",
- "fileId": "file1.pdf",
- "forceBase64": false,
- "forceOCR": false,
- "metadata": { },
- "webhook": "string",
- "webhookSendFull": false,
- "outputURL": "string",
- "outputURLHeaders": { },
- "statusId": "string",
- "webhookHeaders": { }
}
Response samples
- 400
- 403
- 404
- 500
{- "status": "FAILURE",
- "message": "Request body is missing required field(s): question"
}
Queue an async zip request
Queue an asynchronous request to Forms model and receive response data in a ZIP file, sent to an outputURL
.
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[multipart/form-data]
file upload local file from browser
The default name for the file is an epoch timestamp if fileId
field is not included in the request.
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 |
version | integer (version) Default: 2 API version |
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. |
required | Array of strings or string Base64 encoded string for the file to extract data from. If it is an array, the base64 strings will be appended into one PDF then ran through the model. |
file required | string <binary> File to upload: Must be a PDF, JPEG, PNG, TIFF, or TXT. |
outputURL required | 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. |
fileId | string Default: "UUID" Examples: "file1.pdf" Custom ID for document. If not present, will default to a random UUID. |
metadata | object Custom JSON to be included in the returned response. |
statusId | string WARNING: Deprecating in favor of 'fileId'. Custom ID for document. If not present, will default to a random UUID. |
outputURLHeaders | object Request headers to include in the PUT request to the output URL. |
webhook | string https?://(?:www\\.)?[a-zA-Z0-9./]+ Webhook URL to send status updates and JSON response to. |
webhookSendFull | boolean Default: false When set to |
forceBase64 | boolean Default: false Setting this parameter to true converts files to Base64 format before sending them on to the model. |
forceOCR | boolean Default: false Set this parameter to true if the input file is a fillable pdf. |
bigFile | boolean Default: false Set this parameter to true if resubmitting a Base64 or inputURL string that previously resulted in an error due to file size. |
Responses
Request samples
- Payload
{- "inputURL": "string",
- "base64": [
- "string"
], - "file": "string",
- "fileId": "file1.pdf",
- "metadata": { },
- "statusId": "string",
- "outputURL": "string",
- "outputURLHeaders": { },
- "webhook": "string",
- "webhookSendFull": false,
- "forceBase64": false,
- "forceOCR": false,
- "bigFile": false
}
Response samples
- 200
- 207
- 400
- 403
- 404
- 500
{- "status": "string",
- "statusId": "string",
- "id": "string"
}
Get status of an async request
Get the status of an async zip request.
path Parameters
document_id required | string (document_id) Document ID |
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 |
Responses
Response samples
- 200
- 400
- 403
- 404
{- "status": "string",
- "model": "string",
- "startTime": 0,
- "endTime": 0,
- "id": "string"
}
JSON response
Make a request to a custom Forms2 model 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
path Parameters
custom_model_id required | string (custom_model_id) Custom model ID |
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 |
Request Body schema: required
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. |
fileId | string Default: "UUID" Examples: "file1.pdf" Custom ID for document. If not present, will default to a random UUID. |
metadata | object Custom JSON to be included in the returned response. |
webhook | string https?://(?:www\\.)?[a-zA-Z0-9./]+ Webhook URL to send status updates and JSON response to. |
webhookSendFull | boolean Default: false When set to |
forceBase64 | boolean Default: false Setting this parameter to true converts files to Base64 format before sending them on to the model. |
forceOCR | boolean Default: false Set this parameter to true if the input file is a fillable pdf. |
webhookHeaders | object Request headers to include in the POST request to the webhook. |
Responses
Request samples
- Payload
{- "inputURL": "string",
- "fileId": "file1.pdf",
- "metadata": { },
- "webhook": "string",
- "webhookSendFull": false,
- "forceBase64": false,
- "forceOCR": false,
- "webhookHeaders": { }
}
Response samples
- 200
- 400
- 403
- 404
- 500
{- "documentId": "string",
- "id": "string",
- "pages": 0,
- "entitiesExtracted": [
- {
- "boundingRegions": [
- {
- "pageNumber": 0,
- "polygon": { }
}
], - "category": "string",
- "confidence": 0,
- "spans": [
- {
- "offset": 0,
- "length": 0
}
], - "subCategory": "string"
}
], - "isUrgent": false,
- "keyValuePairs": [
- {
- "confidence": 0,
- "key": {
- "boundingRegions": { },
- "content": "",
- "spans": { }
}, - "value": {
- "boundingRegions": { },
- "content": "",
- "spans": { }
}
}
], - "modelType": "string",
- "ocrResults": {
- "modelVersion": "string",
- "readResults": [
- {
- "pageNumber": 0,
- "angle": 0,
- "height": 0,
- "width": 0,
- "unit": "string",
- "words": [
- {
- "content": "string",
- "polygon": [
- 0
], - "confidence": 0,
- "span": {
- "offset": 0,
- "length": 0
}
}
], - "selectionMarks": [
- {
- "polygon": [
- 0
], - "confidence": 0,
- "span": {
- "offset": 0,
- "length": 0
}, - "state": "unselected"
}
], - "lines": [
- {
- "polygon": [
- 0
], - "content": "string",
- "spans": [
- {
- "offset": 0,
- "length": 0
}
]
}
], - "spans": [
- {
- "offset": 0,
- "length": 0
}
]
}
], - "readStyles": [
- {
- "confidence": 0,
- "isHandwritten": true,
- "spans": [
- {
- "offset": 0,
- "length": 0
}
]
}
], - "version": "string"
}, - "rawText": "string",
- "requestDateTime": "string",
- "status": "string",
- "tablesExtracted": [
- {
- "boundingRegions": [
- {
- "pageNumber": 0,
- "polygon": { }
}
], - "cells": [
- {
- "kind": "string",
- "rowIndex": 0,
- "columnIndex": 0,
- "columnSpan": 0,
- "content": "string",
- "boundingRegions": [
- {
- "pageNumber": 0,
- "polygon": { }
}
], - "spans": [
- {
- "offset": 0,
- "length": 0
}
]
}
], - "columnCount": 0,
- "rowCount": 0,
- "spans": [
- {
- "offset": 0,
- "length": 0
}
]
}
], - "metadata": { },
- "startTime": 0,
- "endTime": 0
}
Zip file response
Make a request to Forms model 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
The default name for the file is an epoch timestamp if fileId
field is not included in the request.
path Parameters
custom_model_id required | string (custom_model_id) Custom model ID |
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 |
Request Body schema: required
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. |
fileId | string Default: "UUID" Examples: "file1.pdf" Custom ID for document. If not present, will default to a random UUID. |
forceBase64 | boolean Default: false Setting this parameter to true converts files to Base64 format before sending them on to the model. |
forceOCR | boolean Default: false Set this parameter to true if the input file is a fillable pdf. |
metadata | object Custom JSON to be included in the returned response. |
webhook | string https?://(?:www\\.)?[a-zA-Z0-9./]+ Webhook URL to send status updates and JSON response to. |
webhookSendFull | boolean Default: false When set to |
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. |
statusId | string WARNING: Deprecating in favor of 'fileId'. Custom ID for document. If not present, will default to a random UUID. |
webhookHeaders | object Request headers to include in the POST request to the webhook. |
Responses
Request samples
- Payload
{- "inputURL": "string",
- "fileId": "file1.pdf",
- "forceBase64": false,
- "forceOCR": false,
- "metadata": { },
- "webhook": "string",
- "webhookSendFull": false,
- "outputURL": "string",
- "outputURLHeaders": { },
- "statusId": "string",
- "webhookHeaders": { }
}
Response samples
- 400
- 403
- 404
- 500
{- "status": "FAILURE",
- "message": "Request body is missing required field(s): question"
}