Skip to main content

Report

Reports represent the various reports generated by the system.

📄️ Get KPIs

Build a tabular KPI report. `version: 2` (CLI: `--version 2`) is required because it selects the current table response; the published request schema does not expose the legacy shape. Use `/report/time` instead to chart one KPI over time. Report permissions apply to every requested KPI, and results are limited to teams the caller may view. A caller whose highest `stats:list` scope is `self` gets only their own numbers: `filter.teams` is ignored, `filter.users` is replaced with the caller, and a `filter.users` list that leaves out the caller is refused.

📄️ List the records behind a KPI

List the records one /report/kpi value counts, with who each was credited to and why. Use it to explain a number from `terros report kpi`: pass one KPI `value` as `kpi` (CLI: `--kpi`), the same `filter`, `grouping`, and `searchByCurrentStatus`, and the row's key as `groupKey` (for a user grouping, the user ID). It applies the same permissions, team limits, and filters as /report/kpi, so for count KPIs `total` equals the KPI value. `records` lists only what you could already list: an account you can view through /account/list, a task you can list through /task/list, and recordings only for Terros users, as /recording/list allows. The rest are counted in `withheld`. So a caller with narrow list permissions, such as a rep with `self` account access, does not see an account that was credited to them but has since been reassigned. An admin, or anyone whose account:list covers the accounts, gets the full record set with nothing withheld.

📄️ Get KPI over time

Returns one KPI by calendar interval (in the caller's timezone) and group, with interval, group, and overall totals. Use it for trend charts of a single metric; use /report/kpi instead for many KPIs in one table without a time breakdown. Pick the KPI from /report/column. Requires report permissions for the KPI, and results are limited to the teams the caller can view. A caller whose highest `stats:list` scope is `self` gets only their own numbers, under the same filter rules as /report/kpi.