Referencia de API, webhooks y el widget integrable de Bob: su front office de IA gobernado.
{
"email": "admin@office16852.com",
"password": "your_password"
}
{
"email": "customer@business.com",
"password": "customer_password"
}
Tres caminos: (1) Mismo origen, público anónimo → POST /api/chat (p. ej., widget del sitio de marketing; sin inicio de sesión). (2) Inserción de origen cruzado → POST /api/widget/chat with X-Widget-Key and allowed Origin. (3) Aplicación autenticada / Mission Control → POST /api/chat/session y POST /api/chat/message (requiere chat.manage and session/CSRF for cookie auth) — no for anonymous fetch desde 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 en el repositorio para los detalles de CORS.
chat.manage). Devuelve 401 if called anonymously from a public page — use POST /api/chat para ese caso en su lugar.
{
"session_id": "session_123",
"message": "Hello, I need help with my order"
}
Agregue Bob a cualquier sitio web con una sola etiqueta de script. Tras el onboarding, su código de inserción del widget estará disponible en el Portal del Cliente en Configuración del 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>
Las personas rigen cómo se expresa Bob (tono, nombre, instrucciones). Cada tenant recibe un persona por defecto; puede personalizarlo en el panel o por 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 (se ajusta cuando publicas una nueva versión).
| Función | Inicial | Pro | Enterprise |
|---|---|---|---|
| Precio de lista (USD/mes) | $79 | $249 | $899 |
| Créditos de IA incluidos / mes | 15,000 | 75,000 | 250,000 |
| Puestos de equipo | Hasta 3 | Hasta 10 | Ilimitado |
| Integraciones estándar (incluidas) | 1 | 3 | 10 |
| Soporte | Correo electrónico | Prioridad | Dedicado |
Usa el bloque que coincida con tu escenario. No copies el ejemplo de administración en 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 }
)