Workspaces & Teams

Team Management

Manage employees and clients from the admin panel. Only super_admin and admin roles have access.

Roles

RolePermissions
super_adminFull access — all workspaces, admin panel, system updates, impersonation
adminAdmin panel, all workspaces, employee/client management
employeeOnly assigned workspaces — campaigns, leads, mailboxes, threads
clientRead-only access to their own workspace

Adding an Employee

bash
curl -X POST https://YOUR_SERVER/api/v1/admin/employees \
  -H "Content-Type: application/json" \
  -H "Cookie: auth_token=YOUR_JWT_TOKEN" \
  -d '{"name": "John Smith", "email": "john@company.com", "password": "securepass123"}'

Onboarding a Client

bash
curl -X POST https://YOUR_SERVER/api/v1/admin/clients \
  -H "Content-Type: application/json" \
  -H "Cookie: auth_token=YOUR_JWT_TOKEN" \
  -d '{"name": "Client Corp", "company": "Client Corp", "email": "owner@clientcorp.com", "phone": "+1234567890"}'

This creates a new workspace for the client and gives them client role access.

Assigning Employees to Workspaces

bash
# Create assignment
curl -X POST https://YOUR_SERVER/api/v1/admin/assignments \
  -H "Content-Type: application/json" \
  -H "Cookie: auth_token=YOUR_JWT_TOKEN" \
  -d '{"user_id": "EMPLOYEE_UUID", "workspace_id": "WORKSPACE_UUID"}'

# Remove assignment
curl -X DELETE https://YOUR_SERVER/api/v1/admin/assignments/ASSIGNMENT_ID \
  -H "Cookie: auth_token=YOUR_JWT_TOKEN"
Multiple assignments

An employee can be assigned to multiple workspaces. They'll see a workspace switcher in the dashboard showing only their assigned workspaces.

Impersonation (super_admin only)

Super admins can log in as any user to debug issues or manage their workspace:

bash
curl -X POST https://YOUR_SERVER/api/v1/admin/impersonate/USER_UUID \
  -H "Cookie: auth_token=YOUR_JWT_TOKEN"

Returns a new JWT token for the target user's session.

Admin Panel API

MethodEndpointDescription
GET/api/v1/admin/dashboardAggregate stats
GET/api/v1/admin/employeesList employees
POST/api/v1/admin/employeesCreate employee
DELETE/api/v1/admin/employees/:idDelete employee
GET/api/v1/admin/clientsList clients
POST/api/v1/admin/clientsOnboard client
DELETE/api/v1/admin/clients/:widDelete client
GET/api/v1/admin/assignmentsList assignments
POST/api/v1/admin/assignmentsCreate assignment
DELETE/api/v1/admin/assignments/:idDelete assignment
POST/api/v1/admin/impersonate/:uidImpersonate user