Skip to main content

What is Documind API?

Documind provides a powerful document extraction API designed for automation developers and integration engineers. Upload documents, define extraction schemas, and receive structured JSON data with confidence scores and automatic review flagging.

Key Capabilities

Multi-Model Extraction

Choose between Basic, VLM-based, or Advanced (multi-model ensemble) extraction modes with different accuracy and speed trade-offs.

Schema Flexibility

Use predefined schemas, generate from samples, or create custom schemas for any document type.

Review Workflow

Automatic flagging of low-confidence fields enables human-in-the-loop validation for critical data.

Credit-Based Usage

Transparent per-page pricing with different credit costs for Basic (2-6), VLM (10), and Advanced (15) extraction.

How It Works

1

Upload Documents

Submit PDF, Word, or image files via the /upload endpoint. Returns document IDs for processing.
2

Define Schema

Specify what data to extract using JSON Schema format. Generate schemas automatically or use predefined templates.
3

Extract Data

Process documents with /extract/{document_id}. Choose extraction mode and review threshold.
4

Handle Reviews

Poll /data/extractions to detect when is_reviewed=true for documents that needed review. Use corrected data in your automation.

Extraction Modes

Single-model extraction with your choice of:
  • GPT-4o (6 credits) - Most accurate
  • GPT-4.1 (4 credits) - Balanced
  • Gemini 2.0 Flash (2 credits) - Fastest
Best for simple documents where extensive validation isn’t required.
Uses native visual data to process content through multiple Vision-Language Models.Best for low-text, high-visual content like scanned documents, images, or forms where layout is crucial.
Multi-model ensemble extraction utilizing document layout, reading order, and OCR’d text.Includes confidence scores and automatic review flagging. Best for structured documents like invoices, forms, and tables requiring high accuracy. Activated by not setting model or extraction_mode parameters.

Use Cases

Common Use Cases

  • Invoice Processing: Extract line items, totals, vendor details
  • Form Data Entry: Digitize paper forms into structured data
  • Document Classification: Identify document types and route accordingly
  • Compliance Checks: Extract specific fields for validation

Integration Examples

# Typical automation workflow
import requests

API_KEY = "your_api_key"
headers = {"X-API-Key": API_KEY}

# 1. Upload documents
files = [("files", open("invoice1.pdf", "rb")), ("files", open("invoice2.pdf", "rb"))]
response = requests.post("https://api.documind.com/api/v1/upload", headers=headers, files=files)
doc_ids = response.json()

# 2. Extract with schema
for doc_id in doc_ids:
    response = requests.post(
        f"https://api.documind.com/api/v1/extract/{doc_id}",
        headers=headers,
        json={"schema": invoice_schema, "review_threshold": 85}
    )
    result = response.json()
    
    # 3. Check if needs review
    if result['needs_review']:
        # Direct team to UI for review, then poll for completion
        print(f"⚠️ Review needed - direct team to: https://app.documind.com/review")
        
        # Poll until reviewed
        while True:
            ext_response = requests.get(
                "https://api.documind.com/api/v1/data/extractions",
                headers=headers,
                params={"document_id": doc_id, "limit": 1}
            )
            extraction = ext_response.json()["items"][0]
            if extraction["is_reviewed"]:
                process_invoice(extraction["reviewed_results"])
                break
            time.sleep(10)
    else:
        process_invoice(result['results'])

Authentication

All API requests require authentication using API keys passed in the X-API-Key header:
X-API-Key: YOUR_API_KEY
Never commit API keys to version control. Use environment variables or secure credential storage.

Rate Limits & Credits

  • API Calls: Track usage via /usage/current endpoint
  • Credits: Deducted per page/image processed
  • Daily Refresh: Credits refresh based on your subscription tier
  • Insufficient Credits: Returns 402 Payment Required status
Check your current credits:
curl https://api.documind.com/api/v1/usage/credits \
  -H 'X-API-Key: YOUR_API_KEY'

Next Steps