InfraRed Extract

Validate the document type, extract structured data, and run validations in one request.

Extract turns raw documents into structured, reliable data. Submit a document and get back clean, validated JSON that is ready to feed into your workflow.

Supported document types include identity documents, organisation documents, proof of address documents, tax documents, invoices, and telegraphic transfer forms.

Accepted file formats and size limits

The Extract endpoint accepts HTTP request bodies up to 5 MB. This limit includes the JSON body and base64 encoding overhead. If a base64-encoded document would make the request exceed 5 MB, submit it through a public URL instead.

Documents submitted through a public URL are subject to these file size limits:

  • PDF files up to 50 MB
  • JPEG, JPG, PNG, and WebP images up to 20 MB

Every request moves through three steps.

Step 1: Document classification

Verify that the document submitted matches the type your workflow requires before any data is extracted.

Step 2: Extraction

Pull structured data from the document. The fields returned depend on the document type.

Step 3: Intelligent validation

Check extracted values against your requirements, including field values, expiry dates, and document recency.

How it works

When you call the Extract API, all three steps run automatically in a single request.

Classify: the API checks whether the document matches the document type you specified. If it does not, the request fails immediately with a clear error before any processing occurs.

Extract: the API reads the document and returns structured fields in JSON.

Validate: if you included validation rules in your request, the API checks the extracted values against them and returns the results alongside the extracted data.

You do not need to make separate calls for each step. One request handles all three.

Document warnings

Some documents contain markings that indicate they are samples, previews, or no longer active. If the document still matches the requested type, InfraRed extracts and validates it normally and includes a document_warnings object in the response.

Document markingResponse flag
SAMPLE or SPECIMENsample_or_preview
VOID or CANCELLEDvoided

For example, a document containing both kinds of marking can return:

{
  "document_type": "invoice",
  "document_warnings": {
    "sample_or_preview": true,
    "voided": true
  },
  "invoice_number": "INV-000001"
}

Only detected warnings are included. If no warnings apply, the document_warnings object is omitted. Warnings are informational and do not cause an otherwise valid document to fail classification; use them to decide whether your workflow should accept, review, or reject the extracted document.

API reference

Need exact request and response details? Use the API section in the navigation.

Supported document types