BotPlot API Documentation
The BotPlot API lets you programmatically send chat messages, manage conversations, and access knowledge sources. Use it to build custom integrations with your existing tools.
https://botplot.app/apiAuthentication
All API requests require an API key. You can find your project API key in the dashboard settings. Pass it as a header:
curl https://botplot.app/api/v1/conversations \
-H "Authorization: Bearer YOUR_API_KEY"curlYou can also use the x-api-key header. The Chat API uses x-api-key for widget compatibility.
Chat API
Send a message and receive a streamed AI response. This is the same endpoint the widget uses.
/api/chat| Parameter | Type | Required | Description |
|---|---|---|---|
message | string | Required | The user's question |
visitorId | string | Required | Unique identifier for the visitor |
conversationId | string | Optional | Continue an existing conversation |
visitor_info | object | Optional | Lead capture data: { name, email, phone } |
Auth: x-api-key header
Response: Server-Sent Events (SSE) stream. Each token is sent as data: {"token":"..."}. The final event includes conversationId, sources, and confidence.
curl -X POST https://botplot.app/api/chat \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"message": "What are your shipping options?",
"visitorId": "visitor-123"
}'curlWidget Embed
Add the BotPlot chat widget to any website with a single script tag. The widget is under 15KB gzipped and loads asynchronously.
<!-- Add before </body> -->
<script
src="https://botplot.app/widget/w.js"
data-key="YOUR_API_KEY"
async
></script>htmlThe widget automatically inherits your project's customization (colors, logo, position, welcome message, starter questions).
Conversations API
Business plan only
List conversations
/api/v1/conversations| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | Optional | Max results (default 20, max 100) |
offset | integer | Optional | Pagination offset |
status | string | Optional | Filter by status: active, closed, archived |
curl https://botplot.app/api/v1/conversations?limit=10 \
-H "Authorization: Bearer YOUR_API_KEY"curlResponse
{
"conversations": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"visitor_id": "visitor-123",
"visitor_info": { "name": "John", "email": "john@example.com" },
"status": "active",
"handoff_requested": false,
"created_at": "2025-01-15T10:30:00Z"
}
],
"total": 42,
"limit": 10,
"offset": 0
}jsonMessages API
Business plan only
List messages in a conversation
/api/v1/conversations/:id/messagescurl https://botplot.app/api/v1/conversations/CONV_ID/messages \
-H "Authorization: Bearer YOUR_API_KEY"curlResponse
{
"messages": [
{
"id": "msg-uuid",
"role": "user",
"content": "What are your business hours?",
"sources": [],
"created_at": "2025-01-15T10:30:05Z"
},
{
"id": "msg-uuid-2",
"role": "assistant",
"content": "Our business hours are Monday to Friday, 9am to 5pm EST.",
"sources": [{ "content": "Hours: Mon-Fri 9-5...", "similarity": 0.89 }],
"created_at": "2025-01-15T10:30:07Z"
}
]
}jsonKnowledge Sources API
Business plan only
List knowledge sources
/api/v1/sourcescurl https://botplot.app/api/v1/sources \
-H "Authorization: Bearer YOUR_API_KEY"curlGet source details
/api/v1/sources/:idDelete a source
/api/v1/sources/:idcurl -X DELETE https://botplot.app/api/v1/sources/SOURCE_ID \
-H "Authorization: Bearer YOUR_API_KEY"curlWebhook Events
BotPlot sends HTTP POST requests to your registered webhook endpoints when events occur. Configure webhooks in your project's dashboard.
Available events
| Event | Description |
|---|---|
message.received | A visitor sends a message |
message.sent | The AI sends a response |
conversation.started | A new conversation is created |
handoff.requested | Visitor requests human handoff |
lead.captured | Visitor submits lead capture form |
Payload format
{
"event": "message.received",
"data": {
"conversation_id": "uuid",
"content": "What are your prices?",
"role": "user"
},
"timestamp": "2025-01-15T10:30:00.000Z"
}jsonVerifying signatures
Each webhook delivery includes an X-BotPlot-Signature header with an HMAC-SHA256 signature. Verify it using your endpoint's secret:
# The signature header looks like:
# X-BotPlot-Signature: sha256=abc123...
# Verify using your webhook secretcurlRate Limits & Plan Requirements
- Chat API: Available on all plans. Subject to your plan's monthly message limit.
- Conversations & Sources API (v1): Business plan only.
- Webhooks: Pro (3 endpoints) and Business (10 endpoints).