Reports & Statistics
The call reports and dashboard reports behind the Calls page and the Dashboard: what each returns, server-side paging and sorting of their tables, and how fresh the figures are.
Overview
The Calls page and the Dashboard in the console are built from report endpoints that any API client can call. Most of them share two behaviors:
- Server-side paging and sorting of each table in the report — only when you ask for it (Paging and sorting). Without paging parameters you get the full report, every list complete.
- A short-lived cache per workspace (Freshness).
bashAPI=https://api.arcanflows.com/api/v1 TOKEN=... # access token (console routes) TENANT=... # workspace id PHONE_KEY=... # pbxs_ server key (server routes)
Periods for the call reports (period=, from, to, billing periods, timezone) and the PDF / Excel export are described in the Phone API.
Call reports
Every route exists twice with the same figures: console GET /api/v1/phone<route> (access token + X-Active-Tenant) and server GET /api/v1/public/phone/server<route> (pbxs_ key).
| Route | Returns (top-level keys) | Pageable tables — default sort | Console permission | Server scope |
|---|---|---|---|---|
/stats | period, totals, previous, live, daily, by_extension, internal_pairs, presented, top_outbound, categories, sentiments, since | by_extension, internal_pairs, presented, top_outbound (calls ↓) | phone.read | stats:read |
/stats/service | period, answering, abandonment, handling, callbacks, heatmap, numbers, people, callers, teams, allowance | people (answered ↓), teams (answered ↓), numbers (calls ↓), callers.top (calls ↓), callbacks.open (missed_at ↓) | phone.read | stats:read |
/stats/ivr | period, menus, languages, coverage | menus (callers ↓) — a menu's options and exits always come whole | phone.read | stats:read |
/stats/geo | period, inbound, outbound | inbound.countries, outbound.countries, inbound.places, outbound.places (calls ↓) | phone.read | stats:read |
/stats/teams | period, groups, queues, conferences, time_to_human, series, since, coverage | groups (offered ↓), groups.members (answered ↓, nested), queues (entered ↓) | phone.read | stats:read |
/stats/teams/members | period, groups, skip_reasons, since | groups (name ↑), groups.members (rung ↓, nested) | phone.read | stats:read |
/stats/teams/availability | period, period_s, groups, statuses, now_included | groups (extension ↑), groups.members (extension ↑, nested) | phone.manage | people:read |
/stats/unanswered | period, totals, series, reasons, by_reason, by_number, by_team, members, recent | by_reason, by_number, by_team (unanswered ↓), members (name ↑), members.members (rung ↓, nested), recent (started_at ↓) | phone.read | stats:read |
/stats/status | period, people, statuses, days_included | people (online_s ↓) | phone.manage | people:read |
/stats/people | period, people, logins_since | people (online_s ↓) | phone.manage | people:read |
/stats/people/usage | period, people, not_linked, workspace, attributed_since, usd_visible | people (talk_minutes ↓) | phone.manage | people:read |
/reports/history | reports | reports (created_at ↓) | phone.read | stats:read |
/reports/schedules | schedules | schedules (name ↑) | phone.read | stats:read |
/calls | the call log: calls, total, limit, offset | paged and sorted with its own parameters (below) | phone.read | calls:read |
↓ descending, ↑ ascending. Nested tables are paged per parent row. The four people reports (/stats/status, /stats/people, /stats/people/usage, /stats/teams/availability) are visible to the workspace owner, users with phone.manage and keys with people:read; anyone else gets 403. When you page /stats without an explicit top, its ranked lists are raised to 1,000 rows so the pages cover the whole list.
The call log pages in the database with its own parameters: console GET /phone/calls takes limit (default 50, max 200), offset, sort (started_at default, duration_s, caller, dialed, direction, result, status, agent_name, turns) and dir (desc default, asc); the server list takes limit (1–500, default 100) and offset, newest first. paged and table don't apply there.
Always computed in full, without table paging: /stats/periods, /stats/groups (server only), /reports/calls, /reports/history/{id}, /reports/call-log.csv (console), /calls/export.csv (server), /calls/{id}, and the console's /my-usage, /my-activity, /my-status/time.
Dashboard reports
| Route | Returns | Parameters | Pageable tables | Access |
|---|---|---|---|---|
GET /api/v1/stats/dashboard | overview, agent_stats (first 10), agent_stats_total, model_usage, recent_activity, template_usage, user_consumption | start_date, end_date (RFC 3339; invalid → 400) | — | signed in |
GET /api/v1/stats/agents | agent_stats, total, page, per_page | start_date, end_date, page, per_page (default 10, max 100), sort_by (name, status, total_conversations default, total_messages, total_tokens, avg_response_time_ms, last_used_at, primary_model), sort_order (desc default, asc) | — paged in the database | signed in |
GET /api/v1/stats/hallucination-metrics | overview, agent_metrics, daily_metrics, source_usage, recent_high_risk | start_date, end_date | agent_metrics (high_risk_count ↓) | signed in |
GET /api/v1/workspace/health | components[] — key, name, state (ok / warning / critical), headline, detail, link, numbers | hours (1–720, default 24) | — | analytics.read |
GET /api/v1/billing/usage/people | period (from, to), people[], idle | include_idle=1 | people (tokens ↓) | billing.read |
GET /api/v1/billing/usage/history | token usage per month | months (default 6, max 24) | — | billing.read |
GET /api/v1/billing/usage/daily | daily tokens of a month | year, month | — | billing.read |
GET /api/v1/billing/usage/users | tokens per user, current period | limit (default 20) | — | billing.read |
GET /api/v1/billing/usage/api-keys | current-period usage per provider key | — | — | billing.read |
GET /api/v1/billing/multimodal/usage/daily | daily speech, image and video usage | year, month | — | billing.read |
GET /api/v1/billing/multimodal/usage/users | media usage per user | limit (default 20) | — | billing.read |
GET /api/v1/billing/multimodal/usage/agents | media usage per agent | limit (default 20) | — | billing.read |
start_date / end_date on the three /stats/... routes are rounded down to the whole minute, so a rolling "last 24 hours" window still hits the cache within a minute. PATCH /api/v1/stats/validations/{id}/false-positive refreshes the workspace's dashboard reports after it succeeds.
Usage per person
GET /api/v1/billing/usage/people is the dashboard's People table: every person's usage in the current calendar month (UTC), tokens and media in one row, with no row cap.
bashcurl "$API/billing/usage/people?include_idle=1" -H "Authorization: Bearer $TOKEN" -H "X-Active-Tenant: $TENANT"
json{ "period": { "from": "2026-12-01T00:00:00Z", "to": "2027-01-01T00:00:00Z" }, "people": [ { "user_id": "0a79...", "email": "[email protected]", "name": "Ana López", "tokens": 182340, "conversations": 14, "speech_chars": 5200, "images": 3, "videos": 0, "last_active": "2026-12-01T16:02:11Z" } ], "idle": 35 }
people[]is sorted bytokens, thenspeech_chars, descending. A row with an emptyuser_idholds media produced by automations and the API rather than a person.- People with no usage are counted in
idleand listed only withinclude_idle=1. last_activeis the last token usage in the month (nullwhen none).
Always computed, not paged: /billing/summary, /billing/usage/monthly, /billing/usage/agents, /billing/multimodal/usage and /stats/validations/{id}, among others — see the Endpoint Catalog.
Paging and sorting
Available on every route above that lists pageable tables.
| Parameter | Meaning |
|---|---|
paged=1 | return the whole report with every table cut to page 1 in its default order, plus a tables object describing each |
table=<id> | return one page of one table instead of the report |
sort=<column> | a field of the table's rows ([a-z0-9_]+, optionally one .child); default: the table's default column |
dir=asc|desc | default: the table's default direction — but asc whenever sort is given |
page | 1-based, default 1 |
page_size | default 25, max 200 |
parent=<id> | required for nested tables (groups.members, members.members): the parent row's group_id |
Sorting puts numbers before text, compares text case-insensitively, ranks true above false, and always puts empty values (null, "", missing) last in either direction. Ties keep the report's order. Charts and series (daily, series, heatmap, ...) are never paged.
The whole report, first pages only — paged=1
bashcurl "$API/phone/stats/teams?period=30d&paged=1" \ -H "Authorization: Bearer $TOKEN" -H "X-Active-Tenant: $TENANT"
The report keeps its shape; each table holds its first page, and a tables object is added. Nested tables are cut for the parent rows on that page, keyed <table>:<parent id>:
json{ "period": { "period": "30d", "label": "Last 30 days", "timezone": "America/Chicago" }, "groups": [ { "group_id": "42343e8f-...", "name": "Sales", "offered": 3, "members": [] } ], "queues": [], "series": [], "tables": { "groups": { "table": "groups", "total": 3, "page": 1, "page_size": 25, "pages": 1, "sort": "offered", "dir": "desc" }, "groups.members:42343e8f-0ef9-436e-b8a7-151f654bcd69": { "table": "groups.members", "parent": "42343e8f-0ef9-436e-b8a7-151f654bcd69", "total": 0, "page": 1, "page_size": 25, "pages": 0, "sort": "answered", "dir": "desc" }, "queues": { "table": "queues", "total": 2, "page": 1, "page_size": 25, "pages": 1, "sort": "entered", "dir": "desc" } } }
One page of one table — table=<id>
bashcurl "$API/billing/usage/people?include_idle=1&table=people&sort=name&page=2&page_size=10" \ -H "Authorization: Bearer $TOKEN" -H "X-Active-Tenant: $TENANT"
json{ "table": "people", "total": 36, "page": 2, "page_size": 10, "pages": 4, "sort": "name", "dir": "asc", "rows": [ { "user_id": "...", "name": "Ana López", "email": "[email protected]", "tokens": 0 } ] }
With a server key:
bashcurl "$API/public/phone/server/stats/service?period=last_month&table=people&sort=answered&dir=desc&page_size=50" \ -H "Authorization: Bearer $PHONE_KEY"
For a top-level table that has nested tables, the answer also carries a tables object with the nested tables' page-1 metadata for the rows returned. A nested table needs parent:
bashcurl "$API/phone/stats/teams?period=30d&table=groups.members&parent=$GROUP_ID&sort=answered&dir=desc" \ -H "Authorization: Bearer $TOKEN" -H "X-Active-Tenant: $TENANT"
json{ "table": "groups.members", "parent": "42343e8f-...", "total": 0, "page": 1, "page_size": 25, "pages": 0, "sort": "answered", "dir": "desc", "rows": [] }
A page past the end returns rows: [] with the real total and pages.
Errors (400)
| Request | error |
|---|---|
unknown table | unknown table "nope"; this report has: groups, groups.members, queues |
nested table without parent | table groups.members needs parent=<group_id> |
sort is not a column name | sort must be a column name |
sort names a field no row has | unknown sort column "bogus" for table groups |
dir other than asc / desc | dir must be asc or desc |
If the report itself fails, its error is returned unchanged and no paging is applied.
Freshness
Reports are cached per workspace for GET requests:
| Report | Kept for |
|---|---|
| a period that includes now (or ended less than a minute ago), or no period | 60 seconds |
| a closed period (ended more than a minute ago) | 15 minutes |
/stats/teams/availability | 15 seconds |
the call log /calls (console and server) | 15 seconds |
/reports/history, /reports/schedules | not cached |
- Every page of every table is cut from the same cached report, so paging through a table is consistent and cheap. The paging parameters are not part of the cache key; every other query parameter is. (On the call log and
/stats/agents, which page in the database, every parameter counts.) - A new deployment starts with a fresh cache, so a response never has an outdated shape.
- Only successful (
200) responses are cached. - The cache is per workspace, never per user: the permission check runs before it, and the reports don't depend on who asks.
The X-Stats-Cache response header tells you what happened:
| Value | Meaning |
|---|---|
hit | served from the cache |
miss | computed for this request (and stored if 200) |
| absent | the cache was not used — a never-cached route, a request refused before the report ran, or the cache temporarily unavailable (the report is then computed on every request) |
bashcurl -s -D - -o /dev/null "$API/billing/usage/people" \ -H "Authorization: Bearer $TOKEN" -H "X-Active-Tenant: $TENANT" | grep -i x-stats-cache # x-stats-cache: hit
In practice: polling a report more often than its window returns the same figures, and a call that just ended can take up to 60 seconds to appear in an open period.