Live and Realtime Analytics
Endpoints
GET /api/analytics/liveGET /api/analytics/live/wsGET /api/analytics/live/stats
Access
- Permission:
analytics:read - Workspace scope is enforced by middleware for all live routes
GET /api/analytics/live
Returns recent live events used for initial UI hydration.
Event types include:
clickqr_scanconversion
campaignName, linkTitle) and summary counts in meta.
GET /api/analytics/live/ws
WebSocket upgrade endpoint for push updates.
Requirements:
Upgrade: websocketheader- authenticated workspace context
426if upgrade headers are missing503if realtime backend binding is unavailable
GET /api/analytics/live/stats
Returns realtime backend status/diagnostics for the current workspace.
Operational notes
- Live routes are excluded from long-TTL snapshot caching.
/liveis for first payload;/live/wsis for incremental updates.- Do not use polling when WebSocket stream is available.

