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 provides verification context to the AI — values are matched against extracted document fields. For example, passing name and dateOfBirth for an ID document tells the processor to flag a mismatch if the document doesn't match.
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 passed to the AI for cross-checking extracted document fields against known values.
INVOICE — supported keys:
expectedVendor— supplier name to verify against the documentexpectedAmount— total amount to verify against the document
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)
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

