Skip to content

Analytics

The Analytics API provides access to messaging statistics, chatbot performance, and dashboard metrics.

Get an overview of key metrics for the dashboard.

Terminal window
GET /api/analytics/dashboard
ParameterTypeDescription
account_idstringFilter by WhatsApp account
periodstringTime period: today, week, month, year
{
"status": "success",
"data": {
"contacts": {
"total": 5000,
"new_today": 25,
"new_this_week": 150,
"growth_percent": 12.5
},
"messages": {
"total": 50000,
"sent": 25000,
"received": 25000,
"today": 500
},
"campaigns": {
"total": 20,
"active": 2,
"completed_this_month": 5
},
"chatbot": {
"conversations_today": 100,
"auto_resolved": 75,
"transferred_to_agent": 25,
"resolution_rate": 75.0
}
}
}

Get detailed messaging statistics.

Terminal window
GET /api/analytics/messages
ParameterTypeDescription
account_idstringFilter by WhatsApp account
start_datestringStart date (ISO 8601)
end_datestringEnd date (ISO 8601)
granularitystringhour, day, week, month
{
"status": "success",
"data": {
"summary": {
"total_sent": 10000,
"total_received": 8000,
"total_delivered": 9800,
"total_read": 7500,
"total_failed": 200,
"delivery_rate": 98.0,
"read_rate": 76.5
},
"by_type": {
"text": 12000,
"image": 3000,
"template": 2500,
"document": 500
},
"timeline": [
{
"date": "2024-01-01",
"sent": 500,
"received": 400,
"delivered": 490,
"read": 350
},
{
"date": "2024-01-02",
"sent": 600,
"received": 450,
"delivered": 590,
"read": 400
}
]
}
}

Get chatbot performance metrics.

Terminal window
GET /api/analytics/chatbot
ParameterTypeDescription
account_idstringFilter by WhatsApp account
start_datestringStart date (ISO 8601)
end_datestringEnd date (ISO 8601)
{
"status": "success",
"data": {
"summary": {
"total_conversations": 1000,
"auto_resolved": 750,
"transferred_to_agent": 200,
"abandoned": 50,
"resolution_rate": 75.0,
"avg_messages_per_conversation": 5.2,
"avg_resolution_time_seconds": 120
},
"by_flow": [
{
"flow_name": "Order Status",
"conversations": 300,
"completion_rate": 85.0
},
{
"flow_name": "FAQ",
"conversations": 200,
"completion_rate": 92.0
}
],
"top_keywords": [
{
"keyword": "order",
"count": 450
},
{
"keyword": "shipping",
"count": 230
},
{
"keyword": "return",
"count": 180
}
],
"ai_usage": {
"total_requests": 500,
"avg_tokens_per_request": 250,
"total_tokens": 125000,
"estimated_cost": 2.50
}
}
}
MetricDescription
delivery_ratePercentage of sent messages that were delivered
read_ratePercentage of delivered messages that were read
MetricDescription
resolution_ratePercentage of conversations resolved without agent
avg_resolution_timeAverage time to resolve a conversation
completion_ratePercentage of started flows that were completed

Analytics data is retained for:

  • Detailed (hourly): 30 days
  • Daily: 1 year
  • Monthly: Indefinitely