Submit documents for AI-powered validation and structured data extraction. Supports invoices, Sri Lankan identity documents, and company registration forms.
List processing instances
Retrieve a list of document processing instances with optional filters. Use includeFileUrls=true to get signed URLs (expires in 5 minutes).
query Parameters
processorIdFilter by processor ID
statusFilter by processing status
limitMaximum number of results (default: 50)
offsetNumber of results to skip (default: 0)
includeFileUrlsInclude signed URLs for files (default: false). May impact performance for large lists.
List processing instances › Responses
List of processing instances
Initiate document processing
Submit documents for processing against one of the available processor templates.
Available processors:
processorId | Accepted formats | Description |
|---|---|---|
INVOICE | image/jpeg, image/png, application/pdf | Extracts and validates commercial invoices, tax invoices, proforma invoices, and credit notes |
SRI_LANKA_ID | image/jpeg, image/png, application/pdf | KYC validation and data extraction for Sri Lankan passports, driver's licenses, and NICs (old & new). Also enriches with voter registration data when NIC is present. |
SRI_LANKA_FORM1_COMPANY_REGISTRATION | application/pdf | Extracts company registration data from Sri Lankan Form 1 documents |
SRI_LANKA_FORM15_ANNUAL_RETURN | application/pdf | Extracts annual return data from Sri Lankan Form 15 documents |
The inputData field records what you already believe about the document's subject. It is stored on the instance and used to label it in dashboards; it is never shown to the AI, so it cannot influence what is extracted. Comparing those values against the document is a KYC-session feature (the session-level claims check), not part of standalone document processing.
Synchronous steps (e.g., image cropping) run immediately. Validation and extraction are queued as background jobs by default. You will be notified via webhooks when processing completes.
Initiate document processing › Request Body
processorIdID of the document processor to use.
Array of files to process (provide base64 data or URL for each file)
inputDataOptional key-value context about the document's subject, recorded against the instance and used to label it. It is never sent to the AI, so it cannot influence extraction; comparing these values against the document happens in a KYC session's claims check, not here. Keys a processor does not declare are recorded alongside the rest but have no effect.
SRI_LANKA_ID — supported keys:
name— Full name to match against the documentdateOfBirth— Expected date of birth (YYYY-MM-DD)idNumber— NIC or passport number to verifyaddress— Residential address to compare (warning-level check)
metadataOptional key-value metadata for syncing purposes (e.g., Bitnomi record IDs). Stored on the instance but not sent to the AI.
shouldCropImagesWhether to crop images before processing (default: true). When true, document images are cropped before validation and extraction.
backgroundProcessingWhether processing should happen in the background (default: true). If true, validation and extraction are performed asynchronously; if false, waits for all processing to complete before returning a response.
Initiate document processing › Responses
Processing initiated successfully
Get a specific pipeline stage result
Retrieve the full output of a single pipeline stage (e.g. crop_and_detect_faces, pre_validate_and_extract, post_validation). Returns the complete stage data including validation rules, extraction results, and schema.
path Parameters
idProcessing instance ID
stageIdStage ID (crop_and_detect_faces | pre_validate_and_extract | post_validation)
Get a specific pipeline stage result › Responses
Stage result
Stream instance progress (SSE)
Subscribe to real-time Server-Sent Events for a processing instance. Events are emitted as each pipeline stage starts, succeeds, or fails. The connection stays open until the client disconnects.
path Parameters
idProcessing instance ID
Stream instance progress (SSE) › Responses
SSE event stream

