Retrieve campaign KPIs
The KPIs defined for the campaign’s category (e.g. revenue_total, avg_ticket for sales),
aggregated over the calls of the last days days, plus breakdown: for each distribution KPI
(e.g. best_product), the share of calls per label. Plot one KPI over time with
GET /api/analytics/kpi/{campaignId}/timeseries; see which fields feed each category with
GET /api/analytics/kpi/templates/{category}.
valueis the sum forsumKPIs, the average (two decimals) foravgKPIs, and equalscountforcountKPIs. KPIs ending in_todaycover the current day in your workspace’s timezone (since 2026-09-15; it was the UTC day before).breakdownitems are sorted bycountdescending;percentageis the share (0-100, two decimals) of all labelled calls for that KPI. Distribution labels are the values the agent extracted (Spanish product text).
No data. Every KPI of the category is always listed; with no samples its value and
count are 0 (not null) — read count to tell “nothing measured” from a real zero. A
distribution KPI with no labelled calls has [] in breakdown. An unknown, deleted or other
workspace’s campaign id is NOT a 404: it is reported with category general and zero values.
Idempotency. Read-only; safe to retry.
Consistency. Cached 120 seconds per campaign and days; cleared whenever a call of the
campaign has its KPIs processed.
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/*. Also counts against the general API limit. See Rate limits. - Plan: Available on every plan. Requires an active subscription (
active,trialingorpast_due); without one the request is refused with403 BILLING_ERROR(metadata.kind: subscription_required).
Authentication
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.
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.
Path parameters
UUID of the campaign (see GET /api/campaigns). A non-UUID is a 400; a well-formed id that is
unknown or belongs to another workspace returns zero-valued general KPIs, not a 404.
Query parameters
Look-back window in days. Never rejected - a non-integer, out-of-range (1-365) or non-numeric value falls back to 30.

