/dashboard/bots/:id is src/pages/BotDetail.tsx. It has three faces: a read-only view mode with Details/Integration tabs, an edit mode that reuses the create wizard, and a test-call modal.
Loading
On mount,loadBot fetches the bot and its WSS URL in parallel:
GET /api/v1/bots/:idGET /api/v1/bots/:id/wss-url(best-effort)
GET /api/v1/campaigns?status=running and filters for campaigns using this bot, to show a config-lock banner.
Header Actions
| Action | Behavior |
|---|---|
| Test Call | Opens TestCallModal |
| Clone | POST /api/v1/bots/:id/clone, warns calls/campaigns/DID mappings are not copied |
| Edit | Enters edit mode (deserialize(bot) then the wizard) |
| Delete | DELETE /api/v1/bots/:id after confirm |
Cache Controls
Two cache sections sit above the tabs:| Section | Endpoints | Notes |
|---|---|---|
| Post-Call Cache | POST /api/v1/bots/:id/post-call-cache/{enable|disable|refresh} | Refresh disabled unless an analysis or QC prompt exists |
| Live Prompt Cache | POST /api/v1/bots/:id/live-prompt-cache/{enable|disable|refresh} | Only shown for non-policy bots; refresh requires a static system prompt |
Edit Mode
Edit mode renders the sameStepWizard and step components as the create wizard, driven by the same useBotForm hook (here used with deserialize). The STEPS array and errorToStep mapping mirror BotCreate. Save calls validate(), then PUT /api/v1/bots/:id, refreshing the page data on success.
View Mode: Details Tab
The Details tab composesSectionGroup/Section/ViewField blocks:
| Group | Sections |
|---|---|
| Core Configuration | Voice Stack (STT/LLM/TTS), System Prompt, Opening Message, Conversation Policy (when enabled) |
| Behavior & Runtime | Runtime Config (max duration, re-engagement, VAD, interruption) + re-engagement messages |
| Advanced Features | Tools, Transfer Call, SIP Headers, Analysis Prompts, CRM Pre-fetch, Post-Call Push (each rendered only when present) |
View Mode: Integration Tab
The Integration tab issrc/components/bot/IntegrationTab.tsx — an auto-generated CRM integration guide. It has four sections:
- Quick Start — copy-paste snippets for curl, Python, and Node.js, built by
buildSnippetsand rendered throughCodeSnippet. - Request Reference — the
POST {VITE_API_URL}/api/v1/sip/dialoutendpoint, headers, body field table, this bot’s variables, a sample response, and an error-code table. - Post-Call Webhook — the configured push URL/method/masked token and a sample payload built from the
key_mapper, with the analysis prompt in a collapsible block. - Variable Reference — expandable cards for the
call.*,crm.*,result.*,analysis.*,qc.*, andsystem.*namespaces.
Variable Extraction
extractCallVariables regex-matches {{...}} tokens in system_prompt and opening_message (skipping system.*), defaulting bare tokens to the call namespace. When a Conversation Policy is enabled, it also pulls every *_field value from the policy config as a call.* variable. The snippet builder passes these to the CRM as bare keys (e.g. due_amount, not call.due_amount); CXB API resolves the namespace so {{call.X}} and {{crm.X}} both work from the same payload.
CodeSnippet
components/bot/CodeSnippet.tsx is a tabbed code block: one tab per snippet label, a copy button with a transient “Copied” state, and a <pre> body. It is reused for the Quick Start snippets, the sample response, and the sample webhook payload.
Test Call Modal
components/bot/TestCallModal.tsx initiates a real outbound test call.
| Surface | Behavior |
|---|---|
| Test Via | Choose LiveKit SIP or Exotel Connect (only transports with options appear) |
| Carrier + DID (SIP) | Loads synced carriers with outbound/both DIDs |
| Exotel Number | Loads Exotel test DIDs; blocks if setup incomplete |
| Phone Number (To) | E.164 or STD, validated by regex |
| Test Options (SIP) | Toggles for CRM Pre-fetch and Post-call Push |
| Template Variables | Inputs for each {{...}} var found in the dynamic/system prompt + opening message + policy fields; “Inject mock data” toggle |
connected_event (routing crm namespace vars into a _mock_crm block, setting _skip_prefetch/_skip_post_push flags from the toggles) and calls POST /api/v1/sip/dialout. It then polls GET /api/v1/calls/:id every 2s for up to 2 minutes, showing live status via describeTestCallState. Exotel test calls go to POST /api/v1/integrations/exotel/dids/:id/test-call. Selections (carrier, DID, number, variables) are saved back via PUT /api/v1/bots/:id/test-data for next time.
Related Docs
Create Bot Wizard
The steps edit mode reuses.
Tool Builder
How the tools shown here are built.
Call Detail
Reviewing the test call afterward.
Post-call webhook
Full key_mapper variable reference.