Classify a document
POST/api/v8/partner/classify
Veryfi's Classify a document endpoint allows you to classify a document. The following document types are supported: .ofd, .heif, .odt, .rtf, .csv, .gif, .htm, .png, .xlsx, .webp, .docx, .eml, .html, .doc, .pdf, .xls, .jpg, .jpeg, .avif, .bmp, .txt, .zip, .heic. The max file size is 20mb, min file size is 0.25kb. Rate limit is 60 requests per second.
Request
- application/json
- multipart/form-data
Body
- Array [
- MOD1
- MOD2
- ]
Possible values: non-empty
A custom identification value. Use this if you would like to assign your own ID to documents. This parameter is useful when mapping this document to a service or resource outside Veryfi.
Possible values: non-empty
A path to a file in an S3 bucket, e.g. 'some/receipt.jpg
Possible values: non-empty
An S3 bucket for 'package_path', e.g. 'documents'.
Possible values: non-empty
Used to upload a document via base64 encoded string, could be raw or data URI scheme. This is the least effective way to upload a document for processing. See file_urls or uploading zip files.
Possible values: non-empty
A URL to a publicly accessible document to be sent to Veryfi for processing.
Possible values: non-empty
An array of URLs to publicly accessible documents to be sent to Veryfi for processing.
Possible values: non-empty
An optional filename. Useful to determine file type.
document_types object[]
Possible values: >= 1
The types to classify the document into. If omitted, a preset set of types will be used.
string
string
Body
- Array [
- MOD1
- MOD2
- ]
Possible values: non-empty
A custom identification value. Use this if you would like to assign your own ID to documents. This parameter is useful when mapping this document to a service or resource outside Veryfi.
Possible values: non-empty
A path to a file in an S3 bucket, e.g. 'some/receipt.jpg
Possible values: non-empty
An S3 bucket for 'package_path', e.g. 'documents'.
Possible values: non-empty
Used to upload a document via base64 encoded string, could be raw or data URI scheme. This is the least effective way to upload a document for processing. See file_urls or uploading zip files.
Possible values: non-empty
A URL to a publicly accessible document to be sent to Veryfi for processing.
Possible values: non-empty
An array of URLs to publicly accessible documents to be sent to Veryfi for processing.
Possible values: non-empty
An optional filename. Useful to determine file type.
A binary file. Submitting zipped documents through this parameter is the fastest way to process any document. Not every supported extension is enabled by default; see the Process a Document endpoint description for default vs by-request file types.
document_types object[]
Possible values: >= 1
The types to classify the document into. If omitted, a preset set of types will be used.
string
string
Responses
- 200
- 400
- 403
- 404
- 413
- 429
- 499
- 500
- 503
- 504
- default
Returns the document type prediction result. When the model cannot determine a type, document_type.value is null and the HTTP status remains 200. A 400 with Failed to predict document type indicates the classification service failed, not that the model was uncertain.
- application/json
- Schema
- Example (from schema)
Schema
- DocumentType
- CustomDocumentType
Possible values: > 0
The unique identifier of the classification.
document_type object required
The type of the document. If a list of custom types is provided, CustomDocumentType will be the model for this field.
Possible values: <= 1
The score shows how confident the model is that the predicted value belongs to the field. See confidence scores explained for more information.
Possible values: [other, receipt, invoice, purchase_order, w9, statement, check, contract, w8, remittance_advice, business_card, bank_statement, w2, packing_slip, credit_note]
The type of the document.
Possible values: <= 1
The score shows how confident the model is that the predicted value belongs to the field. See confidence scores explained for more information.
Possible values: non-empty
The custom type of the document.
{
"id": 0,
"document_type": {}
}
User error
- application/json
- Schema
- Example (from schema)
Schema
- FAILED_TO_PREDICT_DOCUMENT_TYPE
- FAILED_TO_PARSE_PACKAGE
- MALFORMED_PARAMETERS
- COULDNT_DOWNLOAD_FILE_FROM_PROVIDED_URL
- RECEIVED_EMPTY_OR_MISSING_DATA
- NO_FILES_TO_PROCESS
- FILE_IS_CORRUPTED
- THE_FILE_IS_TOO_BIG
- IMAGE_DIMENSIONS_ARE_TOO_SMALL
- FILE_IS_ENCRYPTED
- UNABLE_TO_UNZIP_FILE
- THE_FILE_IS_TOO_SMALL
- FAILED_TO_IDENTIFY_MIMETYPE_OF_THIS_FILE
- UNSUPPORTED_OR_UNREADABLE_FILE_MIMETYPE
- FILE_IS_MISSING_OR_CORRUPTED
- FILE_IS_EMPTY
- COULDNT_DETERMINE_FILE_TYPE_OR_SIZE
- COULDNT_DETECT_FILE_TYPE
Default value: fail
Default value: Failed to predict document type
Default value: fail
Default value: Failed to parse package
Default value: fail
Default value: Malformed parameters
Default value: [object Object]
Default value: fail
Default value: Couldn't download file from provided url.
Default value: [object Object]
Default value: fail
Default value: Received empty or missing data
Default value: fail
Default value: No files to process
Default value: fail
Default value: File is corrupted
Default value: fail
Default value: The file is too big
Default value: fail
Default value: Image dimensions are too small
Default value: [object Object]
Default value: fail
Default value: File is encrypted
Default value: fail
Default value: Unable to unzip file
Default value: fail
Default value: The file is too small
Default value: fail
Default value: Failed to identify MimeType of this file.
Default value: fail
Default value: Unsupported or unreadable file MimeType
Default value: fail
Default value: File is missing or corrupted.
Default value: fail
Default value: File is empty
Default value: fail
Default value: Couldn't determine file type or size.
Default value: fail
Default value: Couldn't detect file type
{}
User error
- application/json
- Schema
- Example (from schema)
Schema
- AUTHENTICATION_CREDENTIALS_WERE_NOT_PROVIDED
- THIS_API_KEY_IS_NOT_PERMITTED_TO_ACCESS_THIS_ROUTE
Default value: fail
Default value: Authentication credentials were not provided.
Default value: fail
Default value: This API key is not permitted to access this route
{}
Not found
- application/json
- Schema
- Example (from schema)
Schema
- NOT_FOUND
- DOCUMENT_NOT_FOUND
Default value: fail
Default value: Not found.
Default value: fail
Default value: Document Not Found
{}
Request body too large
- application/json
- Schema
- Example (from schema)
Schema
- REQUEST_BODY_TOO_LARGE
Default value: fail
Default value: Request body too large
{}
Rate limit
- application/json
- Schema
- Example (from schema)
Schema
- YOU_HAVE_BEEN_RATE_LIMITED
Default value: fail
Default value: You have been rate limited
Default value: [object Object]
{}
User error
- application/json
- Schema
- Example (from schema)
Schema
- CLIENT_CLOSED_REQUEST_OR_LOST_CONNECTION
Default value: fail
Default value: Client closed request or lost connection
{}
Unexpected error
Service is temporarily unavailable
- application/json
- Schema
- Example (from schema)
Schema
- SERVICE_IS_TEMPORARILY_UNAVAILABLE_PLEASE_TRY_AGAIN_LATER
Default value: fail
Default value: Service is temporarily unavailable. Please try again later
{}
Gateway timeout. Returned if request takes more than 120 seconds. The request might finish successfully later.
- application/json
- Schema
- Example (from schema)
Schema
- GATEWAY_TIMEOUT
Default value: fail
Default value: Gateway timeout
{}
General error response
- application/json
- Schema
- Example (from schema)
Schema
Default value: fail
{
"status": "fail",
"error": "string"
}