SITEMAP / DOCS / API REFERENCE

Reporting API

Two endpoints powering the Pipeline → Reporting dashboard. Both require auth + workspace context. Both degrade gracefully. Summary returns zero values on error, and recent-reasoning returns synthetic entries when Supabase isn't configured or the real log is empty.

01Summary

GET /v1/reporting/summary
Authorization: Bearer <token>

Returns the workspace's current KPI snapshot. Cached per-workspace for 30 seconds. Cache invalidates automatically on Customer / Opportunity / Touchpoint mutations.

{
  "activeSignals": 14,
  "pipelineArr": 420000,
  "openTasks": 12,
  "avgConfidence": 78,
  "signalsLast24h": 204,
  "signalsPrev24h": 187,
  "signalsHourly": [3, 5, 8, 12, 9, 7, 11, 14, 18, 22, 19, 15, 21, 24, 20, 17, 19, 16, 13, 10, 8, 6, 4, 2],
  "arrTargetCents": 5000000,
  "criticalCount": 3,
  "criticalCapacity": 8,
  "agentsTotal": 4,
  "agentsHealthy": 4,
  "uptimePct": 99.94,
  "confidencePptDelta": 1.2
}

Field reference

FieldUnitsSource
activeSignalscountCustomer nodes with signal_type in last 7 days
pipelineArrinteger (your base currency, no cents)Sum of amount / arr / estimatedValue on open Opportunities
openTaskscountOpen Opportunity nodes (stage not won/lost/closed)
avgConfidence0–100Mean of waypath_confidence / icp_match_score; falls back to relationship confidence
signalsLast24h · signalsPrev24hcountTouchpoint events in [now-24h, now) and [now-48h, now-24h)
signalsHourly24 × countOldest → newest; hourly buckets of the last 24h
arrTargetCentscentsDefault $50,000 until a workspace-configurable setting ships
criticalCount · criticalCapacitycount / capacityhyper_signal or signal_strength >= 0.75; capacity = 8
agentsHealthy / agentsTotalcountBuddy registry (4 specialists). All healthy in v1
uptimePct0–100Workspace-level proxy until real ingest telemetry feeds this
confidencePptDeltapptSynthesized delta from current avgConfidence

On error the endpoint returns a zero-filled response rather than 500.

02Recent reasoning

GET /v1/reporting/recent-reasoning?limit=25
Authorization: Bearer <token>

Returns the most recent assistant turns across all buddies in the workspace. limit is clamped to 1–100 (default 25).

{
  "entries": [
    {
      "id": "msg_abc",
      "sessionId": "sess_xyz",
      "ts": 1729612340000,
      "buddyId": "insights",
      "text": "Detected hyper-signal on Acme Corp. New VP Marketing hired + Series B closed + competitor tool adopted"
    }
  ]
}

Entries are ordered oldest-first (newest at the bottom, so the UI can give the last entry a blinking cursor).

Synthetic fallback

When Supabase isn't configured or the real agent_messages table is empty for this workspace, the endpoint builds synthetic entries from:

This keeps a fresh demo workspace's Reporting surface populated without manual seeding. When real chat history lands, it takes over automatically.

Content truncation

Each entry's text is truncated server-side to 240 chars with an ellipsis. Unknown buddy_id values default to insights.