2 min read

Process Document

Upload and process a document with DocuRift API

Upload and process a document to extract structured data.

POST/v1/documents/process

Request

Headers

ParameterTypeDescription
Authorizationrequired
stringBearer token for authentication
Content-Typerequired
stringMust be multipart/form-data

Body Parameters

ParameterTypeDescription
filerequired
FileThe document file to process (PDF, JPG, PNG)
documentType
stringType of document: invoice, receipt, contract, or general
Default: general
options
objectProcessing options (OCR settings, output format, etc.)

Example Request

curl
curl -X POST https://api.docurift.com/v1/documents/process \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@document.pdf" \
-F "documentType=invoice"

Response

response.json
{
"success": true,
"data": {
  "documentId": "doc_1234567890",
  "status": "processing",
  "result": null
}
}

Response Fields

ParameterTypeDescription
documentId
stringUnique identifier for the processed document
status
stringProcessing status: processing, completed, or failed
result
objectExtracted data (available when status is completed)
💡

Async Processing

Document processing is asynchronous. Use the documentId to poll the status or configure a webhook to receive notifications.

Error Responses

error.json
{
"success": false,
"error": {
  "code": "INVALID_FILE_TYPE",
  "message": "File type not supported"
}
}

Common Error Codes

  • INVALID_FILE_TYPE: File format not supported
  • FILE_TOO_LARGE: File exceeds size limit (10MB)
  • INSUFFICIENT_CREDITS: Not enough credits for processing
  • RATE_LIMIT_EXCEEDED: Too many requests
⚠️

Rate Limits

Free tier: 10 requests/hour. Paid plans have higher limits.