Developer API
Welcome to the DocuExtract API. Our RESTful API allows you to programmatically upload documents, extract structured data using AI, and manage your extraction jobs at scale.
https://pdfextractor.codebotics.io/apiAuthentication
Authentication is performed via the Authorization header using a Bearer token.
Authorization: Bearer eyJhbG...
x-org-slug: acme-incExtraction API
The core endpoint for processing documents. You can either upload a local PDF/image file as multipart form-data.
Form Data Parameters
| Parameter | Type | Description |
|---|---|---|
| file | file | The PDF or Image file to process. |
| documentType | enum | INVOICE, BANK_STATEMENT, ACCOUNT_LEDGER, etc. |
| schemaId | uuid | Existing Template ID to use for extraction. |
| useVision | boolean | Enable high-fidelity vision processing for complex scans. (Recommended) |
Request Example
curl -X POST https://pdfextractor.codebotics.io/api/jobs \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "x-org-slug: your-org" \
-F "file=@invoice.pdf" \
-F "documentType=INVOICE"Conversion API
Specialized endpoint for converting PDF documents into high-resolution images without full AI extraction. Set documentType=CONVERSION.
{
"success": true,
"data": {
"jobId": "job_123...",
"status": "QUEUED"
}
}Jobs & Results
Track the status of your extractions and fetch the final structured data.
Using Templates
Custom templates (Schemas) allow you to define exactly which fields the AI should look for. This is ideal for specific forms like specialized bank statements or custom business invoices.
1. Create Template
Navigate to the **Templates** tab in your dashboard and define your JSON structure.
2. Copy Schema ID
Grab the UUID of your template (e.g., b3a1...).
# Add this field to your multipart request
-F "schemaId=b3a123-..."
-F "isDynamic=false"Webhooks
Automate your workflow by receiving a POST callback whenever an extraction job is completed. This eliminates polling and speeds up your automation pipeline (Zapier/Make).
How to use
Add these two parameters to your /jobs request:
destination=WEBHOOKwebhookUrl=https://your-server.com/callback
{
"jobId": "cmnqc...",
"status": "COMPLETED",
"data": {
"fields": [...],
"tables": [...]
}
}Error Codes s
| Code | Message | Solution |
|---|---|---|
| 401 | Unauthorized | API key is missing, invalid, or revoked. |
| 403 | Forbidden | Your plan does not include API access. Upgrade required. |
| 402 | Payment Required | Insufficient credit balance. Top up your wallet. |
| 429 | Too Many Requests | You have exceeded your plan's rate limits. |