Add Text to Knowledge Base
Set or replace the plain text content of a knowledge base.
A knowledge base holds one text entry, alongside any uploaded files. Each call replaces the previous text: the old text and its search index are removed, and uploaded files are left as they are. To keep existing text, send it again together with the new content.
The text entry counts toward the limit of 5 files per knowledge base. Replacing existing text never hits the limit; adding text to a knowledge base that already holds 5 files does.
Requires the knowledge_base:create and knowledge_base:edit permissions.
Headers
x-workspace-idstringrequiredWorkspace identifier for the API.
Path Parameters
idstringrequiredThe unique identifier of the knowledge base.
Request Body
textstringrequiredThe full text content of the knowledge base. Must not be empty.
namestringdefault: Plain TextLabel for the text entry, shown as its filename.
Response
201 with the text entry as it now appears in the knowledge base's files.
filenamestringThe entry's label (name, or Plain Text).
keystringInternal key for the entry. A new key is minted on every call.
urlstringAlways empty: text is not stored as a file.
mimetypestringAlways text/plain.
sizenumberLength of the text in characters.
isTextbooleanAlways true. Marks this entry as the text entry rather than an uploaded file.
uploadedAtstringWhen the text was saved.
Errors
| Status | Body | When |
|---|---|---|
400 | {"message": "Workspace ID header is required"} | No x-workspace-id |
400 | {"message": "Text content is required"} | text is missing or blank |
409 | {"message", "code": "KB_FILE_LIMIT_REACHED", "details": {"limit", "current"}} | The knowledge base has no text yet and already holds 5 files |
500 | {"message": "..."} | Anything else |
{
"filename": "Opening hours",
"key": "workspaces/d1d1d1d1d1d1d1d1d1d1d1d1/knowledge-bases/a4a4a4a4a4a4a4a4a4a4a4a4/text-1761735600000.txt",
"url": "",
"mimetype": "text/plain",
"size": 412,
"isText": true,
"uploadedAt": "2026-10-29T10:00:00.000Z"
}Last updated on