Upload a document
Upload a file for processing into the knowledge base
query Parameters
start_processingStart processing immediately
collection_idAssign to a collection
sourceSource identifier for the document (e.g. 'youtube-transcriber', 'slack-bot'). Defaults to 'upload'.
source_keyStable identity of the file at its source (e.g. nextcloud:<server>:<fileId>, url:<url>). If a document with this key exists, it is replaced in place — same document id, and only changed content is re-extracted (entities, relationships and curation of unchanged parts are kept). Otherwise a new document is created and stores the key. Also accepted as a form field. An empty value is treated as absent. While a key is given, the same-filename-and-size duplicate guard (409) is skipped.
replace_document_idReplace this existing document in place (takes precedence over source_key; sets source_key on it when both are given). If the document no longer exists the upload falls back to source_key resolution, then to a new document — it never 404s. 403 if the document is outside the caller's collection scope. Also accepted as a form field; empty = absent.
Upload a document › Responses
Document uploaded, replaced in place (replaced: true), or left untouched because the bytes are identical to a completed document (unchanged: true).
document_ididAlias of document_id
filenamestatusmessagesourcereplacedAn existing document (source_key / replace_document_id) was updated in place; document_id is unchanged. Always present.
unchangedThe bytes were identical to an already-completed document, so nothing was reprocessed. Always present.
Get document details
path Parameters
document_idGet document details › Responses
Document retrieved
idfilenamefile_typefile_sizeupload_dateprocessing_statuschunk_countcollection_idsourceOrigin of the document (e.g. 'upload', 'custom_input', or a custom source set via API)
content_statusSet when the source file yielded nothing to ingest — 'empty' (zero bytes / no pages / no text) or 'encrypted' (password-protected PDF). Such documents are 'completed', not 'failed': the outcome is terminal and no reprocess can change it. Absent for normal documents.
content_noteHuman-readable explanation of content_status (empty string when unset)
Get original document file
Serve the original uploaded file for viewing or download. Returns the raw file with its stored filename and content type. For restricted API keys, access is validated against the document's collection.
path Parameters
document_idGet original document file › Responses
Original file stream
Download documents as ZIP
Stream a ZIP archive of the original uploaded files for the given document IDs. Uses ZIP64 for large collections.
Download documents as ZIP › Request Body
document_idsList of document IDs to include in the ZIP
Download documents as ZIP › Responses
ZIP archive streamed successfully