Skip to main content
Matcher can extract transaction candidates from documents and propose field mappings using AI, but AI output is never authoritative. Nothing reaches reconciliation until a human approves it. This guide covers the human-in-the-loop (HITL) extraction-review queue, AI mapping proposals, and the related job actions.
When Lerian enables document extraction for your environment, you can enqueue documents. When the feature is not available in your environment, the operation answers 503. That answer comes before any storage or egress of document bytes.

Enqueue a document for extraction


Upload a source document (PDF) to run deterministic + AI extraction. Matcher sends a capped slice of the document’s text layer to the language-model provider Lerian configures for your environment. When the PDF has no text layer, Matcher sends the PDF itself. The resulting transaction candidates go into a review queue. Nothing reaches reconciliation yet.
The response (202 Accepted) returns the queued review id, the candidate count, and a status that is always PENDING_REVIEW on enqueue:

The review queue


List reviews

Cursor-paginated list of extraction reviews for a context, optionally filtered by lifecycle status.
Query parameters: status (PENDING_REVIEW, APPROVED, REJECTED), limit (1–200), and cursor.

Get one review

A review carries its lifecycle, the proposed candidates, provenance, and linkage state:
Each candidate declares the lane that produced it: text_layer (PDF text, higher trust) or vision (OCR/vision model, lower trust). On the text_layer lane, field values are tokens from the document text. On the vision lane, the model reads them from the image. Money stays a string, never a parsed amount.

Approve or reject


Approve

Approving a PENDING_REVIEW review runs the single deterministic handoff into the normal ingestion pipeline (dedup + outbox + match-trigger) and links the resulting job to the review. This is the only path from an AI candidate to a reconciled transaction, and it runs only on explicit human approval.

Reject

Rejecting closes the review, and nothing enters ingestion. The body is optional. An empty body is a valid “reject with no reason”.
The approving/rejecting principal is recorded for audit.

Mapping proposals


Before you declare a field map by hand, ask the advisor to inspect a representative sample and propose a config-only mapping. When Lerian enables the mapping advisor for your environment, Matcher sends a capped slice of the sample to the language-model provider Lerian configures for your environment. It is advisory and side-effect-free: producing a proposal persists nothing. You confirm the result through the existing field-map declaration path.
The response carries the proposed field map, source dialect, and a per-field breakdown with confidence and rationale:
The response never carries parsed values, amounts, or transactions.

Fetch from an external transport


Trigger a manual fetch-and-ingest that lists every object matching the supplied transport coordinates and streams each into the trusted-content ingestion pipeline. kind is sftp (the default), https, s3, or imap. The body carries the connection coordinates and a required credentialRef. An SFTP fetch needs the server’s host key in connectOptions.known_hosts and reads at most 256 matching objects.
The response (202 Accepted) returns a per-file outcome in fetch order. A per-file intake failure does not stop the batch. The response reports each one:
A transport-level failure (endpoint unreachable or credential rejected) returns 503.

Inspect job errors


After an import, list the stored per-row parse/normalization errors for a job (capped at 100 per job) to explain failed or partially-failed imports.
totalErrors holds the uncapped failure total. truncated is true when the total exceeds the stored (capped) set.

Response codes