Skip to content

Sidechat

← Back to API Reference

The Sidechat endpoint powers the AI assistant panel in the dashboard. It understands the current page context (which agent or call the user is viewing) and can take actions like creating agents, updating prompts, or explaining call traces.


POST /api/sidechat

Send a message to the dashboard assistant.

Request:

json
{
  "messages": [
    { "role": "user", "content": "Create a support agent for a SaaS company" },
    { "role": "assistant", "content": "I'll create that agent now." },
    { "role": "user", "content": "Give it a friendly tone" }
  ],
  "page_context": {
    "page": "agents",
    "agent_id": "uuid"
  }
}
FieldRequiredDescription
messagesYesFull conversation history. Array of { "role": "user" | "assistant", "content": string }. Always include prior turns for context.
page_contextNoCurrent dashboard state — helps the assistant understand what the user is looking at

Response:

json
{
  "reply": "I've created the support agent with a friendly, conversational tone. You can find it in the Agents list.",
  "actions": [
    {
      "tool": "create_agent",
      "args_summary": "name=support-agent, tone=friendly",
      "result_summary": "Agent created successfully",
      "success": true
    }
  ]
}
FieldDescription
replyThe assistant's response text to show to the user
actionsPlatform actions the assistant took during the response. Empty array if it only answered a question.