Roles & Permissions
Whatomate provides a flexible role-based access control (RBAC) system that allows you to define custom roles with granular permissions.
Overview
Section titled “Overview”The permission system is built around:
- Permissions: Fine-grained access controls for specific actions on resources (e.g.,
users:write,contacts:read) - Roles: Collections of permissions that can be assigned to users
- System Roles: Pre-defined roles (Admin, Manager, Agent) that cannot be deleted
System Roles
Section titled “System Roles”Three system roles are created automatically for each organization:
| Role | Permissions granted |
|---|---|
| Admin | Every permission in the catalogue below. |
| Manager | Everything except: users, roles, SSO settings, API keys, audit logs, organization write/delete/assign (organizations:read only), and teams write/delete (teams:read only). |
| Agent | accounts:read, chat:read, chat:write, contacts:read, tags:read, analytics.agents:read, transfers:read/write/pickup, canned_responses:read, call_transfers:read/write, outgoing_calls:read/write. Note agents deliberately have no call_logs:read — they see only their own calls. |
Custom Roles
Section titled “Custom Roles”Create custom roles to match your organization's needs. For example:
- Support Lead: Can manage contacts and view analytics, but not manage users
- Campaign Manager: Can create/manage campaigns and templates only
- Read-Only Auditor: Can view all data but not make changes
Creating a Custom Role
Section titled “Creating a Custom Role”- Go to Settings → Roles
- Click Add Role
- Enter a name and description
- Select permissions from the permission matrix
- Click Create
Permissions
Section titled “Permissions”Permissions follow the format resource:action. Available actions are:
| Action | Description |
|---|---|
read | View the resource |
write | Create or modify items (there is no separate create/update — both are write) |
delete | Remove items |
sync | Sync from an external source (templates) |
execute | Run the resource (campaigns) |
import | Bulk-import records (contacts) |
export | Bulk-export records (contacts) |
pickup | Claim a queued item (transfers) |
assign | Manage organization members (organizations:assign) |
Available Resources
Section titled “Available Resources”This is the complete seeded catalogue — exactly the permissions returned by GET /api/permissions.
| Resource | Actions | Description |
|---|---|---|
users | read, write, delete | User management |
teams | read, write, delete | Team management |
roles | read, write, delete | Role management |
settings.general | read, write | General organization settings |
settings.chatbot | read, write | Chatbot settings |
settings.sso | read, write | Single sign-on configuration |
accounts | read, write, delete | WhatsApp account settings |
templates | read, write, delete, sync | Message template management; sync pulls templates from Meta |
flows.whatsapp | read, write, delete | WhatsApp Flows (interactive forms) |
flows.chatbot | read, write, delete | Chatbot flow management |
campaigns | read, write, delete, execute | Campaign management; execute starts/retries a send |
chatbot.keywords | read, write, delete | Chatbot keyword auto-reply rules |
chatbot.ai | read, write, delete | Chatbot AI contexts |
chat | read, write | View conversations (read) and send messages (write) |
chat.assign | write | Assign conversations to agents |
contacts | read, write, delete, import, export | Contact management and bulk import/export |
tags | read, write, delete | Contact tag management |
analytics | read, write, delete | View the analytics dashboard (read); write/delete govern dashboard widgets |
analytics.agents | read | Agent performance analytics |
transfers | read, write, pickup | Chatbot-to-agent transfer queue |
webhooks | read, write, delete | Outbound webhook configuration |
api_keys | read, write, delete | API key management |
canned_responses | read, write, delete | Saved reply templates |
custom_actions | read, write, delete | Custom action buttons |
organizations | read, write, delete, assign | Organizations; assign manages members |
call_logs | read | Voice call history |
ivr_flows | read, write, delete | IVR call flow definitions |
call_transfers | read, write | Voice call transfers |
outgoing_calls | read, write | Outbound calling |
audit_logs | read | Audit trail (read-only) |
Permission Matrix
Section titled “Permission Matrix”When creating or editing a role, you'll see a permission matrix organized by resource:
Users ☑ Read users (users:read) ☑ Write users (users:write — create or edit) ☐ Delete users (users:delete)
Contacts ☑ Read contacts (contacts:read) ☑ Write contacts (contacts:write) ☐ Delete contacts (contacts:delete) ☐ Import contacts (contacts:import) ☐ Export contacts (contacts:export)Assigning Roles to Users
Section titled “Assigning Roles to Users”- Go to Settings → Users
- Click on a user or create a new one
- Select a role from the dropdown
- Save changes
Multi-Organization Access
Section titled “Multi-Organization Access”Users can belong to multiple organizations, each with a different role. The organization switcher appears in the sidebar for users who are members of more than one organization.
Organization Switching
Section titled “Organization Switching”When switching organizations:
- New JWT tokens are issued scoped to the target organization via
POST /api/auth/switch-org - The user's role and permissions are loaded from their membership in the target organization
- All data views refresh to show the selected organization's data
- The selected organization persists across page navigation
Cross-Organization Members
Section titled “Cross-Organization Members”Users added to an organization from another org appear with a Member badge in the user list. Members have limited management:
- Role updates — only the org-specific role can be changed
- Removal — removes the user from the organization without deleting their account
- Other fields (email, password, name, active status) are managed in the user's home organization
Super Admin
Section titled “Super Admin”Super admins have additional privileges:
- Access to all organizations, even without explicit membership
- Can switch to any organization using the
X-Organization-IDheader - Can create new organizations
UI Behavior
Section titled “UI Behavior”The frontend dynamically adapts based on user permissions:
Sidebar Menu
Section titled “Sidebar Menu”Each route declares the resource it needs in its meta.permission, and the router hides the menu
item and blocks navigation when the user lacks <resource>:read:
| Area | Resource |
|---|---|
| Dashboard / Analytics | analytics |
| Agent Analytics | analytics.agents |
| Chat | chat |
| Contacts | contacts |
| Tags | tags |
| Templates | templates |
| WhatsApp Flows | flows.whatsapp |
| Campaigns | campaigns |
| Chatbot settings & builder | settings.chatbot |
| Keyword rules | chatbot.keywords |
| Chatbot flows | flows.chatbot |
| AI contexts | chatbot.ai |
| Transfer queue | transfers |
| General settings | settings.general |
| Accounts | accounts |
| Canned Responses | canned_responses |
| Users | users |
| Roles | roles |
| Teams | teams |
| API Keys | api_keys |
| Webhooks | webhooks |
| SSO | settings.sso |
| Custom Actions | custom_actions |
| Audit Logs | audit_logs |
| Call Logs | call_logs |
| IVR Flows | ivr_flows |
| Call Transfers | call_transfers |
Page Access
Section titled “Page Access”If a user tries to access a page they don't have permission for, they are redirected to the first accessible page.
Action Buttons
Section titled “Action Buttons”Create, edit, and delete buttons are shown only if the user has the corresponding permission. For example, the "Add User" button only appears if the user has users:write permission.
API Authorization
Section titled “API Authorization”All API endpoints check permissions before processing requests:
# Returns 403 if user lacks users:read permissionGET /api/users
# Returns 403 if user lacks campaigns:write permissionPOST /api/campaignsResponse for Unauthorized Access
Section titled “Response for Unauthorized Access”A missing permission returns 403 with a generic message — the specific resource:action is not
disclosed. An unauthenticated request returns 401 Unauthorized instead.
{ "status": "error", "message": "Insufficient permissions", "data": null}Best Practices
Section titled “Best Practices”- Principle of Least Privilege: Assign only the permissions users need
- Use Custom Roles: Create roles that match job functions rather than assigning system roles
- Regular Audits: Periodically review role assignments and permissions
- Document Roles: Use meaningful names and descriptions for custom roles