Referência de API, webhooks e widget incorporável do Bob — seu front office de IA governado.
{
"email": "admin@office16852.com",
"password": "your_password"
}
{
"email": "customer@business.com",
"password": "customer_password"
}
Três caminhos: (1) Público, mesma origem, anônimo → POST /api/chat (ex.: widget no site de marketing; sem login). (2) Embed cross-origin → POST /api/widget/chat with X-Widget-Key and allowed Origin. (3) App autenticado / Mission Control → POST /api/chat/session e POST /api/chat/message (requer chat.manage and session/CSRF for cookie auth) — não for anonymous fetch de páginas públicas.
message, session_id, opcional business_id.
X-Widget-Key, Content-Type: application/json. Origin must be allowed for the key. See docs/REQUEST_FLOWS.md no repositório para detalhes de CORS.
chat.manage). Retorna 401 if called anonymously from a public page — use POST /api/chat para esse caso em vez disso.
{
"session_id": "session_123",
"message": "Hello, I need help with my order"
}
Adicione o Bob a qualquer site com uma única tag de script. Após o onboarding, o código de incorporação do widget fica disponível no Portal do Cliente em Configuração do 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>
Personas definem a comunicação do Bob — tom, nome, instruções. Cada tenant recebe default no cadastro; personalize no Admin ou na 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 (ajusta quando você publica uma nova versão).
| Recurso | Inicial | Pro | Enterprise |
|---|---|---|---|
| Preço de tabela (USD/mês) | $79 | $249 | $899 |
| Créditos de IA incluídos / mês | 15,000 | 75,000 | 250,000 |
| Lugares da equipe | Até 3 | Até 10 | Ilimitado |
| Integrações padrão (incluídas) | 1 | 3 | 10 |
| Suporte | Prioridade | Dedicado |
Use o bloco que corresponde ao seu cenário. Não copie o exemplo de administrador para HTML de marketing anônimo.
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 }
)