Skip to main content
The User API provides endpoints for users to manage their WhatsApp sessions, retrieve groups and contacts, and control session lifecycle.

getWhatsAppSession

Retrieve the current user’s connected WhatsApp session.

Response

object | null
WhatsApp session object or null if not connected
string
Session ID
string
Unique session name
string
Associated phone number
string
Owner user ID
Date
Session creation timestamp
Date
Last update timestamp
array
Array of associated WhatsApp groups
string
Group database ID
string
Group name
string
WhatsApp group ID
array
Active campaigns for this group

Example


initiateWhatsAppSession

Create or reconnect to a WhatsApp session for the current user.

Response

string
The unique session name created or reused
string
The session database ID

Example

Error Cases

  • INTERNAL_SERVER_ERROR: Failed to create WhatsApp session

getSessionStatus

Check the current status of a WhatsApp session.

Input Parameters

string
required
The session name to check

Response

string
Session status from WAHA API (e.g., “WORKING”, “SCAN_QR_CODE”, “STOPPED”)

Example


getSessionQR

Retrieve the QR code for authenticating a WhatsApp session.

Input Parameters

string
required
The session name to get the QR code for

Response

string
Base64-encoded QR code image

Example


restartSession

Restart a WhatsApp session by stopping and starting it.

Input Parameters

string
required
The session name to restart

Response

boolean
Indicates whether the session was restarted successfully

Example


updateSessionPhone

Update the phone number associated with a session.

Input Parameters

string
required
The session database ID
string
required
The new phone number

Response

boolean
Indicates whether the phone number was updated successfully

Example


logoutSession

Logout and delete a WhatsApp session.

Input Parameters

string
required
The session name to logout

Response

boolean
Indicates whether the logout was successful

Example


getWhatsAppGroups

Retrieve WhatsApp groups for a session with pagination and search.

Input Parameters

string
required
The session name to fetch groups from
number
default:10
Maximum number of groups to return (minimum 1)
number
default:0
Pagination cursor (offset)
Optional search term to filter groups by name

Response

array
Array of group objects
string
WhatsApp group ID
string
Group name
number | undefined
Cursor for the next page, or undefined if no more results
undefined
Total count not available without fetching all groups

Example


getWhatsAppContacts

Retrieve WhatsApp contacts for a session with pagination and search.

Input Parameters

string
required
The session name to fetch contacts from
number
default:50
Maximum number of contacts to return (minimum 1)
number
default:0
Pagination cursor (offset)
string
Optional search term to filter contacts by name or number

Response

array
Array of contact objects
string
Contact ID (used as groupId for consistency)
string
Contact name
string
Contact phone number
boolean
Always true for contacts
number | undefined
Cursor for the next page, or undefined if no more results
undefined
Total count not available

Example


Type Definitions