API Reference
Retrieve aggregate analytics for an agent over a date range: total messages, conversations, and leads captured. Requires Pro plan or higher.
/api/v1/agents/{id}/analytics
Pro+| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Required | Agent ID (Path) |
| start | string | Start date (YYYY-MM-DD). Required if end is set. | |
| end | string | End date (YYYY-MM-DD). Defaults to current month if omitted. |
json
{
"totalMessages": 1523,
"totalConversations": 412,
"totalLeads": 89,
"period": {
"start": "2026-02-01",
"end": "2026-02-24"
}
}curl -X GET "https://chatspark.io/api/v1/agents/ag_123/analytics?start=2026-02-01&end=2026-02-24" \
-H "Authorization: Bearer cs_live_..."