Skip to content

Customer Dashboard — Monitor ​

The Monitor group is the observability and compliance surface: Analytics, Logs, History, Notifications, Do Not Disturb, and the three Activity-Monitor tabs Agent Performance, Order Performance, and Payment. It answers "how are calls/campaigns doing, what did my tools do, and who is working?"

Screenshots ​

Monitor — analyticsMonitor — logsMonitor — historyMonitor — notificationsMonitor — do not disturbMonitor — agent performanceMonitor — order performanceMonitor — payment

Architecture Overview ​

How It Works (Step-by-Step) ​

  1. Analytics (/analytics). Call volume + performance metrics (Success rate, Total Contacts, Answered, Failed, Avg Duration, Billed Minutes, Inbound Calls, Daily Call Volume, Call Distribution) with date / campaign / agent / direction filters (confirmed Montior/1.png). Campaign reports come from campaignAnalytics.routes.ts (generate-report available to all campaign users; full data gated by admin_analytics). Deep token analysis is admin_analytics-only (tokenAnalytics.routes.ts).
  2. Logs (/logs). Execution logs for Client Tools and Webhooks — GET /dynamic-tool-logs and the webhook delivery logs. Gated by webhooks / dynamic_tools + tools resource. Backed by DynamicToolLog / ApiActionLog / WebhookDeliveryLog.
  3. History (/history). Full call history (includes test calls) via contact.routes.ts, scoped so a team member sees only their own calls. Gated by voice_campaign + contacts resource.
  4. Notifications (/notifications). The in-app bell + notifications centre: list, unread count, mark read/all, archive. Private to the recipient (scoped to req.userUID). Gated by crm_leads + notifications resource. Backed by CrmNotification.
  5. Do Not Disturb (/dnd-contacts). The opt-out/blocklist: list + add + edit + delete manual entries (ownership + source enforced server-side). Gated by dnd_list. Backed by DndContact. See DND Contact List.
  6. Activity Monitor (Agent/Order/Payment). crmMonitor.routes.ts splits into three independently-grantable tabs:
    • Members / Agent Performance → monitor.activity.members only (needs commerce scope but NOT the commerce feature) — a pure team-activity view.
    • Order Performance → monitor.activity.orders + commerce view (reads commerce data).
    • Payment → monitor.activity.payments + commerce view.
    • The legacy monitor.activity key still grants all three (OR logic). Scope decides breadth: an owner/manager sees the whole team; a team member sees only themselves.

File Reference ​

FileRoleKey Functions
routes/campaignAnalytics.routes.tsCampaign report + analysisgenerateCampaignReport, generateCampaignAnalysis
routes/tokenAnalytics.routes.tsToken usage (admin_analytics)getCampaignTokens, exportTokenUsageCsv
routes/crmMonitor.routes.tsActivity Monitor tabsgetMonitorMembers, getMonitorOrders, getMonitorPayments
routes/crmNotification.routes.tsNotifications centrelistNotifications, getUnreadCount
routes/dndContact.routes.tsDND / opt-out listlistDndContacts, addDndContact
routes/dynamic-tool.routes.tsTool execution logslistToolLogs
routes/contact.routes.tsCall historylistContacts

Data Model ​

CollectionWhy it existsKey fields
CampaignReport / CampaignAnalysisCampaign outcome rollups + AI analysismetrics, tokens
CrmNotificationPer-user in-app notificationsuserUID, read, type
DndContactOpt-out / blocklist entriesphone, source, reason
DynamicToolLog / ApiActionLogTool/API call execution logsrequest, response, status
CrmOrder / CrmTransactionSource for Order/Payment performance tabstotal, assignedToUID

API Endpoints ​

Campaign report / analysis ​

  • POST /api/v2/campaigns/:campaignUID/generate-report (analytics view + voice_campaign), POST .../generate-analysis (admin_analytics).

Token analytics (admin_analytics) ​

  • GET /api/v1/token-analytics/campaign/:campaignUID, /timeline, /contact/:contactUID.

Notifications ​

  • GET /api/notifications, GET /api/notifications/unread-count, PATCH /api/notifications/:id/read, PATCH /api/notifications/read-all, PATCH /api/notifications/:id/archive.
  • Auth: verifyJwt → requireFeatureAccess(leads) → requirePermission("notifications","view") → resolveCrmLeadScope.

DND ​

  • GET/POST /dnd-contacts, PATCH/DELETE /dnd-contacts/:id · Auth: verifyJwt → requireFeatureAccess(dnd_list).

Activity Monitor ​

  • GET /api/monitor/members[/:memberUID] (members tab), GET /api/monitor/orders, GET /api/monitor/payments.
  • Auth: verifyJwt → requireFeatureAccess("monitor.activity", "monitor.activity.<tab>") → resolveCommerceScope (+ commerce view for orders/payments).

External Integrations ​

  • Agent/Analysis backends push call status, analysis, transcription, and metrics via internal webhooks (webhook.routes.ts, x-api-secret), which feed the Analytics/History/Logs views.
  • CSV export — token usage and reports can export to CSV.

How to Test (End-to-End) ​

  1. Run a campaign, then open Analytics; confirm success rate and volume charts populate for the date range.
  2. Generate a campaign report; with admin_analytics off, confirm full analysis is blurred/withheld.
  3. Fire a Client Tool / webhook, then open Logs; confirm the execution appears.
  4. Trigger a notification (e.g. lead assignment) → confirm the bell unread count and the Notifications list update.
  5. Add a number to Do Not Disturb; confirm it is skipped on the next campaign.
  6. Grant only monitor.activity.members; confirm a non-commerce customer sees Agent Performance but not Order/Payment.

Troubleshooting ​

SymptomCauseFix
Analytics emptyNo calls in range, or wrong filtersAdjust the date/campaign/agent filters
Full campaign analysis withheldadmin_analytics offGrant Admin Analytics
Order/Payment tabs hiddencommerce module offGrant Commerce (+ the tab's feature)
Agent Performance hidden for non-commerce customermonitor.activity.members not grantedGrant the Members tab key
Notifications emptyNone addressed to this user, or crm_leads offNotifications are per-user; grant Leads

Last updated: