Bob向けのAPIリファレンス、Webhook、埋め込みウィジェット — ガバナンス付きAIフロントオフィス。
{
"email": "admin@office16852.com",
"password": "your_password"
}
{
"email": "customer@business.com",
"password": "customer_password"
}
3つの道: (1) 同一オリジン、公開、匿名でアクセス。 → POST /api/chat (例:マーケティングサイトのウィジェット、ログイン不要)。(2) クロスオリジン埋め込み → POST /api/widget/chat with X-Widget-Key and allowed Origin。(3) 認証済みアプリ / Mission Control → POST /api/chat/session と POST /api/chat/message (要 chat.manage and session/CSRF for cookie auth) — ない for anonymous fetch 公開ページから。
message, session_id、任意 business_id.
X-Widget-Key, Content-Type: application/json. Origin must be allowed for the key. See docs/REQUEST_FLOWS.md CORSの詳細はリポジトリを参照。
chat.manage)。戻り値 401 if called anonymously from a public page — use POST /api/chat その場合はこちらを。
{
"session_id": "session_123",
"message": "Hello, I need help with my order"
}
Bobは1つのscriptタグでどのWebサイトにも追加できます。オンボーディング後、ウィジェット埋め込みコードはCustomer Portalの次の場所で確認できます: ウィジェットの設定.
<!-- 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>
ペルソナはBobの話し方(トーン、名前、指示)を制御。テナントごとに初期値あり。管理画面か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(新しいバージョンを公開すると調整されます)。
| 機能 | スターター | Pro(上位プラン) | エンタープライズ |
|---|---|---|---|
| 定価(USD/月) | $79 | $249 | $899 |
| 含まれる AI クレジット / 月 | 15,000 | 75,000 | 250,000 |
| チーム席 | 最大3 | 最大10 | 無制限 |
| 標準連携(含む) | 1 | 3 | 10 |
| サポート | メール | 優先度 | 専用 |
シナリオに合うブロックを使ってください。管理画面の例を匿名のマーケティング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 }
)