Riferimento API, webhook e widget incorporabile per Bob — il vostro front office IA governato.
{
"email": "admin@office16852.com",
"password": "your_password"
}
{
"email": "customer@business.com",
"password": "customer_password"
}
Tre percorsi: (1) Stessa origine, accesso anonimo, pubblico. → POST /api/chat (es. widget del sito marketing; senza login). (2) Embed cross-origin → POST /api/widget/chat with X-Widget-Key and allowed Origin. (3) App autenticata / Mission Control → POST /api/chat/session e POST /api/chat/message (richiede chat.manage and session/CSRF for cookie auth) — non for anonymous fetch dalle pagine pubbliche.
message, session_id, opzionale business_id.
X-Widget-Key, Content-Type: application/json. Origin must be allowed for the key. See docs/REQUEST_FLOWS.md nel repository per i dettagli CORS.
chat.manage). Restituisce 401 if called anonymously from a public page — use POST /api/chat per quel caso al posto giusto.
{
"session_id": "session_123",
"message": "Hello, I need help with my order"
}
Aggiungi Bob a qualsiasi sito web con un singolo tag script. Dopo l'onboarding, il codice di embed del widget è disponibile nel Portale Clienti sotto Configurazione widget.
<!-- 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>
Le controllano tono, nome, istruzioni. Persona predefinita; personalizzi da admin o 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 (si aggiorna quando pubblichi una nuova versione).
| Funzione | Base | Pro (piano) | Enterprise |
|---|---|---|---|
| Prezzo di listino (USD/mese) | $79 | $249 | $899 |
| Crediti AI inclusi / mese | 15,000 | 75,000 | 250,000 |
| Posti del team | Fino a 3 | Fino a 10 | Illimitato |
| Integrazioni standard (incluse) | 1 | 3 | 10 |
| Supporto | Priorità | Dedicato |
Usa il blocco che corrisponde al tuo scenario. Non copiare l'esempio admin nell'HTML marketing anonimo.
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 }
)