Skip to main content
Arcanflows

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).
bash
API=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).

RouteReturns (top-level keys)Pageable tables — default sortConsole permissionServer scope
/statsperiod, totals, previous, live, daily, by_extension, internal_pairs, presented, top_outbound, categories, sentiments, sinceby_extension, internal_pairs, presented, top_outbound (calls ↓)phone.readstats:read
/stats/serviceperiod, answering, abandonment, handling, callbacks, heatmap, numbers, people, callers, teams, allowancepeople (answered ↓), teams (answered ↓), numbers (calls ↓), callers.top (calls ↓), callbacks.open (missed_at ↓)phone.readstats:read
/stats/ivrperiod, menus, languages, coveragemenus (callers ↓) — a menu's options and exits always come wholephone.readstats:read
/stats/geoperiod, inbound, outboundinbound.countries, outbound.countries, inbound.places, outbound.places (calls ↓)phone.readstats:read
/stats/teamsperiod, groups, queues, conferences, time_to_human, series, since, coveragegroups (offered ↓), groups.members (answered ↓, nested), queues (entered ↓)phone.readstats:read
/stats/teams/membersperiod, groups, skip_reasons, sincegroups (name ↑), groups.members (rung ↓, nested)phone.readstats:read
/stats/teams/availabilityperiod, period_s, groups, statuses, now_includedgroups (extension ↑), groups.members (extension ↑, nested)phone.managepeople:read
/stats/unansweredperiod, totals, series, reasons, by_reason, by_number, by_team, members, recentby_reason, by_number, by_team (unanswered ↓), members (name ↑), members.members (rung ↓, nested), recent (started_at ↓)phone.readstats:read
/stats/statusperiod, people, statuses, days_includedpeople (online_s ↓)phone.managepeople:read
/stats/peopleperiod, people, logins_sincepeople (online_s ↓)phone.managepeople:read
/stats/people/usageperiod, people, not_linked, workspace, attributed_since, usd_visiblepeople (talk_minutes ↓)phone.managepeople:read
/reports/historyreportsreports (created_at ↓)phone.readstats:read
/reports/schedulesschedulesschedules (name ↑)phone.readstats:read
/callsthe call log: calls, total, limit, offsetpaged and sorted with its own parameters (below)phone.readcalls: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

RouteReturnsParametersPageable tablesAccess
GET /api/v1/stats/dashboardoverview, agent_stats (first 10), agent_stats_total, model_usage, recent_activity, template_usage, user_consumptionstart_date, end_date (RFC 3339; invalid → 400)—signed in
GET /api/v1/stats/agentsagent_stats, total, page, per_pagestart_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 databasesigned in
GET /api/v1/stats/hallucination-metricsoverview, agent_metrics, daily_metrics, source_usage, recent_high_riskstart_date, end_dateagent_metrics (high_risk_count ↓)signed in
GET /api/v1/workspace/healthcomponents[] — key, name, state (ok / warning / critical), headline, detail, link, numbershours (1–720, default 24)—analytics.read
GET /api/v1/billing/usage/peopleperiod (from, to), people[], idleinclude_idle=1people (tokens ↓)billing.read
GET /api/v1/billing/usage/historytoken usage per monthmonths (default 6, max 24)—billing.read
GET /api/v1/billing/usage/dailydaily tokens of a monthyear, month—billing.read
GET /api/v1/billing/usage/userstokens per user, current periodlimit (default 20)—billing.read
GET /api/v1/billing/usage/api-keyscurrent-period usage per provider key——billing.read
GET /api/v1/billing/multimodal/usage/dailydaily speech, image and video usageyear, month—billing.read
GET /api/v1/billing/multimodal/usage/usersmedia usage per userlimit (default 20)—billing.read
GET /api/v1/billing/multimodal/usage/agentsmedia usage per agentlimit (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.

bash
curl "$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 by tokens, then speech_chars, descending. A row with an empty user_id holds media produced by automations and the API rather than a person.
  • People with no usage are counted in idle and listed only with include_idle=1.
  • last_active is the last token usage in the month (null when 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.

ParameterMeaning
paged=1return 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|descdefault: the table's default direction — but asc whenever sort is given
page1-based, default 1
page_sizedefault 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

bash
curl "$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>

bash
curl "$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:

bash
curl "$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:

bash
curl "$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)

Requesterror
unknown tableunknown table "nope"; this report has: groups, groups.members, queues
nested table without parenttable groups.members needs parent=<group_id>
sort is not a column namesort must be a column name
sort names a field no row hasunknown sort column "bogus" for table groups
dir other than asc / descdir 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:

ReportKept for
a period that includes now (or ended less than a minute ago), or no period60 seconds
a closed period (ended more than a minute ago)15 minutes
/stats/teams/availability15 seconds
the call log /calls (console and server)15 seconds
/reports/history, /reports/schedulesnot 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:

ValueMeaning
hitserved from the cache
misscomputed for this request (and stored if 200)
absentthe 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)
bash
curl -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.