Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vorel.ai/llms.txt

Use this file to discover all available pages before exploring further.

Vorel ships a per-tenant analytics dashboard at /(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.
The dashboard requires the user’s Clerk session to resolve a tenant. Cross-tenant operator views (/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 n8n template (Monday-09:00 cron → format → SendGrid / Slack). Response shape:
{
  "since": "2026-04-29T00:00:00.000Z",
  "computed_at": "2026-05-06T09:00:00.123Z",
  "qa_avg": 7.4,
  "qa_p50": 8.0,
  "qa_p95": 11.0,
  "conversation_count": 142,
  "agent_turn_count": 1031,
  "hallucination_flag_count": 7,
  "top_flag_kinds": [
    { "kind": "fabricated_offering", "count": 3 },
    { "kind": "wrong_price", "count": 2 }
  ],
  "top_handoff_reasons": [
    { "kind": "explicit_request", "count": 12 },
    { "kind": "complaint", "count": 4 }
  ]
}
Window contract: every metric in the response is 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-rollupread scope. Per-key rate limit 200 req/min.
Authed via vapk_live_<48 hex> API keys issued from /(dashboard)/settings/integrations/api-keys. The dashboard surface (/(dashboard)/analytics) is Clerk-authed (your dashboard session) — no API key required for the in-app view.

Data sources

  • conversations — channel + status counts.
  • leads — funnel counters (status + created_at for the window).
  • appointments — appointments booked in the window.
  • qa_evaluations — score + per-criterion breakdown for QA.
  • messages — tool-call success rate via tool_payload->>'ok'; agent-turn count for the rollup; hallucination flags for the digest.
  • billing_events — voice-minute trend (sum of voice_minute event types per day).
All reads use the RLS-scoped tx, so a tenant only ever sees their own data.

What’s NOT supported today

  • A real chart library on the dashboard. The voice-minute trend is rendered as a sparkline- style mini-chart; deeper drill-downs (per-day filter, multi-metric overlays) require a real chart library that Vorel doesn’t ship today.
  • Custom date ranges on the dashboard. Fixed 30-day window today; a custom date-range picker is a roadmap item.
  • Per-conversation drill-down from a chart. Click-through from a histogram bucket to the underlying conversations isn’t wired yet.
  • CSV / PDF export from the dashboard. Use the public API endpoints + your own ETL.
  • Real-time updates. The dashboard is server-rendered on each request, not streaming.

Around-the-brain integration patterns

The weekly-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.