Org (Admin) Dashboard — Sections & APIs
Section-by-section reference for every Org (Admin) menu item: its route, the backend API it calls (method + path), the controller/service behind it, and the MongoDB collection(s) it writes.
No screenshots exist for this dashboard. Menu order and item names come from
app/src/layouts/AdminLayout.tsx; routes from the/admin/*group inapp/src/routes.tsx. UI-layout claims not confirmable from code are tagged> ⚠️ Unverified. See the Org overview for role gating.
Architecture Overview
All admin APIs mounted from admin.routes.ts share one guard: router.use(verifyJwt, requireRole("admin"), requireOrg). Paths below are shown with their mount prefix (/admin for admin.routes.ts, /admin/provisioning for provisioning, /api/org-config for the config replica).
1. Dashboard — /admin/dashboard
Landing KPI view. Page: pages/admin/DashboardPage.tsx. It aggregates existing admin reads (customers, credit summary); it has no dedicated write.
- Customer count / listing →
GET /admin/customers(listCustomers) - Org credit summary →
GET /admin/credit-summary(getOrgCreditSummary)
⚠️ Unverified — the exact KPI cards rendered on the landing page are not confirmable from code alone.
2. Customers — /admin/customers
Create, list, edit customers; reset passwords; review KYC; manage per-customer credits and pricing. Controllers: admin.controller.ts, kyc.controller.ts, credit.controller.ts, servicePricing.controller.ts, deletion.controller.ts, emailAuth.controller.ts.
| Action | Method + Path | Handler | Collection(s) written |
|---|---|---|---|
| Create customer | POST /admin/customers | createCustomer | User |
| List customers | GET /admin/customers | listCustomers | — (read) |
| Get customer | GET /admin/customers/:customerId | getCustomer | — (read) |
| Update customer | PUT /admin/customers/:customerId | updateCustomer | User |
| Reset password | PUT /admin/customers/:customerId/reset-password | resetCustomerPassword | User |
| Delete customer | POST /admin/customers/:customerUID/delete | deleteCustomer | User (+ cascades) |
| Resend onboarding | POST /admin/resend-onboarding/:userUID | adminResendOnboarding | EmailToken |
| Get KYC | GET /admin/customers/:customerId/kyc | getCustomerKyc | — (read) |
| Review KYC | PUT /admin/customers/:customerId/kyc/review | reviewCustomerKyc | Kyc |
| Grant KYC grace | PUT /admin/customers/:customerId/kyc/grace | grantCustomerKycGrace | Kyc |
| Update KYC | PUT /admin/customers/:customerId/kyc | updateCustomerKyc | Kyc |
| Per-customer service pricing | PUT /admin/customers/:customerUID/service-pricing/:presetId | upsertCustomerServicePricing | ServicePricing |
| Remove service pricing | DELETE /admin/customers/:customerUID/service-pricing/:presetId | deleteCustomerServicePricing | ServicePricing |
3. Tickets — /admin/tickets (entitlement TICKETING)
Org-wide helpdesk view. Page: pages/admin/TicketsPage.tsx. Uses the shared ticket API (ticket.routes.ts, mounted at /), with four layers of checks (verifyJwt → requireFeatureAccess → resolveTicketScope → requireTicketPermission).
- List tickets →
GET /api/tickets(listTickets) — readsTicket - Ticket stats →
GET /api/tickets/stats(getTicketStats) - Ticket detail →
GET /api/tickets/:id(getTicketById) — readsTicket,TicketMessage,TicketEvent
See Customer → Tickets for the full ticket data model.
4. Call Feedback — /admin/feedback
Post-call feedback list + stats. Controller: admin.controller.ts.
- Feedback list →
GET /admin/feedback(getFeedbackList) - Feedback stats →
GET /admin/feedback/stats(getFeedbackStats) - Stream a recording (org access) →
GET /admin/recording/:contactUID(adminStreamRecording)
Reads live-call feedback aggregated from the
Contact/ call records; this view does not write new collections.
5. User Insights — /admin/user-insights (entitlement ADMIN_ANALYTICS)
Aggregates Contact data by unique phone number across all campaigns/agents in the org. Route file: userInsight.routes.ts (gated by FEATURE_MAP.tokenAnalytics). Controller: userInsight.controller.ts.
| Action | Method + Path | Handler |
|---|---|---|
| List unique users | GET /api/v1/user-insights/users | listUniqueUsers |
| User's calls | GET /api/v1/user-insights/users/:phone/calls | getUserCalls |
| User report | GET /api/v1/user-insights/users/:phone/report | getUserReport |
Read-only over the Contact collection. See User Insight Dashboard.
6. Config Management — /admin/config
Org's own pricing/preset overrides on top of the superadmin default config — the config replica. Route file: orgConfigReplica.routes.ts (mounted at /api/org-config). Controller: orgConfigReplica.controller.ts.
| Action | Method + Path | Handler | Collection(s) |
|---|---|---|---|
| Get merged replica | GET /api/org-config/replica | getOrgConfigReplica | OrgConfigReplica (read) |
| Set preset rate | PUT /api/org-config/replica/presets/:presetId/rate | updatePresetRate | OrgConfigReplica |
| Toggle preset visibility | PUT /api/org-config/replica/presets/:presetId/visibility | updatePresetVisibility | OrgConfigReplica |
| Batch save overrides | PUT /api/org-config/replica/presets/batch | batchUpdatePresets | OrgConfigReplica |
| Addon rates (recording/transcription/analysis) | GET/PUT /api/org-config/replica/addon-rates | getAddonRates / updateAddonRates | OrgConfigReplica |
| Per-customer addon rates | GET/PUT/DELETE /api/org-config/replica/addon-rates/customers/:customerUID | getCustomerAddonRates / upsertCustomerAddonRates / deleteCustomerAddonRates | CustomerAddonPricing |
| Platform fee | GET/PUT /api/org-config/replica/platform-fee | getPlatformFee / updatePlatformFee | OrgConfigReplica |
| P2P fee | GET/PUT /api/org-config/replica/p2p-fee | getP2pFee / updateP2pFee | OrgConfigReplica |
| Per-customer fees | GET/PUT/DELETE /api/org-config/replica/fees/customers/:customerUID | getCustomerFees / upsertCustomerFees / deleteCustomerFees | CustomerFeePricing |
This is the admin side; the superadmin sets the per-org baseline via the same router's
/replica/:orgUID/*endpoints (see Superadmin Dashboard, Per-Org Rates). See Call Fee Model and Service Pricing.
7. Signup Config — /admin/signup-config
Self-serve signup defaults (plan, form fields). Controller: admin.controller.ts.
- Get signup config →
GET /admin/signup-config(getSignupConfig) — readsOrganization - Update signup config →
PUT /admin/signup-config(updateSignupConfig) — writesOrganization
8. Lead Field Templates — /admin/lead-field-templates
Industry-specific lead-field + system-column + lead-journey templates, auto-seeded to the org's customers. Controllers: orgIndustryTemplate.controller.ts, orgSystemColumn.controller.ts, orgLeadJourneyTemplate.controller.ts.
| Action | Method + Path | Handler |
|---|---|---|
| Get industry templates | GET /admin/industry-templates | getIndustryTemplates |
| Update industry templates | PUT /admin/industry-templates | updateIndustryTemplates |
| Get/update system columns | GET/PUT /admin/system-columns | getSystemColumns / updateSystemColumns |
| Add org system column | POST /admin/system-columns/add | addSystemColumn |
| Edit/remove addition | PUT/DELETE /admin/system-columns/addition/:fieldKey | editSystemColumn / removeSystemColumn |
| Lead-journey templates | GET/PUT /admin/lead-journey-templates | getLeadJourneyTemplates / updateLeadJourneyTemplates |
| Seed a journey template | POST /admin/lead-journey-templates/seed | seedLeadJourneyTemplate |
Writes org-level template data on the Organization / CRM template collections; a PUT propagates the change to each customer's own field/column set.
9. Analysis Schemas — /admin/analysis-schemas
Per-industry call-analysis schema definitions the org builds; they flow to customers of that industry. Controller: orgAnalysisSchema.controller.ts.
| Action | Method + Path | Handler | Collection |
|---|---|---|---|
| List schemas | GET /admin/analysis-schemas | listOrgAnalysisSchemas | AnalysisSchema (read) |
| Create schema | POST /admin/analysis-schemas | createOrgAnalysisSchema | AnalysisSchema |
| Seed from templates | POST /admin/analysis-schemas/seed-from-templates | seedOrgAnalysisSchemasFromTemplates | AnalysisSchema |
| Set industry default | PUT /admin/analysis-schemas/defaults | setOrgIndustryDefault | AnalysisSchema |
| Update schema | PUT /admin/analysis-schemas/:id | updateOrgAnalysisSchema | AnalysisSchema |
| Delete schema | DELETE /admin/analysis-schemas/:id | deleteOrgAnalysisSchema | AnalysisSchema |
10. Credits — /admin/credits
Distribute/revoke credits to customers and view the org's credit ledger. Controller: credit.controller.ts.
| Action | Method + Path | Handler | Collection |
|---|---|---|---|
| Distribute credits | POST /admin/customers/:customerId/distribute-credits | distributeCredits | CreditTransaction |
| Revoke credits | POST /admin/customers/:customerId/revoke-credits | revokeCredits | CreditTransaction |
| Credit transactions | GET /admin/credit-transactions | getOrgTransactions | — (read) |
| Credit summary | GET /admin/credit-summary | getOrgCreditSummary | — (read) |
11. Payment Gateway — /admin/payment-config (entitlement PAYMENTS)
Configure the payment gateway customers use to top up credits. Route file: payment.routes.ts (gated by FEATURE_MAP.managePayments). Controller: payment.controller.ts.
| Action | Method + Path | Handler | Collection |
|---|---|---|---|
| Get payment config | GET /admin/payment-config | getPaymentConfig | PaymentConfig (read) |
| Upsert payment config | PUT /admin/payment-config | upsertPaymentConfig | PaymentConfig |
| Org payment orders | GET /admin/payment-orders | getOrgPaymentOrders | PaymentOrder (read) |
External integration: Razorpay (the gateway). See Payment System.
12. Phone Numbers — /admin/phone-numbers
Org number inventory; assign/unassign numbers to customers. Route file: telephony.routes.ts (requireRole("admin") + requireOrg). Controller: telephony.controller.ts.
| Action | Method + Path | Handler | Collection |
|---|---|---|---|
| Org number stats | GET /admin/phone-numbers/stats | adminGetOrgNumberStats | PhoneNumber (read) |
| List org numbers | GET /admin/phone-numbers | listOrgNumbers | PhoneNumber (read) |
| Assign to customer | POST /admin/phone-numbers/:id/assign-customer | adminAssignToCustomer | PhoneNumber, PhoneNumberAssignment |
| Unassign from customer | POST /admin/phone-numbers/:id/unassign-customer | adminUnassignFromCustomer | PhoneNumber, PhoneNumberAssignment |
| List org SIP trunks | GET /admin/sip-trunks | adminListTrunks | SIPTrunk (read) |
13. Number Provisioning — /admin/provisioning
Enable providers per customer and set the org's customer-facing number rates. Route file: admin-provisioning.routes.ts (mounted at /admin/provisioning). Controller: admin-provisioning.controller.ts.
| Action | Method + Path | Handler | Collection |
|---|---|---|---|
| List enabled providers | GET /admin/provisioning/providers | listProviders | Provider, OrgProviderEnablement (read) |
| Set customer enablement | POST /admin/provisioning/customers/:customerUID/enablement | setCustomerEnablement | OrgProviderEnablement |
| BYO permission toggle | PUT /admin/provisioning/providers/:providerUID/byo-permission | setByoPermission | OrgProviderEnablement |
| Set customer rates | PUT /admin/provisioning/rates | setRates | ProvisionedNumber rates / OrgConfigReplica |
| Price breakdown | GET /admin/provisioning/providers/:providerUID/price-breakdown | getProviderPriceBreakdown | — (read) |
| Refresh provider costs | POST /admin/provisioning/providers/:providerUID/refresh-costs | refreshProviderCosts | Provider |
| Inventory | GET /admin/provisioning/inventory | getInventory | ProvisionedNumber (read) |
See Phone Number Provisioning.
14. Connecter — /admin/connecter-config (entitlement CRM_CONNECTER_MANAGE / WHATSAPP_MANAGE)
Manage the org's bring-your-own OAuth apps + default provider mappings. Route file: connecterAdmin.routes.ts (mounted at /api/v2/connecter/admin). Controllers: connecterAdmin.controller.ts, gmailAdmin.controller.ts.
| Action | Method + Path | Handler | Collection |
|---|---|---|---|
| List apps | GET /api/v2/connecter/admin/apps | listApps | CrmProviderApp (read) |
| Upsert org app | PUT /api/v2/connecter/admin/apps/:provider | upsertOrgApp | CrmProviderApp |
| Delete org app | DELETE /api/v2/connecter/admin/apps/:provider | deleteOrgApp | CrmProviderApp |
| Get/set mapping | GET/PUT /api/v2/connecter/admin/mappings/:provider | getOrgMapping / setOrgMapping | CrmFieldMapping |
| Gmail org app | GET/PUT/DELETE /api/v2/connecter/admin/gmail-app | getGmailApp / upsertGmailApp / deleteGmailApp | GmailOrgConfig |
Guarded by
requireRole("admin","superadmin")+requireFeatureAccess(FEATURE_MAP.manageConnecter). Superadmin-only global defaults live on the same router under/global-apps— see Superadmin Dashboard.
15. Settings — /admin/settings
Org branding + general settings. Page: pages/admin/SettingsPage.tsx. Controller: admin.controller.ts.
- Get organization →
GET /admin/organization(getOrganization) — readsOrganization - Update branding →
PUT /admin/organization/branding(updateBranding) — writesOrganization
16. Account Settings — /admin/account
The admin's own account (bottom nav). Page: pages/admin/AccountSettingsPage.tsx. Uses the shared auth/account endpoints (/auth/*, /account/*) — the same team/role endpoints described in Team RBAC.
Collections Written by This Dashboard
Primary collections: Organization, User, Kyc, OrgConfigReplica, CustomerFeePricing, CustomerAddonPricing, ServicePricing, AnalysisSchema, CreditTransaction, PaymentConfig, PaymentOrder, PhoneNumber, PhoneNumberAssignment, ProvisionedNumber, OrgProviderEnablement, Provider, CrmProviderApp, CrmFieldMapping, GmailOrgConfig, Ticket. Full definitions in Data Collections.
How to Test (End-to-End)
- Prerequisites: an admin account owning an Organization with at least one customer; backend + frontend running.
- Customers: create a customer at
/admin/customers, confirm aUserdoc appears pinned to yourorgUID. - Credits: distribute credits to that customer, confirm a
CreditTransactionis written and the customer's balance updates. - Config Management: change a preset rate, save, and confirm
OrgConfigReplicareflects it; verify the customer sees the new rate. - Number Provisioning: enable a provider for the customer and confirm
OrgProviderEnablementupdates. - Gated items: toggle
PAYMENTS/TICKETING/ADMIN_ANALYTICSoff at the superadmin level and confirm the matching rows lock.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Customer not visible in list | Customer belongs to a different org | requireOrg scopes to your org only; verify ownership |
403 on /admin/payment-config | Org lacks PAYMENTS entitlement | Grant it at the superadmin level |
| Pricing change not applied to a customer | Per-customer override still set | Clear the customer override in Config Management (DELETE .../customers/:customerUID) |
| KYC review button missing | Customer never submitted KYC | Customer must submit KYC first; see kyc.controller.ts |
| Provisioning rate save fails | Provider not enabled for the org | Enable the provider first (superadmin), then set org rates |