Endpoints
Documents
Create, read, and update documents via the API.
Endpoints for documents under /api/v1/documents.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/documents | List documents |
| POST | /api/v1/documents | Create a document |
| GET | /api/v1/documents/{id} | Get a document |
| PATCH | /api/v1/documents/{id} | Update a document |
List and create
GET /api/v1/documents returns { documents[] }. Pass ?includeTrashed=true to include trashed
documents.
POST /api/v1/documents accepts JSON or multipart/form-data:
| Field | Type | Notes |
|---|---|---|
name | string | Required |
folderId | string | Target folder (404 if missing) |
contentText | string | Inline text content (JSON path) |
file | file | Uploaded file (multipart path) |
mimeType | string | Content type |
knowledgeBaseId / knowledgeBaseIds | string / string[] | Attach to one or more knowledge bases |
Uploaded files support PDF, DOCX, PPTX, HTML, TXT, Markdown, JSON, and CSV — text is extracted
automatically. Returns 201 with { document }.
Read and update
GET /api/v1/documents/{id} returns { document } with full details.
PATCH /api/v1/documents/{id} branches on the body: { trashed } to trash/restore,
{ reindex: true } to re-index, { knowledgeBaseIds } to change knowledge-base membership, or
{ name, contentText, mimeType } to edit content.
