Complete API Reference and Integration Guide
{
"email": "admin@office16852.com",
"password": "your_password"
}
{
"email": "customer@business.com",
"password": "customer_password"
}
Three paths: (1) Public same-origin anonymous → POST /api/chat (e.g. marketing site widget; no login). (2) Cross-origin embed → POST /api/widget/chat with X-Widget-Key and allowed Origin. (3) Authenticated app / Mission Control → POST /api/chat/session and POST /api/chat/message (requires chat.manage and session/CSRF for cookie auth) — not for anonymous fetch from public pages.
message, session_id, optional business_id.
X-Widget-Key, Content-Type: application/json. Origin must be allowed for the key. See docs/REQUEST_FLOWS.md in the repository for CORS details.
chat.manage). Returns 401 if called anonymously from a public page — use POST /api/chat for that case instead.
{
"session_id": "session_123",
"message": "Hello, I need help with my order"
}
Add Bob to any website with a single script tag. After onboarding, your widget embed code is available in the Customer Portal under Widget Setup.
<!-- Paste before </body> --> <script src="https://your-domain.com/widget/loader.js" data-widget-key="YOUR_WIDGET_KEY" data-position="bottom-right" async> </script>
Personas control how Bob communicates — tone, name, and system instructions. Every tenant gets a default persona on signup; you can customize it from the Admin Dashboard or the API.
{ name, description, tone, systemPrompt }| Feature | Starter | Professional | Enterprise |
|---|---|---|---|
| Monthly messages | 1,000 | 10,000 | Unlimited |
| Knowledge items | 100 | 1,000 | Unlimited |
| Custom personas | 1 | 5 | Unlimited |
| Integrations | Web widget | + Slack, Email | All channels |
| Support | Community | Priority email | Dedicated CSM |
Use the block that matches your scenario. Do not copy the admin example into anonymous marketing HTML.
const response = await fetch('/api/chat', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
session_id: sessionId,
message: userMessage,
business_id: 'office16852-platform'
})
});
const data = await response.json();
const response = await fetch('https://office16852.com/api/widget/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Widget-Key': 'pk_live_...',
'Origin': 'https://your-customer-site.com'
},
body: JSON.stringify({ session_id: sessionId, message: userMessage })
});
// JavaScript — requires logged-in admin / Mission Control (Bearer)
const response = await fetch('/api/chat/message', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + token
},
body: JSON.stringify({
session_id: sessionId,
message: userMessage
})
});
const data = await response.json();
// Python — authenticated only
import requests
response = requests.post(
'https://office16852.com/api/chat/message',
headers={
'Content-Type': 'application/json',
'Authorization': f'Bearer {token}'
},
json={ 'session_id': session_id, 'message': user_message }
)