Knowledge Base API¶
File management and search for the knowledge base.
Prefix: /api/knowledge
File Tree¶
Returns all files and empty folders across all KB sources.
[
{
"path": "runbooks/deploy.md",
"label": "Personal",
"name": "deploy",
"size": 2048,
"kind": "file"
}
]
Read File¶
Response:
For PDFs, returns extracted text.
Raw File¶
Serve the file as a binary download (for inline PDF viewing).
Search¶
Response:
[
{
"path": "notes/postgres.md",
"label": "Personal",
"line_number": 42,
"snippet": "Connection pooling with PgBouncer..."
}
]
Write File¶
Create or overwrite a KB file.
Body:
Create Folder¶
Body:
Rename File¶
Body:
Move Between Sources¶
Body:
{
"old_path": "notes/topic.md",
"old_label": "Personal",
"new_label": "Company Docs",
"new_path": "shared/topic.md"
}
Delete File¶
confirm=true is required (1.5.0+). Calls without it return 400 Bad Request. The web UI always sends the flag; the requirement is there to stop bare HTTP clients from dropping files in a single request.