API Reference
Complete documentation for the BotFusion API endpoints and integration options.
API Overview
BotFusion provides a comprehensive REST API that allows you to programmatically manage your chatbots, knowledge base, and user interactions. All API endpoints use standard HTTP methods and return JSON responses.
Base URL
All API requests should be made to:
https://your-botfusion-instance.com/api
Authentication
API requests must be authenticated using an API key. You can generate an API key in your BotFusion dashboard under Settings → API Keys. Include your API key in the request headers as follows:
Authorization: Bearer YOUR_API_KEY
Rate Limiting
API requests are rate-limited to 100 requests per minute per API key. If you exceed this limit, you'll receive a 429 Too Many Requests response. The response headers include information about your rate limit status:
X-RateLimit-Limit
: Maximum number of requests allowed per minuteX-RateLimit-Remaining
: Number of requests remaining in the current windowX-RateLimit-Reset
: Time when the rate limit window resets (Unix timestamp)
API Endpoints
Chatbots
/api/chatbots
List all chatbots for the authenticated user.
Response
{
"chatbots": [
{
"id": "clq2x5z9h0000jk5dx8r1z3q9",
"name": "Support Bot",
"description": "Customer support chatbot",
"createdAt": "2023-12-15T10:30:00.000Z",
"updatedAt": "2023-12-16T14:20:00.000Z"
},
{
"id": "clq2x6z9h0001jk5dx8r1z3q0",
"name": "Sales Assistant",
"description": "Product information and sales",
"createdAt": "2023-12-16T09:15:00.000Z",
"updatedAt": "2023-12-16T15:45:00.000Z"
}
]
}
/api/chatbots
Create a new chatbot.
Request Body
{
"name": "Product FAQ Bot",
"description": "Answers questions about our products",
"model": "gpt-3.5-turbo",
"temperature": 0.7,
"systemPrompt": "You are a helpful assistant that answers questions about our products."
}
Response
{
"id": "clq2x7z9h0002jk5dx8r1z3q1",
"name": "Product FAQ Bot",
"description": "Answers questions about our products",
"model": "gpt-3.5-turbo",
"temperature": 0.7,
"systemPrompt": "You are a helpful assistant that answers questions about our products.",
"createdAt": "2023-12-17T11:20:00.000Z",
"updatedAt": "2023-12-17T11:20:00.000Z"
}
/api/chatbots/:id
Get details for a specific chatbot.
Path Parameters
id
- The ID of the chatbot
Response
{
"id": "clq2x7z9h0002jk5dx8r1z3q1",
"name": "Product FAQ Bot",
"description": "Answers questions about our products",
"model": "gpt-3.5-turbo",
"temperature": 0.7,
"systemPrompt": "You are a helpful assistant that answers questions about our products.",
"createdAt": "2023-12-17T11:20:00.000Z",
"updatedAt": "2023-12-17T11:20:00.000Z",
"sources": [
{
"id": "clq2x8z9h0003jk5dx8r1z3q2",
"type": "website",
"url": "https://example.com/products",
"createdAt": "2023-12-17T11:25:00.000Z"
},
{
"id": "clq2x9z9h0004jk5dx8r1z3q3",
"type": "pdf",
"filename": "product_manual.pdf",
"createdAt": "2023-12-17T11:30:00.000Z"
}
]
}
Knowledge Base
/api/chatbots/:id/sources
Add a new knowledge source to a chatbot.
Path Parameters
id
- The ID of the chatbot
Request Body
{
"type": "website",
"url": "https://example.com/documentation"
}
Response
{
"id": "clq2xaz9h0005jk5dx8r1z3q4",
"type": "website",
"url": "https://example.com/documentation",
"status": "processing",
"createdAt": "2023-12-17T12:00:00.000Z"
}
Chat
/api/embed/:id
Send a message to a chatbot and get a response.
Path Parameters
id
- The API key of the chatbot
Request Body
{
"message": "What features does your product offer?",
"conversationId": "optional-conversation-id"
}
Response
{
"response": "Our product offers several key features including real-time analytics, customizable dashboards, automated reporting, and integration with over 50 third-party services. Would you like more information about any specific feature?",
"conversationId": "clq2xbz9h0006jk5dx8r1z3q5",
"sources": [
{
"title": "Product Features",
"url": "https://example.com/features"
}
]
}
Need API Support?
Our developer team is ready to help with any API integration questions.