API ReferenceConversion

Start asynchronous document conversion using OCR

POST
/api/convert-async

Process documents asynchronously and extract structured data using AI-powered OCR.

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 processing (returns conversion_id)
  2. Poll /api/convert-async/status/{id} for completion
  3. Retrieve extracted data when status is SUCCESS

Authorization

ApiKeyAuth
AuthorizationBearer <token>

Bearer token for API authentication

In: header

image*string

Image file to process (see supported formats)

document_type_code*string

Document type code

document_metadata?object

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

curl -X POST "https://app.docutray.com/api/convert-async" \  -H "Content-Type: application/json" \  -d '{    "image_base64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAA==",    "document_type_code": "invoice"  }'
{
  "conversion_id": "cm5vm9hx30001m5cgh0p9v8qa",
  "status_url": "https://api.docutray.com/api/convert-async/status/cm5vm9hx30001m5cgh0p9v8qa",
  "status": "ENQUEUED"
}
{
  "message": "Validation error",
  "errors": [
    "string"
  ]
}
{
  "error": "Invalid API key"
}
{
  "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 start conversion"
}