Skip to main content

Complete Extraction Workflow

Understanding the full extraction lifecycle helps you build robust automation pipelines. Here’s how documents flow through the system:

Phase 1: Document Upload

1

Upload Files

Submit documents via POST /upload. You may send multiple files form fields in one request.
Credit Impact: No credits charged for upload
Storage: No public retention SLA is exposed by the backend
2

Receive Document IDs

Store the returned UUIDs for extraction requests.

Phase 2: Schema Definition

Choose one of three approaches:
Use the Documind UI to access built-in templates for common document types like invoices, receipts, forms, etc.Navigate to: Dashboard → Schemas → Templates
✓ Fastest setup
✓ Proven accuracy
✗ Not available via API (use UI or define custom schema)

Phase 3: Data Extraction

Configure extraction mode based on requirements:

Mode Selection Decision Tree

Basic Extraction Example

Advanced Extraction Example

Credit Usage: Credits deducted per page × model cost

Phase 4: Review Workflow

Only triggered when needs_review = true:
1

Identify Flagged Fields

Parse the metadata to find low-confidence fields:
2

Notify Review Team

Human review happens in the Documind UI. Direct your review team to:Dashboard → Review QueueThey can see all pending reviews, view extraction confidence scores, and correct/approve results.
Optionally, send notifications via your own system:
3

Poll for Completion

Implement polling to detect when is_reviewed = true:
See Polling Pattern for details.
4

Use Reviewed Results

Once is_reviewed = true, use reviewed_results instead of results:

Phase 5: Data Processing

Process the final data in your automation:

Complete Example

Here’s a full workflow implementation with real API calls:

Troubleshooting

Problem: 500 Internal Server Error on uploadSolutions:
  • Verify file is not corrupted
  • Retry with a smaller request if infrastructure rejects the upload size
  • Ensure file format is supported
  • Retry with exponential backoff
Problem: Extraction takes too long or times outSolutions:
  • Switch to Basic mode for faster processing
  • Reduce document page count
  • Simplify schema (fewer fields)
  • Contact support if issue persists
Problem: Review threshold too strictSolutions:
  • Lower review_threshold from 85 to 75
  • Mark fewer fields as required
  • Improve schema descriptions
  • Use Basic mode if reviews aren’t needed
Problem: Polling times out waiting for reviewSolutions:
  • Increase timeout to match your review SLA
  • Implement email notifications to reviewers
  • Check review queue isn’t backlogged
  • Consider async processing instead of blocking

Next Steps

Upload Documents

Detailed upload endpoint documentation

Extract Data

Complete extraction API reference

Polling Pattern

Robust polling implementation guide

Automation Patterns

Production-ready automation examples