Get Document
Retrieve a list of documents with optional filtering, sorting, and relationship inclusion. By default, only document IDs are returned for relationships.
Complex Usage Example
Advanced Document Filtering with Full Context
This example demonstrates advanced filtering with multiple parameters, relationship inclusion, file type filtering, and sorting for retrieving documents:Filtering & sorting on related objects
Filter and sort on a related (included) object by nesting into the relationship — the same relationships you pass toinclude.
- To-one relations nest directly:
{ "issuer": { "name": { "_eq": "Acme" } } }, and sort by a dot-path:"orderBy": { "field": "issuer.name", "direction": "asc" }. - To-many relations must be quantified with
_some,_every, or_none:{ "items": { "_some": { "quantity": { "_gt": 1 } } } }. They are not directly sortable (a to-many sort needs an aggregate proxy). - Composite
composite_*columns are virtual — filter and sort on their underlying source fields, not on the composite.
include) and how to filter or sort on each:
| Relationship | Cardinality | Filter on a field | Sort by a field |
|---|---|---|---|
workspace | to-one (workspace) | { "workspace": { "name": { "_eq": … } } } | "field": "workspace.name" ✅ |
collect | to-one (collect) | { "collect": { "field_name": { "_eq": … } } } | "field": "collect.field_name" ✅ |
source_workspace_connector | to-one (workspace_connector) | { "source_workspace_connector": { "name": { "_eq": … } } } | "field": "source_workspace_connector.name" ✅ |
invoices | to-many (invoice) | { "invoices": { "_some": { "grand_total": { "_eq": … } } } } | aggregate proxy only ⚠️ |
transaction_documents | to-many (transaction_document) | { "transaction_documents": { "_some": { "field_name": { "_eq": … } } } } | aggregate proxy only ⚠️ |
field_name with any field of the related object. See its object-reference page for the full field list.
Filter by a to-one relation (and sort by it):
Headers
Bearer token for authentication
Query Parameters
Include detailed relationship data in the response. Comma-separated values supported.
media, invoice Filter documents uploaded from this date/time
Filter documents uploaded up to this date/time
Filter documents processed from this date/time
Filter documents processed up to this date/time
Filter documents by workspace ID
Filter documents by external workspace ID
Filter documents by processing status
pending, processing, completed, failed, deleted Filter documents by file type
pdf, image, word, excel, text Sort documents by field. Use - prefix for descending order.
uploaded_at, -uploaded_at, processed_at, -processed_at Number of documents per page
1 <= x <= 100Response
Documents retrieved successfully