v13

latestOpenAPI 3.1.0raw.githubusercontent.com2026-01-226780228.2 KB
Documents

List Docs

Flexible document listing with aggregates, projections, and advanced pagination.

Alias: /documents and /documents/list_docs share this handler.

Supported operators: $and, $or, $nor, $not, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $type, $regex, $contains.

Implicit equality (backwards compatible, JSONB containment):

{"status": "active"}

Explicit operators (typed comparisons for number, decimal, datetime, date):

{"priority": {"$gte": 40}, "end_date": {"$lt": "2025-01-01"}}

Use document_filters with a filename key to filter the filename column:

{"filename": {"$regex": {"pattern": "^report_.*\.pdf$", "flags": "i"}}}

Use folder_name and end_user_id query parameters to scope system metadata.

post/documents/list_docs

Query parameters

string
OR
string[]
folder_depthinteger nullable

Folder scope depth: 0/None = exact, -1 = all descendants, n > 0 = include descendants up to n levels.

Folder scope depth: 0/None = exact, -1 = all descendants, n > 0 = include descendants up to n levels.

end_user_idstring nullable

Headers

authorizationstring nullable

Request body

document_filtersobject nullable

Metadata filters with operator support: $and, $or, $nor, $not, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $type, $regex, $contains. Implicit equality uses JSONB containment; explicit operators support typed comparisons. Reserved key: 'filename' filters the filename column.

skipinteger

Number of documents to skip

limitinteger

Maximum number of documents to return

return_documentsboolean

When false, only aggregates are returned

include_total_countboolean

Include total number of matching documents when true

include_status_countsboolean

Include document counts grouped by processing status when true

include_folder_countsboolean

Include document counts grouped by folder when true

completed_onlyboolean

When true, only documents with completed processing status are returned and counted

sort_by'created_at' | 'updated_at' | 'filename' | 'external_id' nullable

Field to sort the results by

sort_direction'asc' | 'desc'

Sort direction for the results

fieldsstring[] nullable

Optional list of fields to project for each document (dot notation supported). Derived fields such as 'page_count' are also supported.

Response

Successful Response

skipinteger required
limitinteger required
returned_countinteger required
total_countinteger nullable
has_moreboolean
next_skipinteger nullable
status_countsobject nullable