Analytics Endpoints
API endpoints for metrics, statistics, and error logs
Analytics Endpoints
Endpoints for retrieving call analytics, performance metrics, and error logs.
Get Analytics Summary
GET /api/v1/analytics/summaryGet aggregated analytics for the current tenant.
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
period | string | Time period: 1h, 24h, 7d, 30d (default: 24h) |
started_after | datetime | Filter calls started after this time |
started_before | datetime | Filter calls started before this time |
Response:
{
"total_calls": 1247,
"completed_calls": 1180,
"failed_calls": 67,
"active_calls": 3,
"avg_duration_seconds": 145.2,
"success_rate": 94.6,
"total_tokens": 125000,
"avg_stt_latency_ms": 120.5,
"avg_llm_latency_ms": 280.3,
"avg_tts_latency_ms": 85.2
}| Field | Description |
|---|---|
total_calls | Total calls in the period |
completed_calls | Successfully completed calls |
failed_calls | Failed calls |
active_calls | Currently active calls |
avg_duration_seconds | Average call duration |
success_rate | Percentage of successful calls |
total_tokens | Total LLM tokens consumed |
avg_stt_latency_ms | Average speech-to-text latency |
avg_llm_latency_ms | Average language model latency |
avg_tts_latency_ms | Average text-to-speech latency |
Get Call Volume
GET /api/v1/analytics/call-volumeGet call volume time series data for charting.
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
period | string | Time period: 1h, 24h, 7d, 30d |
interval | string | Bucket size: hour, day, week (default: hour) |
started_after | datetime | Filter by start time |
started_before | datetime | Filter by end time |
Response:
{
"interval": "hour",
"data": [
{
"timestamp": "2026-01-17T10:00:00Z",
"total": 45,
"completed": 42,
"failed": 3
},
{
"timestamp": "2026-01-17T11:00:00Z",
"total": 52,
"completed": 50,
"failed": 2
}
]
}Get Workflow Stats
GET /api/v1/analytics/workflow-statsGet statistics grouped by workflow.
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
period | string | Time period |
limit | integer | Max workflows to return (default: 10, max: 50) |
started_after | datetime | Filter by start time |
started_before | datetime | Filter by end time |
Response:
[
{
"workflow_id": "uuid",
"workflow_name": "Daily Health Check",
"workflow_slug": "daily-call",
"total_calls": 500,
"completed_calls": 475,
"failed_calls": 25,
"success_rate": 95.0,
"avg_duration_seconds": 180.5
},
{
"workflow_id": "uuid",
"workflow_name": "Onboarding Flow",
"workflow_slug": "onboarding",
"total_calls": 150,
"completed_calls": 142,
"failed_calls": 8,
"success_rate": 94.7,
"avg_duration_seconds": 240.2
}
]Get Provider Latency
GET /api/v1/analytics/provider-latencyGet latency statistics by provider type.
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
period | string | Time period |
started_after | datetime | Filter by start time |
started_before | datetime | Filter by end time |
Response:
[
{
"provider_type": "stt",
"provider_name": "deepgram",
"avg_latency_ms": 120.5,
"p50_latency_ms": 108.4,
"p95_latency_ms": 180.7,
"p99_latency_ms": 241.0,
"call_count": 1247
},
{
"provider_type": "llm",
"provider_name": "openai",
"avg_latency_ms": 280.3,
"p50_latency_ms": 252.2,
"p95_latency_ms": 420.4,
"p99_latency_ms": 560.6,
"call_count": 1247
},
{
"provider_type": "tts",
"provider_name": "cartesia",
"avg_latency_ms": 85.2,
"p50_latency_ms": 76.6,
"p95_latency_ms": 127.8,
"p99_latency_ms": 170.4,
"call_count": 1247
}
]| Field | Description |
|---|---|
provider_type | Type: stt, llm, or tts |
provider_name | Provider name (e.g., deepgram, openai) |
avg_latency_ms | Average latency in milliseconds |
p50_latency_ms | 50th percentile (median) latency |
p95_latency_ms | 95th percentile latency |
p99_latency_ms | 99th percentile latency |
call_count | Number of calls with this provider |
Get Error Logs
GET /api/v1/analytics/errorsGet error logs from calls.
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
period | string | Time period (default: 24h) |
service | string | Filter by service: stt, llm, tts, workflow, tool |
level | string | Filter by level: error, warning |
offset | integer | Pagination offset (default: 0) |
limit | integer | Max records (default: 50, max: 200) |
started_after | datetime | Filter by start time |
started_before | datetime | Filter by end time |
Response:
{
"items": [
{
"id": "call-uuid-0",
"call_id": "uuid",
"timestamp": "2026-01-17T10:30:00Z",
"service": "stt",
"level": "error",
"message": "Connection timeout to Deepgram",
"details": {
"timeout_ms": 5000,
"retry_count": 3
},
"agent": "meal-agent"
},
{
"id": "call-uuid-1",
"call_id": "uuid",
"timestamp": "2026-01-17T10:25:00Z",
"service": "llm",
"level": "error",
"message": "Rate limit exceeded",
"details": {
"provider": "openai",
"retry_after": 60
},
"agent": "greeter-agent"
}
],
"total": 67
}Error Services
| Service | Description |
|---|---|
stt | Speech-to-text provider errors |
llm | Language model provider errors |
tts | Text-to-speech provider errors |
workflow | Workflow execution errors |
tool | Tool execution errors |
Error Levels
| Level | Description |
|---|---|
error | Critical errors that affected call |
warning | Non-critical issues |
Get Active Calls Count
GET /api/v1/analytics/active-callsGet the count of currently active calls. Useful for real-time monitoring dashboards.
Response:
{
"count": 3
}Time Periods
All analytics endpoints support the period parameter:
| Period | Description |
|---|---|
1h | Last hour |
24h | Last 24 hours (default) |
7d | Last 7 days |
30d | Last 30 days |
Alternatively, use started_after and started_before for custom date ranges:
GET /api/v1/analytics/summary?started_after=2026-01-01T00:00:00Z&started_before=2026-01-15T23:59:59ZDashboard Refresh Rates
Recommended refresh intervals for dashboard polling:
| Endpoint | Refresh Rate |
|---|---|
/analytics/summary | 30 seconds |
/analytics/active-calls | 10 seconds |
/analytics/call-volume | 60 seconds |
/analytics/workflow-stats | 60 seconds |
/analytics/provider-latency | 60 seconds |
/analytics/errors | 30 seconds |
For real-time updates, use WebSocket endpoints instead.