Local API Guide contents
Overview
Lists the documents on the Knowledge page, with their status. A document can be searched once its status is ready. Documents are added in the app (drag and drop, or Add files).
Request
| Parameter | Description |
|---|---|
collectionquery string | Optional: a collection name or id (c:3). Default: every collection. |
| Authorization header | Authorization: Bearer <key>, only when Require API key is on in the app. |
Response
| Field | Description |
|---|---|
data[].idinteger | The document id (also in knowledge sources as document_id). |
data[].name, kindstring | The file name and its type (pdf, docx, pptx, xlsx, html, md, image, …). |
data[].collectionstring | The collection id. |
data[].statusstring | queued, indexing, ready or error (with error saying why). |
data[].chunks, pages, bytesinteger | Searchable passages, pages, and the file size. |
data[].addedstring | When it was added (ISO 8601). |
Example
curl "http://localhost:1234/v1/knowledge/documents?collection=Policies"
import requests docs = requests.get("http://localhost:1234/v1/knowledge/documents", params={"collection": "Policies"}).json()["data"] print([d["name"] for d in docs if d["status"] == "ready"])
const { data } = await (await fetch("http://localhost:1234/v1/knowledge/documents?collection=Policies")).json(); console.log(data.filter(d => d.status === "ready").map(d => d.name));
{
"object": "list",
"data": [
{ "id": 41, "name": "Refund policy.pdf", "kind": "pdf", "collection": "c:3", "status": "ready", "error": null,
"chunks": 18, "pages": 6, "bytes": 182344, "added": "2026-10-12T09:41:07" }
]
}Errors
| Status | Code | When |
|---|---|---|
| 401 | invalid_api_key | Require API key is on and the key is missing or wrong. |
| 404 | collection_not_found | No collection has that name or id. |
| 503 | knowledge_unavailable | The knowledge database could not be opened. |