API reference
Call analytics
Call volume and latency over a time range, per project or assistant.
Get call latency
GET/api/analytics/latency
End-to-end response latency (p50 and p95, in milliseconds) and per-stage percentiles over the window, with the slowest calls. Percentiles are null when there are no measured calls. The body is not wrapped in data.
Secret API key. How it works
Query parameters
project_idstringOnly this project's calls (an org-wide key covers every project by default).
assistant_idarray of stringOnly these assistants' calls. Repeat the parameter or comma-separate the values; a row matching any of them is kept.
fromstringISO 8601 timestampStart of the window, ISO 8601 with an offset. Default: 30 days before
to.tostringISO 8601 timestampEnd of the window. Default: now.
Returns
200 OK
Response attributes
e2eAnalyticsPercentilesrequired2 attributes
p50number | nullrequiredp95number | nullrequired
stagesarray of objectrequired3 attributes
p50number | nullrequiredp95number | nullrequiredstagestringrequired
slowestarray of objectrequiredup to 10 items4 attributes
call_idstringrequirede2e_p95numberrequiredassistant_idstringrequiredstarted_atstring | nullrequiredISO 8601 timestamp
- 400
invalid_range:fromortois not a valid timestamp, orfromis not beforeto - 401 Missing, malformed, unknown or revoked API key (
unauthorized) - 403 Refused, for example a read-only key on a write (
read_only_key), a role too low for the route (insufficient_role), or a route that needs a console session - 429 Rate limit exceeded (
rate_limited). WaitRetry-Afterseconds. Budgets are per 60-second window: developer API 120 per key and 600 per organization; public chat 30 per IP address, except polling for updates (60 per conversation and IP address) and analytics events (120 per IP address).
curl "https://api.myleadsfactory.tech/api/analytics/latency" \
-H "Authorization: Bearer $MLF_API_KEY"{
"e2e": {
"p50": 1,
"p95": 1
},
"stages": [
{
"p50": 1,
"p95": 1,
"stage": "string"
}
],
"slowest": [
{
"call_id": "call_5f0c2a9e7b1d4c3e8a6f0b2d4c6e8a1f",
"e2e_p95": 1,
"assistant_id": "asst_5f0c2a9e7b1d4c3e8a6f0b2d4c6e8a1f",
"started_at": "2026-10-28T09:30:00.000Z"
}
]
}Get call volume
GET/api/analytics/volume
Call counts and minutes over the window: totals, by status, by call type, by why calls ended, and per day. The window defaults to the last 30 days. The body is not wrapped in data.
Secret API key. How it works
Query parameters
project_idstringOnly this project's calls (an org-wide key covers every project by default).
assistant_idarray of stringOnly these assistants' calls. Repeat the parameter or comma-separate the values; a row matching any of them is kept.
fromstringISO 8601 timestampStart of the window, ISO 8601 with an offset. Default: 30 days before
to.tostringISO 8601 timestampEnd of the window. Default: now.
Returns
200 OK
Response attributes
total_callsintegerrequiredtotal_minutesnumberrequiredcompletedintegerrequiredfailedintegerrequiredby_statusarray of objectrequired2 attributes
countintegerrequiredstatusstringrequired
by_call_typearray of objectrequired2 attributes
countintegerrequiredcall_typestringrequired
by_canonical_ended_reasonarray of objectrequired2 attributes
countintegerrequiredended_reasonstringrequired
dailyarray of objectrequired3 attributes
datestringrequireddatecallsintegerrequiredminutesnumberrequired
- 400
invalid_range:fromortois not a valid timestamp, orfromis not beforeto - 401 Missing, malformed, unknown or revoked API key (
unauthorized) - 403 Refused, for example a read-only key on a write (
read_only_key), a role too low for the route (insufficient_role), or a route that needs a console session - 429 Rate limit exceeded (
rate_limited). WaitRetry-Afterseconds. Budgets are per 60-second window: developer API 120 per key and 600 per organization; public chat 30 per IP address, except polling for updates (60 per conversation and IP address) and analytics events (120 per IP address).
curl "https://api.myleadsfactory.tech/api/analytics/volume" \
-H "Authorization: Bearer $MLF_API_KEY"{
"total_calls": 1,
"total_minutes": 1,
"completed": 1,
"failed": 1,
"by_status": [
{
"count": 1,
"status": "string"
}
],
"by_call_type": [
{
"count": 1,
"call_type": "string"
}
],
"by_canonical_ended_reason": [
{
"count": 1,
"ended_reason": "string"
}
],
"daily": [
{
"date": "2026-10-28",
"calls": 1,
"minutes": 1
}
]
}