getPendingUsers
Retrieve all users awaiting approval (users with GUEST role).Response
array
Example
getApprovedUsers
Retrieve all approved users (users with USER or ADMIN role).Response
array
Example
approveUser
Approve a pending user by upgrading their role from GUEST to USER.Input Parameters
string
required
The ID of the user to approve
Response
object
The updated user object with USER role
Example
revokeAccess
Revoke a user’s access by downgrading their role to GUEST. Cannot revoke admin access.Input Parameters
string
required
The ID of the user whose access should be revoked
Response
object
The updated user object with GUEST role
Example
Error Cases
- NOT_FOUND: User not found
- FORBIDDEN: Cannot revoke admin’s access
deleteUser
Permanently delete a user from the system. Cannot delete admin users.Input Parameters
string
required
The ID of the user to delete
Response
boolean
Indicates whether the user was deleted successfully
Example
Error Cases
- NOT_FOUND: User not found
- FORBIDDEN: Cannot delete an admin user
addNewUser
Create a new user with USER role and email authentication.Input Parameters
string
required
User’s full name (minimum 1 character)
string
required
Valid email address
string
required
Password (8-100 characters)
Response
object
The newly created user object
Example
Error Cases
- BAD_REQUEST: User with this email already exists
- INTERNAL_SERVER_ERROR: Failed to create user
makeAdmin
Promote a user to admin role.Input Parameters
string
required
The ID of the user to promote to admin
Response
object
The updated user object with ADMIN role
Example
getWhatsAppSessions
Retrieve all connected WhatsApp sessions across all users.Response
array
Example
getWhatsAppGroups
Retrieve all WhatsApp groups across all sessions.Response
array
Example
getActiveCampaigns
Retrieve all active campaigns across all users (SCHEDULED or IN_PROGRESS status).Response
array