REST API • Legend Tier & Above
API Reference
Build custom integrations, automate workflows, and manage your bots programmatically with the BotHero REST API.
Base URL
https://api.bothero.ai/v1All endpoints require Bearer token authenticationEndpoint Categories
Authentication
API key management and token-based authentication
POST/auth/token
POST/auth/refresh
DELETE/auth/revoke
Bots
Create, configure, and manage your AI bots
GET/bots
POST/bots
PATCH/bots/:id
DELETE/bots/:id
Conversations
Send messages and manage conversation threads
POST/chat/completions
GET/conversations
GET/conversations/:id/messages
Knowledge Base
Upload documents and manage your bot's knowledge
POST/knowledge/upload
GET/knowledge/documents
DELETE/knowledge/:id
Analytics
Retrieve conversation metrics, lead data, and usage stats
GET/analytics/overview
GET/analytics/conversations
GET/analytics/leads
Webhooks
Configure event subscriptions and delivery endpoints
POST/webhooks
GET/webhooks
PATCH/webhooks/:id
DELETE/webhooks/:id
Quick Example
Request
POST /chat/completionscurl -X POST https://api.bothero.ai/v1/chat/completions \
-H "Authorization: Bearer bh_live_..." \
-H "Content-Type: application/json" \
-d '{
"bot_id": "bot_abc123",
"message": "What are your business hours?",
"conversation_id": "conv_xyz789"
}'Response
200 OK{
"id": "msg_k8m2n4",
"bot_id": "bot_abc123",
"conversation_id": "conv_xyz789",
"role": "assistant",
"content": "We're open Monday through Friday,
9 AM to 6 PM EST. How can I help you?",
"model": "gpt-oss-120b",
"usage": {
"prompt_tokens": 142,
"completion_tokens": 28
}
}Low Latency
Sub-second response times with streaming support
Secure by Default
Bearer token auth, rate limiting, and request signing
REST API
Standard JSON over HTTPS — works with any language
Ready to build with the BotHero API?
API access is included with the Legend plan ($99/mo) and above. Start your free trial and get your API keys today.