Analytics Summary
GET
/api/v1/analyticsReturns aggregated metrics — message counts, session counts, lead counts, and knowledge base size — for the bot.
Required scope: read
Query parameters
sincestringqueryISO 8601 datetime string. Only messages/leads on or after this timestamp are counted. Omit it (or pass nothing) for lifetime totals — there's no default 30-day window.
Example: 2026-07-01T00:00:00Z
Response
bot_idstringThe bot this summary is for.
sincestringEchoes back the
since filter you passed, or null if omitted.total_messagesintegerAll messages (user + assistant) in the period.
user_messagesintegerMessages sent by visitors.
bot_messagesintegerMessages sent by the assistant.
unique_sessionsintegerDistinct conversation sessions in the period.
total_leadsintegerLeads captured by the bot in the period.
knowledge_sourcesintegerTotal knowledge sources currently attached to the bot (not filtered by
since).knowledge_kbintegerTotal size of the knowledge base, in kilobytes (not filtered by
since).Examples
curl "https://api.chatty.personaliai.com/api/v1/analytics" \
-H "Authorization: Bearer chatty_sk_your_key"curl "https://api.chatty.personaliai.com/api/v1/analytics?since=2026-07-01T00:00:00Z" \
-H "Authorization: Bearer chatty_sk_your_key"200 OK:
{
"bot_id": "a1b2c3d4-...",
"since": "2026-07-01T00:00:00Z",
"total_messages": 4821,
"user_messages": 2410,
"bot_messages": 2411,
"unique_sessions": 962,
"total_leads": 147,
"knowledge_sources": 12,
"knowledge_kb": 340
}Notes
- Counts reflect the database at request time — there's no caching delay.
- There's no separate per-day/hourly breakdown endpoint — call this repeatedly with different
sincevalues if you need a time series.