Add a knowledge source to a chatbot
add_chatbot_knowledgeAdd a knowledge source to a chatbot
Adds one knowledge source to a chatbot. type says how to read content: for url it is the address to draw from, read again every syncInterval (weekly by default), for text it is the literal text, for file it is the text of the file, named by fileName and described by mimeType, and for crawl it is the start page of a website that is read up to maxDepth links deep and maxPages pages and crawled again every syncInterval. A crawl runs in the background with status pending; follow it with GET /chatbots/{chatbotId}/knowledge/crawl. content is always required and must not be empty. The document is created in the voice engine and then attached to the chatbot, which from then on draws on it in conversations. The entry is stored under the account that owns the chatbot, also when a reseller key adds it. When the document cannot be created or attached, the request still succeeds and the entry is stored with status failed; delete it and add it again. Note that the 400 response for an invalid body carries only an error code and a details list, with no message key, unlike the other endpoints.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chatbotId": "<chatbotId>",
"body": "<body>"
},
"name": "add_chatbot_knowledge"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | The knowledge source. `title`, `fileName` and `mimeType` are optional and stored as given; without a `title` the entry is named after the URL or the file name. | |
| chatbotId | Yes | Numeric identifier of the chatbot. |