/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 fromGET /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 bycanActOn(target):
- You can never act on yourself.
- A
super_admincan act on anyone. - Everyone else can act on any user except a
super_admin.
| Action | Endpoint | Gating |
|---|---|---|
| Edit | opens the edit-user modal → PUT /users/{id} | canActOn |
| Reset Password | opens the reset-password modal | canActOn |
| Activate / Deactivate | POST /users/{id}/deactivate (toggles) | canActOn |
| Delete | DELETE /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 isagent 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.
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.
Related docs
API keys
CRM API keys for machine access.
Users and roles
CXB API role hierarchy and enforcement.