Skip to content
BotBaseDocs
PricingDashboardStart free
  • Build AI assistants that know your business
  • Quick start
  • Core concepts
  • Create an account
  • Documents
  • Websites
  • Social media posts
  • How answers are grounded
  • Languages
  • Assistant types and plans
  • Create an assistant
  • Personality and instructions
  • Testing your assistant
  • Conversations
  • Leads, forms and human support
  • Booking agent
  • Email replies
  • AI models
  • Website widget
  • Widget appearance and design
  • Chat link and QR code
  • Connect your business platform
  • CRM lead sync
  • Management Agents overview
  • Integration guide
  • Roles and permissions
  • Security model
  • Server and browser API reference
  • Examples by industry
  • Audit log and troubleshooting
  • Developer API overview
  • API keys
  • Chat API reference
  • Errors and limits
  • Plans and the free trial
  • Billing and payments
  • Emails and notifications
  • Security and privacy
  • Troubleshooting
  • Frequently asked questions
Docs/Management Agents/Server and browser API reference

Server and browser API reference

Endpoints for creating and revoking Management Agent sessions and for the in-app chat, with request and response formats.

Management Agents·3 min read·Updated 2 Dec 2026

Management Agents expose two small APIs. They use different credentials and must not be mixed.

APICalled fromAuth header
Server API /management/v1/...Your backendAuthorization: Bearer bbx_mgmt_... (server key)
Browser API /public/management/...The staff member's browser (the widget does this for you)Authorization: Bearer bbxs_... (session token)

Use the API host shown in your dashboard, for example https://api-v2.botbasex.com.

#Create a session

POST /management/v1/sessions

JSON
{
  "user": {
    "id": "T-17",
    "name": "Neema Mushi",
    "roles": ["teacher"],
    "attributes": { "school_id": "S-1", "class_ids": ["F2A", "F2B"] }
  },
  "ttl_minutes": 15
}
FieldRules
user.idRequired. Your own user id, 1–128 characters
user.nameOptional, up to 120 characters. Shown to the AI so it can address the user
user.rolesList of up to 20 role keys from your Roles and permissions. Unknown keys are ignored
user.attributesOptional object, up to 20 keys (lowercase letters, digits, _). Values: text, number, true/false or a list of up to 50 of those. Max 4 KB
ttl_minutesOptional, 5–60. Defaults to the agent's session length

201 Created

JSON
{
  "session_token": "bbxs_…",
  "session_id": "3f0c…",
  "expires_at": "2026-12-03T09:15:00+00:00",
  "roles": ["teacher"],
  "ignored_roles": []
}

Return only session_token to the browser.

StatusMeaning
401 invalid_server_keyWrong or rotated key
403The account's plan does not include Management Agents (or the account is suspended)
409 app_not_liveClick Go live in the dashboard first
422Invalid user block (message says which field)

#Revoke sessions

DELETE /management/v1/sessions/{session_id} ends one session: {"revoked": true}.

POST /management/v1/users/{user_id}/revoke ends every active session of one of your users (use it on logout, role change or account removal): {"revoked": 2}.

#Browser: who am I

GET /public/management/session

Returns what the chat window needs and nothing secret:

JSON
{
  "name": "Msaidizi wa Shule",
  "language": "Swahili",
  "welcome_message": "Habari! Nikusaidie nini leo?",
  "primary_color": "#0f766e",
  "launcher_icon": "bot",
  "widget": { "launcher_shape": "pill" },
  "user": { "id": "T-17", "name": "Neema Mushi", "roles": ["Teacher"] },
  "expires_at": "2026-12-03T09:15:00+00:00",
  "test_mode": false
}

#Browser: send a message

POST /public/management/chat

JSON
{ "message": "Ni wanafunzi gani hawakuja leo Form 2?", "conversation_id": null }

200 OK

JSON
{
  "conversation_id": "c1b2…",
  "answer": "Leo Form 2: Baraka hakuhudhuria. Wanafunzi wengine wote walikuwepo.",
  "actions": [{ "type": "integration_call", "label": "Class attendance — live data", "simulated": false, "real": true }],
  "sources": []
}

Send the returned conversation_id with the next message to continue the conversation (follow-up questions use the earlier results).

StatusMeaningWhat to do
401 session_expired / session_revoked / invalid_sessionToken no longer validGet a new token from your backend (the widget does this automatically, once)
401 app_unavailableAgent paused or deactivatedShow "assistant unavailable"
403 origin_not_allowedThe page's site is not in Allowed websitesAdd your origin in the dashboard
403Plan no longer includes Management AgentsUpgrade
404The conversation belongs to another userStart a new conversation (omit conversation_id)
429More than 30 messages per minute in one sessionWait a moment

#Calls BotBaseX makes to your API

For each operation the agent runs, BotBaseX sends the request you configured, with:

HeaderValue
Your auth headerFrom the connection's encrypted credentials
X-BotBaseX-ActorSigned token with the user, roles and attributes (2-minute expiry). See Security model
Idempotency-KeyOn writes: the pending action id. Use it to ignore duplicates

Responses must be JSON. Only the fields you mapped are passed to the AI.

#The widget does this for you

With data-session-url, the BotBaseX widget calls your session route, the session endpoint and the chat endpoint, renews expired tokens and starts a new conversation if the saved one belongs to another user. Use the raw browser API only if you build your own chat interface.

PreviousSecurity modelNext Examples by industry

On this page

  • Create a session
  • Revoke sessions
  • Browser: who am I
  • Browser: send a message
  • Calls BotBaseX makes to your API
  • The widget does this for you