List Sources for an Agent
GET /api/sources/chatbot/{chatbot_id}
Returns all training sources attached to the specified agent.
string
required
The unique ID of the agent whose sources you want to list.
200 OK):
string
Unique identifier for the source.
string
Source type:
"file", "website", or "text".string
Display name of the source — the original filename, URL, or text title.
string | null
The URL for website sources;
null for file and text sources.string | null
File extension for file sources (e.g.,
"pdf", "docx"); null for website and text sources.integer | null
File size in bytes for file sources;
null for website and text sources.string
Processing status:
"processing", "completed", or "failed".string | null
If
status is "failed", this field contains a description of what went wrong.string
ISO 8601 timestamp of when the source was added.
Upload a File Source
POST /api/sources/chatbot/{chatbot_id}/file
Uploads a file as a training source using multipart/form-data. The file is processed asynchronously — the response returns immediately with status: "processing". Poll the list sources endpoint to check when status changes to "completed".
Maximum file size: 100 MB
string
required
The unique ID of the agent to attach the file to.
file
required
The file to upload. Supported formats:
.pdf, .docx, .txt, .xlsx, .csv. Maximum size: 100 MB.201 Created):
File processing runs in the background. Check the source’s
status field — it moves from "processing" to "completed" (or "failed") once BotSmith finishes indexing the content.Add a Website Source
POST /api/sources/chatbot/{chatbot_id}/website
Scrapes a webpage and adds its content as a training source. Send the URL as a multipart/form-data field. Like file uploads, scraping runs asynchronously.
string
required
The unique ID of the agent to attach the website to.
string
required
The full URL to scrape (e.g.,
https://example.com/faq). Must be a publicly accessible page.201 Created):
Add a Text Source
POST /api/sources/chatbot/{chatbot_id}/text
Adds plain text directly as a training source using multipart/form-data. Unlike file and website sources, text sources are marked "completed" immediately because no external processing is needed.
string
required
The unique ID of the agent to attach the text to.
string
required
A descriptive label for this text source (e.g.,
"Product FAQ", "Shipping Policy").string
required
The raw text content to add to the knowledge base.
201 Created):
Delete a Source
DELETE /api/sources/{source_id}
Permanently removes a training source and deletes its associated vectors from the agent’s knowledge base. Returns 204 No Content on success.
string
required
The unique ID of the source to delete.
204 No Content — no response body.