🖥 Data Extraction — API Endpoints
The complete reference for the Data Extraction API. All endpoints are prefixed with:
https://api.docparse.inAll requests require the Authorization: Bearer <key> header (see
Authentication).
POST Create an Extraction
Create a new extraction and upload files for processing in a single request.
POST /api/v1/createExtraction
Content-Type: multipart/form-dataForm fields
| Field | Type | Required | Notes |
|---|---|---|---|
extractionDetails | string (JSON) | yes | JSON-encoded extraction configuration. |
files | File[] | yes | One or more files (PDF, PNG, JPG, DOCX, etc.). |
extractionDetails JSON
{
"name": "Invoice Extraction",
"description": "Extract key data from invoices",
"language": "English",
"options": { "hasTable": true },
"fields": [
{ "key": "invoice_number", "description": "The invoice ID", "example": "INV-001" },
{ "key": "total_amount", "description": "Total amount due", "example": "1250.00" }
]
}Response — 201 Created
{
"extractionId": "550e8400-e29b-41d4-a716-446655440000",
"batchId": "batch-uuid",
"files": [
{ "id": "file-uuid-1", "file_name": "invoice.pdf", "status": "queued" }
]
}POST View an Extraction
Retrieve the full details of an existing extraction, including its field schema and options.
POST /api/v1/viewExtraction
Content-Type: application/jsonBody
{ "extractionId": "550e8400-e29b-41d4-a716-446655440000" }Response — 200 OK
{
"extractionId": "550e8400-e29b-41d4-a716-446655440000",
"name": "Invoice Extraction",
"description": "Extract key data from invoices",
"language": "English",
"options": { "hasTable": true },
"fields": [
{ "key": "invoice_number", "description": "The invoice ID", "example": "INV-001" },
{ "key": "total_amount", "description": "Total amount due", "example": "1250.00" }
],
"created_at": "2026-05-24T10:00:00Z",
"updated_at": "2026-05-24T10:00:00Z"
}PATCH Update an Extraction
Update an existing extraction's configuration and optionally upload new files in the same request.
PATCH /api/v1/updateExtraction
Content-Type: multipart/form-dataForm fields
| Field | Type | Required | Notes |
|---|---|---|---|
extractionId | string | yes | The extraction UUID to update. |
extractionDetails | string (JSON) | yes | JSON-encoded fields to update. |
files | File[] | no | Optional new files to upload. |
extractionDetails JSON (partial update)
{
"name": "Updated Invoice Extraction",
"fields": [
{ "key": "invoice_number", "description": "The invoice ID", "example": "INV-002" }
]
}DELETE Delete an Extraction
Permanently delete an extraction and all associated batches, files, and extracted data.
DELETE /api/v1/deleteExtraction
Content-Type: application/jsonBody
{ "extractionId": "550e8400-e29b-41d4-a716-446655440000" }Response — 200 OK
This action is irreversible. All batches, files, and results linked to the extraction are permanently removed.
POST Upload Files
Upload additional documents to an existing extraction. A new batch is
created automatically and the batchId is returned.
POST /api/v1/uploadFiles
Content-Type: multipart/form-dataForm fields
| Field | Type | Required | Notes |
|---|---|---|---|
extractionId | string | yes | The extraction UUID. |
files | File[] | yes | One or more files (PDF, PNG, JPG, DOCX, etc.). |
Response — 200 OK
{
"batchId": "batch-uuid",
"extractionId": "550e8400-e29b-41d4-a716-446655440000",
"files": [
{ "id": "file-uuid-1", "file_name": "document1.pdf", "status": "queued" },
{ "id": "file-uuid-2", "file_name": "document2.png", "status": "queued" }
]
}POST Get Batch Results
Retrieve extraction results for a batch. Add fileId to filter down
to a single file.
POST /api/v1/getBatchResults
Content-Type: application/jsonBody
| Field | Type | Required | Notes |
|---|---|---|---|
extractionId | string | yes | The extraction UUID. |
batchId | string | yes | The batch UUID. |
fileId | string | no | Filter results to a single file. |
{
"extractionId": "550e8400-e29b-41d4-a716-446655440000",
"batchId": "batch-uuid"
}Response — 200 OK
{
"batchId": "batch-uuid",
"extractionId": "550e8400-e29b-41d4-a716-446655440000",
"files": [
{
"id": "file-uuid-1",
"file_name": "invoice1.pdf",
"status": "processed",
"result": {
"extracted_data": {
"invoice_number": "INV-2026-001",
"total_amount": "1250.00"
},
"model_used": "gemini-2.5-flash"
}
}
]
}Possible status values: queued, processing, processed,
needs_review, confirmed, failed.
Error responses
All errors are JSON with an error field:
{ "error": "File too large (25 MB limit)." }| Status | Meaning |
|---|---|
| 400 | Bad request — check the body or form fields. |
| 401 | Missing or invalid API key. |
| 403 | Key revoked or out of pages. |
| 404 | Extraction / batch / file not found. |
| 413 | File too large. |
| 429 | Rate-limited; back off and retry. |
| 5xx | Our problem; we retry on your behalf if you use webhooks. |