Documents
The document library — data sheets, decks, manuals and schedules, with the summary and searchable text written for each one on arrival.
List documents
The document library, with the folders each document sits in and the summary written for it on upload.
lifecycle decides which documents are in scope and defaults to active: a deprecated document is kept and still downloadable, but it is out of the way and the AI no longer retrieves it, so it stays out of the list unless you ask for deprecated or all.
search matches the name and the summary. embedding_search matches on meaning instead, scoring every document against the phrase and ordering by the score, which is what finds a pricing deck that never uses the word "pricing". If the embedding cannot be produced the request still filters, falling back to the substring match rather than answering with the whole library.
folder narrows to one folder, tags to the values of a tag group, and file_format to a file name extension. GET /documents/formats answers which formats are worth offering.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
query Parameters
cursor^[A-Za-z0-9_-]+$embedding_searchfavoritefile_added_byfile_formatfolderlifecyclelimit^-?[0-9]+(\.[0-9]+)?…offset^-?[0-9]+(\.[0-9]+)?…searchsimilarityThresholdsort^-?[a-z0-9_]+$tagsHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
List documents › Responses
Success
has_moreWhether more rows exist past this page.
next_cursorPass back as cursor for the next page. Null on the last page.
Deprecate a document
Takes a document out of circulation without deleting it. It leaves the library's default listing, and the AI stops retrieving it: its indexed passages are removed, so it can no longer turn up inside an answer.
Nothing is destroyed. The file, its versions and its download links are untouched, its converted text is kept, and somebody who names the document directly still gets it. Restore puts it back and re-indexes it.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
path Parameters
idHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Deprecate a document › Responses
Success
What the file belongs to. One key naming the owning object, or library for a library it sits in rather than an object it belongs to. Keys the platform stamps (presentation jobs, form submissions, workflow runs) are returned but cannot be sent.
file_idfile_namefile_typefile_sizefile_createdfile_updatedfile_added_byfile_hashfile_metadatafile_replicasfile_statusfile_bucketfile_folderfile_provider_idfile_summaryfile_preffile_deprecatedfile_relation_countHow many other documents this one is linked to.
markdown_readysimilarityRestore a document
Puts a deprecated document back into the library and re-indexes it, so the AI can retrieve it again.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
path Parameters
idHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Restore a document › Responses
Success
What the file belongs to. One key naming the owning object, or library for a library it sits in rather than an object it belongs to. Keys the platform stamps (presentation jobs, form submissions, workflow runs) are returned but cannot be sent.
file_idfile_namefile_typefile_sizefile_createdfile_updatedfile_added_byfile_hashfile_metadatafile_replicasfile_statusfile_bucketfile_folderfile_provider_idfile_summaryfile_preffile_deprecatedfile_relation_countHow many other documents this one is linked to.
markdown_readysimilarityTag documents
Adds and removes tag values across a set of documents in one call. add and remove are both maps of group name to values; a group the document does not carry is created, and a group left empty is dropped. Ids that name something other than a document in this library are ignored.
The groups themselves are configured per workspace — see the document tag groups under workspace administration.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
Headers
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Tag documents › Responses
Success
List formats
Which file formats the library actually holds and how many of each, so the type filter can offer pdf and pptx without offering formats the account has none of. A row is a filter: send format straight back as file_format on GET /documents.
Only the folder and the lifecycle narrow the counts, so a count describes the library rather than the query in front of it. Counting is exact, which means reading every document the caller can see; a library too large to do that inside the server's budget answers with no rows rather than a guess.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
query Parameters
folderlifecycleHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
List formats › Responses
Success
Ordered by count, most common first.
countedFalse when the library was too large to count in time.
