Retrieve the workspace KPI summary

View as Markdown
Call totals for the workspace plus the category KPIs of every campaign that recorded KPI data in the window. KPIs are computed per call from the data the agent extracts (see `GET /api/analytics/kpi/templates/{category}`) and are voice-only. - `totalCalls` counts every non-deleted call created in the window (any status, with or without a campaign). - `totalSuccessful` counts those whose outcome is a success outcome for any category (e.g. `sale_closed`, `appointment_booked`, `payment_promised`). - `successRate` is a percentage 0-100 with two decimals. - `categorySummaries` has ONE ENTRY PER CAMPAIGN with KPI rows in the window — two sales campaigns produce two `sales` entries — in no guaranteed order, and without the campaign id. Use `GET /api/analytics/kpi/{campaignId}` for a specific campaign. `breakdown` is always `{}` here. - KPIs whose key ends in `_today` (e.g. `revenue_today`) cover the current UTC day only. **No data.** Numbers are `0`, never `null`: `successRate` is `0` when there were no calls, `avgDuration` is `0` when no duration KPI was recorded, and `categorySummaries` is `[]`. An `avg` KPI with no samples has `value: 0` and `count: 0` — check `count` before reading `value`. **Idempotency.** Read-only; safe to retry. **Consistency.** Cached for 120 seconds per workspace and `days`; the cache is cleared whenever a call's KPIs are processed. Browser cache: `private, max-age=30, stale-while-revalidate=900`. **Access** - **Required scope:** `read`. Signed-in users need the owner, admin, member or viewer role. - **Rate limit:** Analytics — 30 requests/min per workspace, shared with the rest of `/api/analytics/*` (except `/analysis/*`); a KPI request consumes 2 units (the limiter runs in two sibling routers), so effectively 15 requests/min. Also counts against the general API limit. See [Rate limits](/rate-limits). - **Plan:** Available on every plan (behind the `advancedDashboard` feature gate, which is enabled on every plan).

Authentication

AuthorizationBearer
Workspace API key: `jl_` followed by 64 lowercase hex characters, created by the workspace owner in the dashboard (**Settings → API Keys**) and sent as `Authorization: Bearer jl_...`. The plaintext is shown once, at creation; Jelliu stores only a SHA-256 hash. A workspace can hold up to 25 active keys. | Scope | GET / HEAD | POST / PUT / PATCH / DELETE | Admin-only routes | | --- | --- | --- | --- | | `read` | Yes | No | No | | `write` | Yes | Yes | No | | `full` | Yes | Yes | Yes | Operations restricted to admins or owners reject keys without the `full` scope with `403`, and say so in their description. No key, whatever its scope, can mint or revoke API keys or rotate a webhook secret — that requires a signed-in owner session. A revoked key stops authenticating within about 10 seconds. See [Authentication](/authentication).

Query parameters

daysintegerOptional1-365Defaults to 30

Look-back window in days. Never rejected - a non-integer, out-of-range (1-365) or non-numeric value falls back to 30.

Response

KPI summary.
dataobjectOptional

Errors

401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error