Document Information Extraction

Extract structured information from documents by uploading a base64-encoded file or providing a public URL.

Endpoint

  • Method: POST

  • Path: /document/extract

  • Content-Type: application/json

  • Authorization: your API key (required)

  • Idempotency-Key: string (optional; recommended for safe retries)

Request

  • document_type: one of organisation_doc, identity, proof_of_address

  • source: one of: base64 with payload (base64 string), url with url (publicly reachable URL)

Example (base64):

{

  "document_type": "identity",

  "source": "base64",

  "payload": "BASE64_DATA_HERE"

}

Example (public URL):

{

  "document_type": "organisation_doc",

  "source": "url",

  "url": "https://example.com/document.pdf"

}

Notes:

  • Only application/json is accepted.

  • Supported file types: PDF, JPEG, PNG.

Errors

All InfraRed error responses have this shape:

{

  "error": {

    "code": "string",

    "message": "string",

    "field": "string (optional)",

    "livemode": false

  }

}

The possible errors returned by this endpoint:

Code

Description

document_not_of_type

Document type does not match expected type.

document_base64_payload_invalid

Base64 document payload is invalid. Includes field.

document_url_unreachable

Public URL of document is unreachable. Includes field.

document_content_type_not_supported

Unsupported document content type (only PDF, JPEG, PNG).

document_too_large

Document size exceeds maximum (20 MB).