C
Chatty

Analytics Summary

GET/api/v1/analytics

Returns aggregated metrics — message counts, session counts, and lead counts — for the bot over a given time range.

Required scope: read

Query parameters

sincestringquery

ISO 8601 datetime string. Only events on or after this timestamp are counted. Defaults to 30 days ago.

Example: 2026-07-01T00:00:00Z

Response

sincestring
The start of the analytics window (ISO 8601).
total_messagesinteger
All messages (user + assistant) in the period.
total_sessionsinteger
Unique conversation sessions started.
total_leadsinteger
Leads captured by the bot.

Examples

Last 30 days (default)
curl "https://api.personaliai.com/api/v1/analytics" \
  -H "Authorization: Bearer chatty_sk_your_key"
Since July 1
curl "https://api.personaliai.com/api/v1/analytics?since=2026-07-01T00:00:00Z" \
  -H "Authorization: Bearer chatty_sk_your_key"

200 OK:

{
  "since": "2026-06-07T00:00:00Z",
  "total_messages": 4821,
  "total_sessions": 962,
  "total_leads": 147
}

Notes

  • Counts update in near real-time (typically within a few seconds of each event).
  • For daily or hourly breakdowns, use the Usage Stats endpoint which provides per-day granularity.