Chatspark
K

API Reference

v1
K

Get Analytics

Retrieve aggregate analytics for an agent over a date range: total messages, conversations, and leads captured. Requires Pro plan or higher.

GET

/api/v1/agents/{id}/analytics

Pro+

Parameters

NameTypeRequiredDescription
idstringRequired

Agent ID (Path)

startstring

Start date (YYYY-MM-DD). Required if end is set.

endstring

End date (YYYY-MM-DD). Defaults to current month if omitted.

Response Schema

json

{
  "totalMessages": 1523,
  "totalConversations": 412,
  "totalLeads": 89,
  "period": {
    "start": "2026-02-01",
    "end": "2026-02-24"
  }
}

Code Examples

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_..."

Previous

List Leads

Next

List Sources