Skip to main content
The Admin API provides endpoints for managing users, WhatsApp sessions, groups, and campaigns. All endpoints require admin privileges.

getPendingUsers

Retrieve all users awaiting approval (users with GUEST role).

Response

array
Array of pending user objects
string
User ID
string
User’s name
string
User’s email address
string
User role (always “GUEST” for pending users)
Date
Account creation timestamp

Example


getApprovedUsers

Retrieve all approved users (users with USER or ADMIN role).

Response

array
Array of approved user objects
string
User ID
string
User’s name
string
User’s email address
string
User role (“USER” or “ADMIN”)
Date
Account creation timestamp

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
Array of WhatsApp session objects
string
Session ID
string
Unique session name
string
Associated phone number
string
Owner user ID
string
Session status (“CONNECTED”)
Date
Session creation timestamp
array
Array of associated WhatsApp groups

Example


getWhatsAppGroups

Retrieve all WhatsApp groups across all sessions.

Response

array
Array of WhatsApp group objects
string
Group database ID
string
Group name
string
WhatsApp group ID
string
Associated session ID
Date
Group creation timestamp
array
Array of active campaigns for this group

Example


getActiveCampaigns

Retrieve all active campaigns across all users (SCHEDULED or IN_PROGRESS status).

Response

array
Array of active campaign objects
string
Campaign ID
string
Associated session ID
string
Associated group ID
string
Campaign title
string
Campaign status (“SCHEDULED” or “IN_PROGRESS”)
Date
Campaign start date
Date
Campaign end date
object
Associated group object

Example


Type Definitions