/(dashboard)/analytics and a programmatic weekly-rollup API for around-the-brain digest workflows. Same computeAnalytics() helper backs both; the route runs under withTenantContext so RLS scopes every read.
What the dashboard surfaces
app.vorel.ai/(dashboard)/analytics: five cards over the last 30 days:
Conversation volume
Total conversations + breakdown by channel (whatsapp / voice) + breakdown by status (open /
closed / handoff_pending / etc.). Server-rendered; loads in a Suspense boundary against the
same RLS-scoped tx.
Lead funnel
Conversations started → leads created → leads moved off
new → appointments booked. Four
counters; raw conversion math is up to you.QA score distribution
Average score over the window + a 4-bucket histogram (
0-3 / 4-6 / 7-9 / 10-11 on the
11-criterion rubric). Empty buckets render as zeros so the histogram axis is stable.Tool-call success rate
Top 20 tools by call count, with success rate computed from
messages.tool_payload->>'ok'. Fast surface for “is crm_create_record flapping for this
tenant this week?”Voice-minute trend
Per-day voice-minute consumption, oldest-first, with empty-day zeros so the chart doesn’t gap.
Total minutes summary on top.
/admin/tenants/[id]/analytics) reuse the same computeAnalytics() function with the operator’s tenant pick.
The weekly rollup (digest workflows)
GET /api/v1/analytics/weekly-rollup: JSON body shaped for the weekly-qa-rollup automation template (Monday-09:00 cron, then format, then deliver by email or Slack). Response shape:
created_at >= since. Default since is
7 days before computed_at. Maximum window is 90 days; wider windows return 400 bad_request
to avoid sequential scans across the full messages table.
Authentication + scopes
Public-API analytics endpoints are bearer-token authed:GET /v1/analytics/weekly-rollup:readscope. Per-key rate limit 200 req/min.
vapk_live_<48 hex> API keys issued from /(dashboard)/settings/integrations/api-keys.
The dashboard surface (/(dashboard)/analytics) uses your authenticated dashboard session; no API key required for the in-app view.
Data sources
conversations: channel + status counts.leads: funnel counters (status+created_atfor the window).appointments: appointments booked in the window.qa_evaluations: score + per-criterion breakdown for QA.messages: tool-call success rate viatool_payload->>'ok'; agent-turn count for the rollup; hallucination flags for the digest.billing_events: voice-minute trend (sum ofvoice_minuteevent types per day).
The analytics workbench
Beyond the at-a-glance dashboard cards, Vorel ships an analytics workbench: saveable reports built from a report definition (source, metric, dimensions, filters, visualization, time window), composable dashboards, scheduled CSV / email-summary exports, threshold alerts, read-only share links, and built-in preset rollups. A natural-language composer (the in-product AI rail) turns a plain-English ask into a validated report definition. Power users can also drop into a guarded read-only SQL escape hatch. Every report compiles against a per-source field allow-list and runs under row-level security, so a report can never read past your tenant scope. Custom date ranges, compare-to-previous-period, and CSV export are supported through the workbench and the scheduled-export path.What’s NOT supported today
- Per-conversation drill-down from a chart. Click-through from a histogram bucket to the underlying conversations isn’t wired yet.
- PDF export. CSV and email-summary exports ship; PDF is not a current export format.
- Real-time streaming updates. Surfaces are server-rendered on each request, not live-streaming.
Around-the-brain integration patterns
Theweekly-qa-rollup template (n8n templates) wires
GET /v1/analytics/weekly-rollup → format → email/Slack on a Monday-09:00 cron. Operator imports
the template into n8n, sets the API key + delivery target, and the digest fires automatically.
For custom analytics workflows (per-segment cohorts, per-month trends, per-vertical comparisons),
build against the public API + your own warehouse. Vorel exposes the canonical numbers; your
analytics stack does the rest.
Related docs
- API Reference: endpoint catalog
- Automation: n8n templates, including
weekly-qa-rollup - Guardrails: what hallucination flags mean and how they’re graded
- How it works: QA scoring pipeline