# Using multipart/form-data
curl -X POST "https://api.getbutter.ai/api/knowledge-base" \
-H "X-API-Key: <YOUR_API_KEY>" \
-H "X-Organization-Id: <YOUR_ORG_ID>" \
-F "name=Product Manual" \
-F "file=@/path/to/manual.pdf" \
-F "agent_id=agent_abc123"
{
"success": true,
"message": "File 'manual.pdf' uploaded and processing started",
"data": {
"documentation_id": "doc_a1b2c3d4e5f6",
"name": "Product Manual",
"type": "file",
"message_id": "msg_abc123def456"
}
}
Knowledge Base
Create Document
POST
/
api
/
knowledge-base
# Using multipart/form-data
curl -X POST "https://api.getbutter.ai/api/knowledge-base" \
-H "X-API-Key: <YOUR_API_KEY>" \
-H "X-Organization-Id: <YOUR_ORG_ID>" \
-F "name=Product Manual" \
-F "file=@/path/to/manual.pdf" \
-F "agent_id=agent_abc123"
{
"success": true,
"message": "File 'manual.pdf' uploaded and processing started",
"data": {
"documentation_id": "doc_a1b2c3d4e5f6",
"name": "Product Manual",
"type": "file",
"message_id": "msg_abc123def456"
}
}
Create a knowledge base document from a file upload or text content. This triggers an asynchronous processing job to index the content.
This endpoint accepts
multipart/form-data for file uploads. For text documents, you can use JSON.Headers
Permissions
kb:create(admin, agent_manager)
Request Body (Form Data)
The file to upload (e.g., PDF, DOCX, TXT). Required if
Max file size: 50MB
text is not provided.
Max file size: 50MB
Response
# Using multipart/form-data
curl -X POST "https://api.getbutter.ai/api/knowledge-base" \
-H "X-API-Key: <YOUR_API_KEY>" \
-H "X-Organization-Id: <YOUR_ORG_ID>" \
-F "name=Product Manual" \
-F "file=@/path/to/manual.pdf" \
-F "agent_id=agent_abc123"
{
"name": "FAQ Content",
"text": "Q: What are your hours? A: We're open 9-5...",
"agent_id": "agent_abc123"
}
{
"success": true,
"message": "File 'manual.pdf' uploaded and processing started",
"data": {
"documentation_id": "doc_a1b2c3d4e5f6",
"name": "Product Manual",
"type": "file",
"message_id": "msg_abc123def456"
}
}