Filter Documents
Search and filter documents by extracted field values via API. Compose equality, comparison, range, containment, and emptiness conditions in one call.
The POST /v1/documents/filter endpoint lets you search documents by their extracted field values: compose conditions on any field Talonic has extracted (supplier names, invoice dates, contract amounts) and get back the matching documents with the tested values inline. Each condition targets a field by its registry UUID and applies an operator to test its value; multiple conditions are AND-combined. The endpoint also supports free-text search over materialized field values and sorting by any field.
Conditions execute against the materialized value store, typed per field: numeric fields compare as numbers, date fields as dates, so gt/lt/between behave correctly without client-side casting. between is inclusive on both bounds (value and valueTo); contains is a case-insensitive substring match on text values with %/_ escaped, so user input is safe to pass through verbatim. Results are filtered by Sources-IAM visibility, evaluated as the API key's minting user.
Matched documents come back as full document rows — id, filename, display_name, status, source_connection_id, tags, inferred type, counts — plus a field_values map carrying the values of exactly the fields your conditions tested, keyed by field registry UUID. Fields not part of any condition are not inlined; read them via the documents or extraction endpoints when you need the full record.
fieldId must be a field registry UUID — resolve names with the field autocomplete endpoint. A fieldId that matches no registry field simply matches no documents, and a condition with an unknown operator is skipped rather than erroring, so validate both client-side./v1/documents/filterBody parameters
150Operators: eq, neq, gt, gte, lt, lte, between, contains, is_empty, is_not_empty
Request body
{
"conditions": [
{ "fieldId": "6f1e9a2b-4c3d-4e5f-8a7b-9c0d1e2f3a4b", "operator": "eq", "value": "Acme Corp" },
{ "fieldId": "8a2b3c4d-5e6f-4a1b-9c8d-7e6f5a4b3c2d", "operator": "between", "value": "2026-01-01", "valueTo": "2026-12-31" }
],
"sort": { "fieldId": "8a2b3c4d-5e6f-4a1b-9c8d-7e6f5a4b3c2d", "direction": "desc" },
"page": 1,
"limit": 25
}Response
Response fields
Response
{
"data": [
{
"id": "b8b00d51-eecc-49b3-affc-89fee95b9518",
"filename": "Invoice-2026-001.pdf",
"display_name": "Acme Corp — June invoice",
"status": "completed",
"source_connection_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"created_at": "2026-06-15T10:32:00.000Z",
"tags": [],
"system_tags": [],
"document_type_inferred": "Invoice",
"field_count": 14,
"resolved_field_count": 12,
"field_values": {
"6f1e9a2b-4c3d-4e5f-8a7b-9c0d1e2f3a4b": {
"value_text": "Acme Corp",
"value_number": null,
"value_date": null,
"value_boolean": null
}
}
}
],
"total": 47,
"links": { "self": "/v1/documents/filter" }
}Errors
Error responses
Build conditions programmatically by first calling GET /v1/search/autocomplete to resolve field IDs, then GET /v1/search/field-values to populate value pickers. An identical route exists at POST /v1/search/filter for integrations that prefer everything under the search namespace — same body, same response, only links.self differs.