API-referentie, webhooks en de in te sluiten widget voor Bob β jullie beheerde AI-frontoffice.
{
"email": "admin@office16852.com",
"password": "your_password"
}
{
"email": "customer@business.com",
"password": "customer_password"
}
Drie routes: (1) Publiek, dezelfde herkomst, anoniem. β POST /api/chat (bijv. widget op marketingwebsite; geen login). (2) Cross-origin embed β POST /api/widget/chat with X-Widget-Key and allowed Origin. (3) Geauthenticeerde app / Mission Control β POST /api/chat/session en POST /api/chat/message (vereist chat.manage and session/CSRF for cookie auth) β niet for anonymous fetch van openbare pagina's.
message, session_id, optioneel business_id.
X-Widget-Key, Content-Type: application/json. Origin must be allowed for the key. See docs/REQUEST_FLOWS.md in de repository voor CORS-details.
chat.manage). Retourneert 401 if called anonymously from a public page β use POST /api/chat voor dat geval in plaats daarvan.
{
"session_id": "session_123",
"message": "Hello, I need help with my order"
}
Voeg Bob toe aan elke website met één script-tag. Na onboarding is je widget-embedcode beschikbaar in het Customer Portal onder Widget-instellingen.
<!-- Canonical tenant-scoped bundle from Customer Portal Widget Setup (no API key in HTML). --> <script src="https://YOUR_OFFICE_HOST/widget/YOUR_TENANT_UUID/widget.js" async></script>
Personaβs: toon, naam, instructies. Elke tenant: standaard; aanpasbaar in Admin of API.
{ name, description, tone, systemPrompt }Published pricebook is the source of truth. Use the APIs below for live numbers; this table matches pricebook-seed V1 (past zich aan wanneer je een nieuwe versie publiceert).
| Functie | Starter | Pro (abon.) | Enterprise |
|---|---|---|---|
| Catalogusprijs (USD/maand) | $79 | $249 | $899 |
| Inbegrepen AI-credits / maand | 15,000 | 75,000 | 250,000 |
| Teamplaatsen | Tot 3 | Tot 10 | Onbeperkt |
| Standaardintegraties (inbegrepen) | 1 | 3 | 10 |
| Ondersteuning | Prioriteit | Toegewijd |
Gebruik het blok dat bij jouw scenario past. Kopieer het admin-voorbeeld niet naar anonieme 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 }
)