Dashboard Overview
Returns summary KPIs, disposition breakdown, quality metrics, and tool usage for a given date range. All data comes from the pre-aggregated call_stats_daily table, making queries fast even over large date ranges.
Endpoint
| Property | Value |
|---|---|
| Function Name | dashboard-overview |
| HTTP Method | GET |
| Authentication | Supabase JWT (Bearer token) |
Request
Headers
Authorization: Bearer <supabase_jwt_token>
Content-Type: application/json
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
period | string | No | 7d | today, 7d, 30d, 90d, or custom |
start_date | string (ISO date) | If period=custom | -- | Start date YYYY-MM-DD |
end_date | string (ISO date) | If period=custom | -- | End date YYYY-MM-DD |
campaign_id | string (UUID) | No | -- | Filter to a specific campaign |
client_id | string (UUID) | No | -- | Filter to a specific client |
Response
Success (200)
{
"period": {
"start_date": "2026-02-10",
"end_date": "2026-02-16",
"label": "7d"
},
"summary": {
"total_calls": 150,
"completed_calls": 120,
"failed_calls": 5,
"connected_calls": 110,
"contact_rate": 73.3, // % (connected / total)
"conversations_had": 85,
"meetings_booked": 12,
"qualified_leads": 25,
"avg_duration_seconds": 180,
"total_duration_seconds": 21600,
"positive_sentiment_pct": 60.5, // %
"neutral_sentiment_pct": 30.2, // %
"negative_sentiment_pct": 9.3, // %
"overall_conversion_rate": 8.0 // % (meetings / total)
},
"disposition_breakdown": {
"voicemail": 15,
"callback_requested": 8,
"not_interested": 20,
"wrong_number": 3,
"dnc_requested": 1,
"gatekeeper_blocked": 7,
"no_answer": 25,
"conversation": 85,
"appointment_booked": 12
},
"quality": {
"avg_talk_ratio": 0.5500, // 0-1 decimal
"avg_listen_ratio": 0.4500,
"avg_script_adherence": 0.7200, // 0-1 decimal
"total_interruptions": 45,
"avg_interruptions_per_call": 0.38,
"total_objections_encountered": 30,
"total_objections_handled": 18,
"objection_handling_rate": 60.0, // %
"total_buying_signals": 40
},
"tool_usage": {
"emails_sent": 15,
"sms_sent": 5
}
}
Error Responses
| Status | Condition |
|---|---|
| 401 | Missing or invalid authorization header |
| 403 | User exists but has no agency_id |
| 405 | HTTP method is not GET |
| 500 | Failed to query call_stats_daily |
Behavior
- Authenticates the user via Supabase JWT and resolves their
agency_idfrom theuserstable. - Resolves the date range from the
periodparameter (e.g.,7d= last 7 days including today). - Queries
call_stats_dailyfor all rows matching the agency, date range, and optional campaign/client filters. - Aggregates all matching rows into a single summary using sums for count fields and weighted averages (weighted by
completed_calls) for ratio fields (avg_talk_ratio,avg_listen_ratio,avg_script_adherence). - Computes derived rates:
contact_rate(connected/total),overall_conversion_rate(meetings/total), sentiment percentages,avg_interruptions_per_call, andobjection_handling_rate.
Database Tables
| Table | Operation | Description |
|---|---|---|
users | Read | Fetches user profile to determine agency_id |
call_stats_daily | Read | Pre-aggregated daily stats, filtered by agency/date/campaign/client |
External APIs
None.
Related Functions
- Dashboard Timeseries -- Daily trend data for charts
- Dashboard Funnel -- Conversion funnel visualization
- Dashboard Campaigns -- Campaign performance and batch progress
- Dashboard Quality -- Detailed quality analytics with trends
- Dashboard Heatmap -- Best times to call
- Dashboard Objections -- Top objections and buying signals
- Frontend API Guide -- Complete frontend integration reference