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/processRequest
Headers
| Parameter | Type | Description |
|---|---|---|
Authorizationrequired | string | Bearer token for authentication |
Content-Typerequired | string | Must be multipart/form-data |
Body Parameters
| Parameter | Type | Description |
|---|---|---|
filerequired | File | The document file to process (PDF, JPG, PNG) |
documentType | string | Type of document: invoice, receipt, contract, or general Default: general |
options | object | Processing 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
| Parameter | Type | Description |
|---|---|---|
documentId | string | Unique identifier for the processed document |
status | string | Processing status: processing, completed, or failed |
result | object | Extracted 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 supportedFILE_TOO_LARGE: File exceeds size limit (10MB)INSUFFICIENT_CREDITS: Not enough credits for processingRATE_LIMIT_EXCEEDED: Too many requests
⚠️
Rate Limits
Free tier: 10 requests/hour. Paid plans have higher limits.