Dashboard Summary
GET /api/analytics/dashboard
Returns an account-wide summary — totals across all your agents. This is the same snapshot shown at the top of the BotSmith dashboard.
200 OK):
integer
Total number of conversations started across all your agents.
integer
Total number of messages (user + assistant) exchanged across all your agents.
integer
Number of agents currently set to
"active" status.integer
Total number of agents in your account, regardless of status.
integer
Total number of leads captured by your agents’ widget lead forms.
Per-Agent Analytics
GET /api/analytics/chatbot/{chatbot_id}
Returns conversation and message counts broken down by day for a specific agent. Use the days query parameter to control the time window.
string
required
The unique ID of the agent to retrieve analytics for.
integer
Number of days to look back from today. Defaults to
30. Accepted range: 1–365.200 OK):
integer
Total conversations in the requested date range.
integer
Total messages (user + assistant) in the requested date range.
array
Ordered array of ISO 8601 date strings (
YYYY-MM-DD) covering the requested window.object
Map of
date → conversation count for each day in the range. Days with no activity are included with a count of 0.object
Map of
date → message count for each day in the range. Days with no activity are included with a count of 0.Account-Level Trends
GET /api/analytics/trends
Returns aggregated daily conversation and message counts across all your agents for the requested period. Also includes the average AI response time. Use this endpoint to power time-series charts in your own dashboards.
integer
Number of days to look back from today. Defaults to
30. Accepted range: 1–365.200 OK):
array
Array of objects, one per day, each with a
date label (formatted "Mon DD") and a count of new conversations.array
Array of objects, one per day, each with a
date label and a count of total messages across all agents.string
Average time between a user message and the agent’s reply for the period. Formatted as a human-readable string:
"450ms", "1s", "2m 15s", etc. Returns "0s" if there are no conversations in the period.If you have no agents yet, the trends endpoint returns empty arrays for
conversations and messages and an avg_response_time of "0s".