Skip to main content

Knowledge API

Libraries, collections, and documents that make up the knowledge base.

📄️Get extracted text content of document

Returns the parsed text of a processed document as ordered chunks. For audio and video documents each chunk is the transcription of one time window, with `startOffsetSec`/`endOffsetSec` locating it on the media timeline. Content is only returned once ingestion is `COMPLETED` — poll `GET /api/v1/documents/{id}/status/` first; any other status (including `FAILED`) answers an empty `chunks` page. A file that was stored without entering the knowledge pipeline (an AI-generated file while 'Search Generated Files' is off) is `COMPLETED` with an empty page and `knowledgeIngestion: 'skipped'`, so an empty result is never mistaken for an empty file.

📄️Move document to another collection

Moves an uploaded document into another collection of the same company, optionally into one of its manual folders. The document keeps its id, status and knowledge: nothing is re-ingested and no budget is spent, unlike exportDocumentToCollection, which copies the file into a new QUEUED document and leaves the original behind. The document takes the privacy of the destination collection. Connector-synced documents cannot be moved (the next sync run would recreate them at the source). Requires write access to both collections.

📄️Upload documents

Multipart upload of one or more files into a collection. Plain multipart posts of the `files` field work for any file that fits in one request; `folderId` files every file into one manual folder, and `folderIds` (comma-separated, one entry per file in order, empty for the root) files each into its own, so one request can mirror a directory tree. One request carries at most the single-request ceiling of the infrastructure in front of the platform (`maxRequestSizeInMBytes` in the createDocumentUploadUrl response, 100MB on the hosted platform); a bigger body answers 413 with `code: 'upload/request-too-large'` and `useChunkedUpload: true`. Files up to the plan limit go through the resumable chunked protocol: POST each 5MB chunk as `files` with the `X-Chunk-Index`, `X-Total-Chunks`, `X-Chunk-Size`, `X-Total-File-Size`, `X-File-Name`, `X-File-Type` and `X-Resume-Token` headers (see `src/shared/chunked-upload.ts`); the last chunk answers with the created document. A multipart body the server cannot parse answers 400 with `code: 'upload/malformed-multipart'`; an exhausted plan budget or quota answers 402 with `code: 'budget-exceeded'` or `code: 'quota-exceeded-<quota>'`. Requires write permission on the collection.

📄️Create upload URL

The two-step upload for callers that cannot send multipart/form-data (MCP hosts, plain scripts): this operation returns a short-lived, single-use URL, and sending the raw file bytes to it with PUT ingests the file into the collection exactly like a regular upload. The URL inherits the permissions of whoever created it. The response reports two ceilings: `maxFileSizeInMBytes`, the company plan's document size limit, and `maxRequestSizeInMBytes`, the most one request may carry through the infrastructure in front of the platform. A file between the two must go through the resumable chunked protocol of `uploadCollectionDocuments` (see the getDocanaHelp uploads guide): the upload URL itself only enforces the plan limit, so a bigger body is refused by the edge, not by a JSON 413 from the platform.