Skip to main content
Use review_decision_managed to select the workflow. False or absent preserves your existing legacy endpoints, booleans, and review behavior. True uses explicit review states, terminal cancellation, and read-only decisions. For managed documents, missing or unknown state stops processing. See the state dispatcher.

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

Copy poll_for_review from Polling for Reviews into a local review_polling.py module in your integration. Copy the imports and function definition only; keep the module-level usage demonstration in your caller. This is customer code, not an installed SDK. Synchronous extraction responses do not include technical status; the helper reads stored state.

Phase 5: Data Processing

Process the final data in your automation:

Complete Example

Complete upload, schema definition, and extraction as shown above. Then use the tested helper in Phase 4. Keep cancellation, legacy policy, and timeout separate from successful data processing. For batch and concurrent work, see Automation Pipeline.

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