Identify document type from an image
Automatically identify the document type from a provided list of options.
Supported file formats:
- image/jpeg (JPEG)
- image/png (PNG)
- image/gif (GIF)
- image/bmp (BMP)
- image/webp (WebP)
- application/pdf (PDF)
Size limits:
- Maximum file size: 100MB
- URL download timeout: 30 seconds
Request methods:
- multipart/form-data: Direct file upload
- application/json with base64: Base64-encoded image
- application/json with URL: Image URL for automatic download
Authorization
ApiKeyAuth Bearer token for API authentication
In: header
Image file to identify (see supported formats)
JSON array of document type codes to consider (e.g., '["INVOICE", "RECEIPT"]')
Additional document metadata as JSON string (optional)
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://app.docutray.com/api/identify" \ -H "Content-Type: application/json" \ -d '{ "image_base64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAA==", "document_type_code_options": [ "invoice", "receipt" ] }'{
"document_type": {
"code": "invoice",
"name": "Invoice",
"confidence": 0.95
},
"alternatives": [
{
"code": "invoice",
"name": "Invoice",
"confidence": 0.95
},
{
"code": "receipt",
"name": "Receipt",
"confidence": 0.05
}
]
}{
"message": "Validation error",
"errors": [
"string"
]
}{
"error": "Invalid API key"
}{
"message": "You do not have permission to use the following document types: invoice, receipt"
}{
"message": "Error accessing URL: 404 Not Found"
}{
"message": "URL download timeout (30000ms)"
}{
"message": "File exceeds maximum allowed size (100MB)"
}{
"message": "Unsupported Content-Type. Use multipart/form-data or application/json."
}{
"error": "Rate limit exceeded",
"limitType": "minute",
"limit": 0,
"remaining": 0,
"resetTime": 0,
"retryAfter": 0
}{
"message": "Internal server error: Failed to process image"
}Check asynchronous identification status GET
Check the status and result of an identification started asynchronously
Start asynchronous document type identification POST
Identify the document type asynchronously from a provided list of options. **Supported file formats:** - image/jpeg (JPEG) - image/png (PNG) - image/gif (GIF) - image/bmp (BMP) - image/webp (WebP) - application/pdf (PDF) **Size limits:** - Maximum file size: 100MB - URL download timeout: 30 seconds **Request methods:** 1. **multipart/form-data**: Direct file upload 2. **application/json with base64**: Base64-encoded image 3. **application/json with URL**: Image URL for automatic download **Async workflow:** 1. Submit document for identification (returns identification_id) 2. Poll `/api/identify-async/status/{id}` for completion 3. Retrieve identified document type when status is SUCCESS