Skip to main content
GET
List documents

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:
Filter and sort on a related (included) object by nesting into the relationship — the same relationships you pass to include.
  • 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.
Workspace row-level security applies at every hop, so a related-object filter never widens your tenant scope. Full operator set, deep-nesting rules, and pagination notes: Filtering & sorting. This resource’s related objects (the ones you can include) and how to filter or sort on each: Replace 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):
Filter by a to-many relation (quantified — bare nesting is invalid):

Headers

Authorization
string
required

Bearer token for authentication

Query Parameters

include
enum<string>

Include detailed relationship data in the response. Comma-separated values supported.

Available options:
media,
invoice
filter[uploaded_at][from]
string<date-time>

Filter documents uploaded from this date/time

filter[uploaded_at][to]
string<date-time>

Filter documents uploaded up to this date/time

filter[processed_at][from]
string<date-time>

Filter documents processed from this date/time

filter[processed_at][to]
string<date-time>

Filter documents processed up to this date/time

filter[workspace_id]
string<uuid>

Filter documents by workspace ID

filter[external_workspace_id]
string

Filter documents by external workspace ID

filter[status]
enum<string>

Filter documents by processing status

Available options:
pending,
processing,
completed,
failed,
deleted
filter[file_type]
enum<string>

Filter documents by file type

Available options:
pdf,
image,
word,
excel,
text
sort
enum<string>

Sort documents by field. Use - prefix for descending order.

Available options:
uploaded_at,
-uploaded_at,
processed_at,
-processed_at
limit
integer
default:20

Number of documents per page

Required range: 1 <= x <= 100

Response

Documents retrieved successfully

data
object[]