Document Counts
Count how many documents match filter conditions without fetching full result pages. Read the total field of the filter endpoint with a minimal limit.
To count documents matching filter conditions without transferring full result pages, call POST /v1/documents/filter with your conditions and a minimal limit, then read the total field. total always reflects the complete number of matching documents regardless of the page size, so a limit: 1 request is a cheap count query.
This pattern powers faceted navigation UIs and dashboard summary widgets: run one count request per facet (for example, one per source_id) and render the totals, fetching full document lists only when the user drills in.
Count matching documents
Response (read total)
{
"data": [ { "id": "doc_x9y8z7w6", "name": "Invoice-2024-001.pdf" } ],
"total": 47,
"links": { "self": "/v1/documents/filter" }
}To count per source, repeat the request with a different
source_id per call. Omitting conditions counts all documents in scope, which is useful for dashboard overview widgets.