Documents and Extractions
Documents
A document is any file you upload to Documind for processing. Supported formats include:- PDF files
- Microsoft Word documents (.docx)
- Images (JPEG, PNG, TIFF)
document_id that you use for all subsequent operations.
Extractions
An extraction is a single processing job that extracts structured data from a document using a specific schema. Each extraction:- Belongs to one document
- Uses one schema
- Can be in different states:
pending,processing,completed,failed - May require review depending on confidence scores
Schemas
A schema defines what data to extract from documents. Schemas use a JSON Schema-like format with a specialnamed_entities field for the data you want.
Basic Schema Structure
Field Types
Documind supports all standard JSON Schema types:- String
- Number
- Boolean
- Array
- Object
Required Fields
Mark critical fields asrequired to ensure they’re extracted and flagged for review if confidence is low:
Extraction Modes
Documind offers three extraction modes with different trade-offs:Basic Mode (2-6 credits/page)
Single-model extraction for simple documents:- Simple, well-formatted documents
- Cost is a priority
- Speed is important
- Review workflow not needed
- No confidence scores
- No automatic review flagging
- Single model may miss edge cases
VLM Mode (10 credits/page)
Vision Language Model-based extraction for image-heavy documents:- Scanned documents
- Images with text
- Poor quality PDFs
- Documents where layout is important
- Uses native image processing
- Better for visual documents
- No confidence scores
Advanced Mode (15 credits/page)
Multi-model ensemble with confidence scoring:- Complex documents
- High accuracy required
- Review workflow desired
- Structured forms and tables
- Multiple models consensus
- Confidence scores for every field
- Automatic review flagging
- Best accuracy
Confidence Scores
Advanced mode provides confidence scores for each extracted field, helping you understand extraction reliability.Score Calculation
Confidence scores (0-100) are calculated from:- Lexical similarity (40%): How consistent the text is across models
- Semantic similarity (60%): How similar the meaning is across models
Nested Scores
For arrays and objects, scores are nested to match the data structure:Review Workflow
When required fields have low confidence, extractions are automatically flagged for human review.Review Threshold
Thereview_threshold parameter (default: 80) determines when review is needed:
Review Flags
Theneeds_review_metadata contains flags matching your data structure:
Review States
An extraction goes through these states:Polling for Review
Poll the extractions endpoint to check review status:Credits System
Documind uses a credit-based pricing model:Credit Costs
| Extraction Mode | Cost per Page |
|---|---|
| Basic (Gemini 2.0 Flash) | 2 credits |
| Basic (GPT-4.1) | 4 credits |
| Basic (GPT-4o) | 6 credits |
| VLM | 10 credits |
| Advanced | 15 credits |
Credit Tracking
Monitor your credits via the API:Insufficient Credits
When you run out of credits, API calls return402 Payment Required:
Authentication
All API requests require authentication using API keys passed in theX-API-Key header:
API Key Scopes
API keys can have different permission scopes:read:extractions- Read extraction resultswrite:extractions- Create and update extractionsread:api_keys- List API keyswrite:api_keys- Create and manage API keysread:usage- View usage and creditsadmin- Full access (admin only)
Organization Keys
API keys can be user-specific or organization-wide, allowing team members to share access.Error Handling
Documind uses standard HTTP status codes:| Code | Meaning | Action |
|---|---|---|
| 200 | Success | Process the response |
| 400 | Bad Request | Check your request parameters |
| 401 | Unauthorized | Verify your API key |
| 402 | Payment Required | Add credits or upgrade plan |
| 403 | Forbidden | Check API key permissions |
| 404 | Not Found | Verify document/extraction ID |
| 500 | Server Error | Retry or contact support |