Skip to main content

Prerequisites

Before you begin, ensure you have:
  • A Documind account with available credits
  • An API key (see Authentication)
  • A document to process (PDF, JPG, JPEG, PNG, TIFF, or BMP)

Complete Example

This guide walks through a complete extraction workflow: upload -> extract -> handle results.
1

Upload Document

Upload your document and receive a document ID.
Response:
2

Define Extraction Schema

Create or generate a JSON schema defining what data to extract.
Invoice Schema
Mark critical fields as required to enable automatic review flagging if confidence is low.
3

Extract Data

Process the document with your schema.
Response:
4

Handle Review Workflow

If needs_review is true, implement polling to wait for human review.
Your automation now handles both immediate results and reviewed data seamlessly!

Extraction Mode Comparison

Choose the right mode for your use case:
Best for: Simple documents, high-volume processing
Request
  • Fastest processing
  • Single model
  • No confidence scores
  • No automatic review flagging

Common Patterns

Batch Processing

Submit multiple uploaded documents as one asynchronous batch, then poll for aggregate status:
Python

Error Handling

Handle common error scenarios:
Python

Check Credits Before Processing

Avoid failures by checking credits first:
Python

Testing Your Integration

Use these test scenarios:
  1. Simple Document: Single-page invoice with clear text
  2. Complex Layout: Multi-column form or table
  3. Poor Quality: Scanned or low-resolution image
  4. Edge Cases: Missing fields, unusual formats
Start with Basic extraction for testing, then upgrade to Advanced for production.

Next Steps

Extraction Flow

Deep dive into the complete extraction workflow

Review Polling

Advanced patterns for handling reviews in automation

Data Endpoints

Query and filter extraction results

Error Handling

Robust error handling strategies