DocParse Docs

🖥 Data Extraction — API Endpoints

The complete reference for the Data Extraction API. All endpoints are prefixed with:

plaintext
https://api.docparse.in

All 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.

plaintext
POST /api/v1/createExtraction
Content-Type: multipart/form-data

Form fields

FieldTypeRequiredNotes
extractionDetailsstring (JSON)yesJSON-encoded extraction configuration.
filesFile[]yesOne or more files (PDF, PNG, JPG, DOCX, etc.).

extractionDetails JSON

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

json
{
  "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.

plaintext
POST /api/v1/viewExtraction
Content-Type: application/json

Body

json
{ "extractionId": "550e8400-e29b-41d4-a716-446655440000" }

Response — 200 OK

json
{
  "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.

plaintext
PATCH /api/v1/updateExtraction
Content-Type: multipart/form-data

Form fields

FieldTypeRequiredNotes
extractionIdstringyesThe extraction UUID to update.
extractionDetailsstring (JSON)yesJSON-encoded fields to update.
filesFile[]noOptional new files to upload.

extractionDetails JSON (partial update)

json
{
  "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.

plaintext
DELETE /api/v1/deleteExtraction
Content-Type: application/json

Body

json
{ "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.

plaintext
POST /api/v1/uploadFiles
Content-Type: multipart/form-data

Form fields

FieldTypeRequiredNotes
extractionIdstringyesThe extraction UUID.
filesFile[]yesOne or more files (PDF, PNG, JPG, DOCX, etc.).

Response — 200 OK

json
{
  "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.

plaintext
POST /api/v1/getBatchResults
Content-Type: application/json

Body

FieldTypeRequiredNotes
extractionIdstringyesThe extraction UUID.
batchIdstringyesThe batch UUID.
fileIdstringnoFilter results to a single file.
json
{
  "extractionId": "550e8400-e29b-41d4-a716-446655440000",
  "batchId": "batch-uuid"
}

Response — 200 OK

json
{
  "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:

json
{ "error": "File too large (25 MB limit)." }
StatusMeaning
400Bad request — check the body or form fields.
401Missing or invalid API key.
403Key revoked or out of pages.
404Extraction / batch / file not found.
413File too large.
429Rate-limited; back off and retry.
5xxOur problem; we retry on your behalf if you use webhooks.