The Users page at /dashboard/users manages team access and roles. It includes modals for adding a user, editing a user, resetting a password, and editing the current profile.

User table

Loaded from GET /api/v1/users, each row shows Name (with email), Role badge, Languages, Status, Created date, and a row action menu. Roles render as Super Admin, Admin, Supervisor, or Agent. The Languages column shows agent/supervisor languages (uppercased) and -- for admins.

Row actions and hierarchy

Actions are gated by canActOn(target):
  • You can never act on yourself.
  • A super_admin can act on anyone.
  • Everyone else can act on any user except a super_admin.
ActionEndpointGating
Editopens the edit-user modal → PUT /users/{id}canActOn
Reset Passwordopens the reset-password modalcanActOn
Activate / DeactivatePOST /users/{id}/deactivate (toggles)canActOn
DeleteDELETE /users/{id}canActOn and current user is super_admin

Add / Edit modals and role promotion

The add-user flow (POST /api/v1/auth/register) and the edit-user flow (PUT /api/v1/users/{id}) share the same role dropdown. The role options are always Agent, Supervisor, and Admin, with Super Admin shown only when the current user is a super_admin: This is the same-rank promotion behavior: an admin can create or promote up to Admin (their own rank), and a super_admin can create or promote up to Super Admin. The dropdown is the UI gate; the CXB API enforces the hierarchy server-side.

Agent languages

When the selected role is agent or supervisor, both modals show language controls:
  • Agent Languages — multi-select checkboxes (English, Hindi). Falls back to ['en'] if all are unchecked.
  • Primary Language — dropdown limited to the selected languages; auto-corrects to the first language if the current primary is removed.
These map to agent_languages and agent_primary_language in the payload and are only sent for agent/supervisor roles. The add-user modal also has a show/hide password toggle.

API keys

CRM API keys for machine access.

Users and roles

CXB API role hierarchy and enforcement.