open-wa
DocsAPI reference

Client API

Client methods, return values, and examples.

Client API
Connect the Node.js client

Connect once to a running Easy API, then use the calls below.

import { SocketClient } from '@open-wa/socket-client';const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');

addLabel

Add label to chat

client.addLabel(label, chatId)Parameters (2)
labelRequired
string

Label ID or name

chatIdRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

ReturnsPromise<boolean>
const result = await client.addLabel({ label: "label", chatId: "447123456789@c.us", });

addParticipant

Add participant to group

client.addParticipant(groupId, contactId)Parameters (2)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<boolean>
const result = await client.addParticipant({  groupId: "447123456789-1445627445@g.us",  contactId: "447123456789@c.us",});

approveGroupJoinRequest

Approve group join request

client.approveGroupJoinRequest(groupId, contactId)Parameters (2)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<string | boolean>
const result = await client.approveGroupJoinRequest({  groupId: "447123456789-1445627445@g.us",  contactId: "447123456789@c.us",});

archiveChat

Archive a chat

client.archiveChat(chatId)Parameters (1)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<boolean>
const result = await client.archiveChat({ chatId: "447123456789@c.us", });

blockContact

Block a contact

client.blockContact(contactId)Parameters (1)
contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<boolean>
const result = await client.blockContact({ contactId: "447123456789@c.us", });
Insiders

checkNumberStatus

Check if number is on WhatsApp

client.checkNumberStatus(contactId)Parameters (1)
contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<NumberCheck>
const result = await client.checkNumberStatus({ contactId: "447123456789@c.us", });

checkReadReceipts

Check read receipts setting

client.checkReadReceipts(contactId)Parameters (1)
contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<boolean | string>
const result = await client.checkReadReceipts({ contactId: "447123456789@c.us", });

clearChat

Clear chat history

client.clearChat(chatId)Parameters (1)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<boolean>
const result = await client.clearChat({ chatId: "447123456789@c.us", });
Restricted

createGroup

Create new group

client.createGroup(name, contacts)Parameters (2)
nameRequired
string

Group name

contactsRequired
string[]ContactId

Contact IDs to add A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<GroupCreationResult | null>
const result = await client.createGroup({ name: "name", contacts: ["447123456789@c.us"], });

decryptMedia

Decrypts media from a message

client.decryptMedia(message)Parameters (1)
messageRequired
Object · view fields
{ ack: -1 | 0 | 1 | 2 | 3 | 4;
author?: string;
body: string;
broadcast?: boolean;
caption?: string;
chat: { ack?: any;
contact: { formattedName?: string;
id: string;
isBusiness?: boolean;
isEnterprise?: boolean;
isMe?: boolean;
isMyContact?: boolean;
isOnline?: boolean;
isPSA?: boolean;
isUser?: boolean;
isWAContact?: boolean;
labels?: string[];
lastSeen?: number;
msgs?: any[];
name?: string;
profilePicThumbObj?: { eurl?: string;
id?: { _serialized: string;
server: string;
user: string };
img?: string;
imgFull?: string;
tag?: string };
pushname?: string;
shortName?: string;
statusMute?: boolean;
type?: string;
verifiedLevel?: number;
verifiedName?: string };
formattedTitle?: string;
groupMetadata?: { announce?: boolean;
creation: number;
desc?: string;
descOwner?: string;
descTime?: number;
id: string;
owner?: string;
participants: { id: string;
isAdmin: boolean;
isSuperAdmin?: boolean }[];
restrict?: boolean;
subject: string };
id: string;
isGroup: boolean;
isReadOnly?: boolean;
lastReceivedKey?: any;
msgs?: any[];
muteExpiration?: number;
name?: string;
notSpam?: boolean;
pin?: number;
presence?: object;
t?: number;
unreadCount?: number };
chatId: string;
clientUrl?: string;
content: string;
deprecatedMms3Url?: string;
from: string;
fromMe: boolean;
id: string;
invis?: boolean;
isForwarded?: boolean;
isGroupMsg: boolean;
isMedia: boolean;
isMMS?: boolean;
isNewMsg?: boolean;
isNotification: boolean;
isPSA?: boolean;
isQuotedMsgAvailable: boolean;
labels?: string[];
mentionedJidList?: string[];
notifyName?: string;
quotedMsg?: any;
quotedMsgObj?: any;
recvFresh?: boolean;
self: "in" | "out";
sender: { formattedName?: string;
id: string;
isBusiness?: boolean;
isEnterprise?: boolean;
isMe?: boolean;
isMyContact?: boolean;
isOnline?: boolean;
isPSA?: boolean;
isUser?: boolean;
isWAContact?: boolean;
labels?: string[];
lastSeen?: number;
msgs?: any[];
name?: string;
profilePicThumbObj?: { eurl?: string;
id?: { _serialized: string;
server: string;
user: string };
img?: string;
imgFull?: string;
tag?: string };
pushname?: string;
shortName?: string;
statusMute?: boolean;
type?: string;
verifiedLevel?: number;
verifiedName?: string };
senderId?: string;
star?: boolean;
t: number;
timestamp: number;
to: string;
type: "chat" | "audio" | "ptt" | "image" | "video" | "document" | "sticker" | "location" | "vcard" | "multi_vcard" | "revoked" | "order" | "buttons_response" | "list_response" | "unknown" }

Message object containing media

ReturnsPromise<DataURL>
// Use the full media message received by your message handler.const result = await client.decryptMedia({ message });
Insiders

deleteAllStatus

Delete all statuses

client.deleteAllStatus()No parameters

Call this method without arguments.

ReturnsPromise<boolean>
const result = await client.deleteAllStatus();

deleteChat

Delete a chat

client.deleteChat(chatId)Parameters (1)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<boolean>
const result = await client.deleteChat({ chatId: "447123456789@c.us", });

deleteMessage

Deletes a message

client.deleteMessage(chatId, messageId, onlyLocal?)Parameters (3)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

messageIdRequired
string[] | stringMessageId[]

Message ID(s) to process

Example: ["false_447123456789@c.us_ABC123","false_447123456789@c.us_DEF456"]

Also accepts: messages

onlyLocal?Optional
boolean

Delete only locally

ReturnsPromise<boolean>

Resolves to boolean: true means the runtime accepted the operation and false means it did not complete. Provider-side revoke can still be rejected, so the value is not proof that every recipient removed the message.

const result = await client.deleteMessage({  chatId: "447123456789@c.us",  messageId: ["false_447123456789@c.us_ABC123","false_447123456789@c.us_DEF456"],});
Insiders

deleteStatus

Delete status

client.deleteStatus(statusesToDelete)Parameters (1)
statusesToDeleteRequired
string | string[]

Status ID(s)

ReturnsPromise<boolean>
const result = await client.deleteStatus({ statusesToDelete: [], });

demoteParticipant

Demote participant from admin

client.demoteParticipant(groupId, contactId)Parameters (2)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<boolean | string>
const result = await client.demoteParticipant({  groupId: "447123456789-1445627445@g.us",  contactId: "447123456789@c.us",});

downloadMedia

Downloads and decrypts media from a message to a file

client.downloadMedia(message, path)Parameters (2)
messageRequired
Object · view fields
{ ack: -1 | 0 | 1 | 2 | 3 | 4;
author?: string;
body: string;
broadcast?: boolean;
caption?: string;
chat: { ack?: any;
contact: { formattedName?: string;
id: string;
isBusiness?: boolean;
isEnterprise?: boolean;
isMe?: boolean;
isMyContact?: boolean;
isOnline?: boolean;
isPSA?: boolean;
isUser?: boolean;
isWAContact?: boolean;
labels?: string[];
lastSeen?: number;
msgs?: any[];
name?: string;
profilePicThumbObj?: { eurl?: string;
id?: { _serialized: string;
server: string;
user: string };
img?: string;
imgFull?: string;
tag?: string };
pushname?: string;
shortName?: string;
statusMute?: boolean;
type?: string;
verifiedLevel?: number;
verifiedName?: string };
formattedTitle?: string;
groupMetadata?: { announce?: boolean;
creation: number;
desc?: string;
descOwner?: string;
descTime?: number;
id: string;
owner?: string;
participants: { id: string;
isAdmin: boolean;
isSuperAdmin?: boolean }[];
restrict?: boolean;
subject: string };
id: string;
isGroup: boolean;
isReadOnly?: boolean;
lastReceivedKey?: any;
msgs?: any[];
muteExpiration?: number;
name?: string;
notSpam?: boolean;
pin?: number;
presence?: object;
t?: number;
unreadCount?: number };
chatId: string;
clientUrl?: string;
content: string;
deprecatedMms3Url?: string;
from: string;
fromMe: boolean;
id: string;
invis?: boolean;
isForwarded?: boolean;
isGroupMsg: boolean;
isMedia: boolean;
isMMS?: boolean;
isNewMsg?: boolean;
isNotification: boolean;
isPSA?: boolean;
isQuotedMsgAvailable: boolean;
labels?: string[];
mentionedJidList?: string[];
notifyName?: string;
quotedMsg?: any;
quotedMsgObj?: any;
recvFresh?: boolean;
self: "in" | "out";
sender: { formattedName?: string;
id: string;
isBusiness?: boolean;
isEnterprise?: boolean;
isMe?: boolean;
isMyContact?: boolean;
isOnline?: boolean;
isPSA?: boolean;
isUser?: boolean;
isWAContact?: boolean;
labels?: string[];
lastSeen?: number;
msgs?: any[];
name?: string;
profilePicThumbObj?: { eurl?: string;
id?: { _serialized: string;
server: string;
user: string };
img?: string;
imgFull?: string;
tag?: string };
pushname?: string;
shortName?: string;
statusMute?: boolean;
type?: string;
verifiedLevel?: number;
verifiedName?: string };
senderId?: string;
star?: boolean;
t: number;
timestamp: number;
to: string;
type: "chat" | "audio" | "ptt" | "image" | "video" | "document" | "sticker" | "location" | "vcard" | "multi_vcard" | "revoked" | "order" | "buttons_response" | "list_response" | "unknown" }

Message object containing media

pathRequired
string

File path to save the media

ReturnsPromise<string>

Path to the saved file

// Use the full media message received by your message handler.const result = await client.downloadMedia({ message, path: "./downloaded-media" });

forwardMessages

Forwards messages to a chat

client.forwardMessages(to, messages, skipMyMessages?)Parameters (3)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

messagesRequired
string[] | stringMessageId[]

Message ID(s) to process

Example: ["false_447123456789@c.us_ABC123","false_447123456789@c.us_DEF456"]

Also accepts: messages

skipMyMessages?Optional
boolean

Skip own messages

Example: false

ReturnsPromise<MessageIdReturn[] | boolean>
const result = await client.forwardMessages({  to: "447123456789@c.us",  messages: ["false_447123456789@c.us_ABC123","false_447123456789@c.us_DEF456"],});

getAllChatIds

Get all chat IDs

client.getAllChatIds()No parameters

Call this method without arguments.

ReturnsPromise<ChatId[]>

Opaque conversation identifier. Use the exact value returned by a message event or chat lookup.

const result = await client.getAllChatIds();

getAllChats

Returns serialized Chat objects from the current session, optionally limited to chats with unread messages.

client.getAllChats(withNewMessagesOnly?)Parameters (1)
withNewMessagesOnly?Optional
boolean

Only chats with unread messages

Example: false

ReturnsPromise<Chat[]>

Serialized chat returned by chat lookups and listings. Its id is an opaque ChatId; additional WhatsApp Web fields may be present.

const result = await client.getAllChats();

getAllCommunities

Get all communities

client.getAllCommunities()No parameters

Call this method without arguments.

ReturnsPromise<GroupChatId[]>

Opaque group conversation identifier returned by a group lookup or join method.

const result = await client.getAllCommunities();

getAllContacts

Retrieves all contacts

client.getAllContacts()No parameters

Call this method without arguments.

ReturnsPromise<Contact[]>
const result = await client.getAllContacts();

getAllGroups

Get all groups

client.getAllGroups(withNewMessagesOnly?)Parameters (1)
withNewMessagesOnly?Optional
boolean

Only chats with unread messages

Example: false

ReturnsPromise<Chat[]>

Serialized chat returned by chat lookups and listings. Its id is an opaque ChatId; additional WhatsApp Web fields may be present.

const result = await client.getAllGroups();

getAllLabels

Get all labels

client.getAllLabels()No parameters

Call this method without arguments.

ReturnsPromise<Label[]>
const result = await client.getAllLabels();

getAllMessages

Retrieves all messages in the session

client.getAllMessages(chatId?, includeMe?, includeNotifications?)Parameters (3)
chatId?Optional
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

includeMe?Optional
boolean

Include own messages

includeNotifications?Optional
boolean

Include notification messages

ReturnsPromise<Message[]>
const result = await client.getAllMessages();

getBatteryLevel

Get phone battery level

client.getBatteryLevel()No parameters

Call this method without arguments.

ReturnsPromise<number>
const result = await client.getBatteryLevel();

getBlockedIds

Get blocked contact IDs

client.getBlockedIds()No parameters

Call this method without arguments.

ReturnsPromise<ContactId[] | false>
const result = await client.getBlockedIds();

getBusinessProducts

Get business products

client.getBusinessProducts(contactId)Parameters (1)
contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<Product[] | false>
const result = await client.getBusinessProducts({ contactId: "447123456789@c.us", });

getBusinessProfile

Get business profile

client.getBusinessProfile(contactId)Parameters (1)
contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<BusinessProfile>
const result = await client.getBusinessProfile({ contactId: "447123456789@c.us", });

getChat

Get specific chat by ID

client.getChat(chatId)Parameters (1)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<Chat | null | undefined | false>
const result = await client.getChat({ chatId: "447123456789@c.us", });

getChatsByLabel

Get chats by label

client.getChatsByLabel(label)Parameters (1)
labelRequired
string

Label name

ReturnsPromise<Chat[]>

Serialized chat returned by chat lookups and listings. Its id is an opaque ChatId; additional WhatsApp Web fields may be present.

const result = await client.getChatsByLabel({ label: "label", });

getChatWithNonContacts

Get chats with non-contacts

client.getChatWithNonContacts()No parameters

Call this method without arguments.

ReturnsPromise<Contact[]>
const result = await client.getChatWithNonContacts();

getCommonGroups

Get common groups with contact

client.getCommonGroups(contactId)Parameters (1)
contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<CommonGroup[] | false>
const result = await client.getCommonGroups({ contactId: "447123456789@c.us", });

getCommunityAdminIds

Get community admin IDs

client.getCommunityAdminIds(communityId)Parameters (1)
communityIdRequired
stringGroupChatId

Community ID A WhatsApp community JID

Example: "447123456789-1445627445@g.us"

ReturnsPromise<CommunityAdminIds[]>
const result = await client.getCommunityAdminIds({ communityId: "447123456789-1445627445@g.us", });

getCommunityAdmins

Get community admins

client.getCommunityAdmins(communityId)Parameters (1)
communityIdRequired
stringGroupChatId

Community ID A WhatsApp community JID

Example: "447123456789-1445627445@g.us"

ReturnsPromise<CommunityAdmins[]>
const result = await client.getCommunityAdmins({ communityId: "447123456789-1445627445@g.us", });

getCommunityInfo

Get community metadata

client.getCommunityInfo(communityId)Parameters (1)
communityIdRequired
stringGroupChatId

Community ID A WhatsApp community JID

Example: "447123456789-1445627445@g.us"

ReturnsPromise<CommunityMetadata>
const result = await client.getCommunityInfo({ communityId: "447123456789-1445627445@g.us", });

getCommunityParticipantIds

Get community participant IDs

client.getCommunityParticipantIds(communityId)Parameters (1)
communityIdRequired
stringGroupChatId

Community ID A WhatsApp community JID

Example: "447123456789-1445627445@g.us"

ReturnsPromise<CommunityParticipantIds[]>
const result = await client.getCommunityParticipantIds({ communityId: "447123456789-1445627445@g.us", });

getCommunityParticipants

Get community participants

client.getCommunityParticipants(communityId)Parameters (1)
communityIdRequired
stringGroupChatId

Community ID A WhatsApp community JID

Example: "447123456789-1445627445@g.us"

ReturnsPromise<CommunityParticipants[]>
const result = await client.getCommunityParticipants({ communityId: "447123456789-1445627445@g.us", });

getConnectionState

Get connection state

client.getConnectionState()No parameters

Call this method without arguments.

ReturnsPromise<string>
const result = await client.getConnectionState();

getContact

Get specific contact

client.getContact(contactId)Parameters (1)
contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<Contact | null>
const result = await client.getContact({ contactId: "447123456789@c.us", });

getFeatures

Get enabled features

client.getFeatures()No parameters

Call this method without arguments.

ReturnsPromise<FeatureFlags>

WhatsApp feature flags keyed by name. Values are provider-defined and must be narrowed before use.

const result = await client.getFeatures();

getGroupAdmins

Get group admins

client.getGroupAdmins(groupId)Parameters (1)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

ReturnsPromise<ContactId[]>

Opaque WhatsApp contact identifier. Preserve the exact value returned by the API.

const result = await client.getGroupAdmins({ groupId: "447123456789-1445627445@g.us", });

getGroupInfo

Get group metadata

client.getGroupInfo(groupId)Parameters (1)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

ReturnsPromise<GroupMetadata | null>
const result = await client.getGroupInfo({ groupId: "447123456789-1445627445@g.us", });

getGroupMembers

Retrieves members of a group

client.getGroupMembers(groupId)Parameters (1)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

ReturnsPromise<Contact[]>
const result = await client.getGroupMembers({ groupId: "447123456789-1445627445@g.us", });

getGroupMembersId

Get group member IDs

client.getGroupMembersId(groupId)Parameters (1)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

ReturnsPromise<ContactId[]>

Opaque WhatsApp contact identifier. Preserve the exact value returned by the API.

const result = await client.getGroupMembersId({ groupId: "447123456789-1445627445@g.us", });

getHostNumber

Get host phone number

client.getHostNumber()No parameters

Call this method without arguments.

ReturnsPromise<string>
const result = await client.getHostNumber();

getKickedGroups

Get groups where kicked

client.getKickedGroups()No parameters

Call this method without arguments.

ReturnsPromise<GroupChatId[]>

Opaque group conversation identifier returned by a group lookup or join method.

const result = await client.getKickedGroups();

getLicenseType

Get license type

client.getLicenseType()No parameters

Call this method without arguments.

ReturnsPromise<LicenseType | false>
const result = await client.getLicenseType();

getLoadedMessageCount

Get loaded message count

client.getLoadedMessageCount()No parameters

Call this method without arguments.

ReturnsPromise<number>
const result = await client.getLoadedMessageCount();

getMe

Get host account info

client.getMe()No parameters

Call this method without arguments.

ReturnsPromise<HostAccount>

Host account attributes plus the current account ID. Additional WhatsApp Web attributes vary by version.

const result = await client.getMe();

getMessageById

Retrieves a specific message by ID

client.getMessageById(messageId)Parameters (1)
messageIdRequired
stringMessageId

Message ID A WhatsApp message identifier

Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

Also accepts: id, msgId

ReturnsPromise<Message | null | false>
const result = await client.getMessageById({  messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",});

getMessageInfo

Get message delivery info

client.getMessageInfo(messageId)Parameters (1)
messageIdRequired
stringMessageId

Message ID A WhatsApp message identifier

Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

Also accepts: id, msgId

ReturnsPromise<MessageInfo>
const result = await client.getMessageInfo({  messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",});

getMessagesForLLM

Get messages formatted for LLMs

client.getMessagesForLLM(chatId, last?)Parameters (2)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

last?Optional
number
ReturnsPromise<LLMMessage[]>
const result = await client.getMessagesForLLM({ chatId: "447123456789@c.us", });

getMyLastMessage

Get last message sent by host

client.getMyLastMessage(chatId?)Parameters (1)
chatId?Optional
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<Message | undefined>
const result = await client.getMyLastMessage();
Insiders

getNumberProfile

Get profile of number

client.getNumberProfile(contactId)Parameters (1)
contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<NumberProfile>

Provisional number profile based on the public Contact fields. Fields are optional and additional provider fields are unknown. The licensed getNumberProfile payload has not been verified against this model.

const result = await client.getNumberProfile({ contactId: "447123456789@c.us", });
Insiders

getOrder

Get order details

client.getOrder(id)Parameters (1)
idRequired
string

Order or message ID

ReturnsPromise<Order>
const result = await client.getOrder({ id: "id", });

getProcessStats

Get process statistics

client.getProcessStats()No parameters

Call this method without arguments.

ReturnsPromise<ProcessStats>

Process diagnostics keyed by process ID. The provider controls each entry; no stable entry shape is guaranteed.

const result = await client.getProcessStats();

getProfilePicture

Get profile picture from server

client.getProfilePicture(chatId)Parameters (1)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<string>
const result = await client.getProfilePicture({ chatId: "447123456789@c.us", });

getSnapshot

Take screenshot

client.getSnapshot(chatId?, width?, height?)Parameters (3)
chatId?Optional
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

width?Optional
number
height?Optional
number
ReturnsPromise<string>
const result = await client.getSnapshot();
Insiders

getStarredMessages

Get starred messages

client.getStarredMessages(chatId?)Parameters (1)
chatId?Optional
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<Message[]>
const result = await client.getStarredMessages();
Insiders

getStatus

Get specific status

client.getStatus(contactId)Parameters (1)
contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<ContactStatus>
const result = await client.getStatus({ contactId: "447123456789@c.us", });
Insiders

getStories

Get all stories

client.getStories()No parameters

Call this method without arguments.

ReturnsPromise<Story[]>

Message-shaped status entry, based on the legacy story API. Chat and sender may be absent or null. The licensed getStories payload has not been verified against this model.

const result = await client.getStories();

getUnsentMessages

Get unsent/pending messages

client.getUnsentMessages()No parameters

Call this method without arguments.

ReturnsPromise<Message[]>
const result = await client.getUnsentMessages();

getUserAgent

Get user agent

client.getUserAgent(userAgent?)Parameters (1)
userAgent?Optional
string

User agent string

Example: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"

Also accepts: userA

ReturnsPromise<string>
const result = await client.getUserAgent();

getVCards

Extract vCards from message

client.getVCards(messageId)Parameters (1)
messageIdRequired
stringMessageId

Message ID A WhatsApp message identifier

Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

Also accepts: id, msgId

ReturnsPromise<string[]>
const result = await client.getVCards({ messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB", });

getWAVersion

Get WhatsApp Web version

client.getWAVersion()No parameters

Call this method without arguments.

ReturnsPromise<string>
const result = await client.getWAVersion();

healthCheck

Health check

client.healthCheck()No parameters

Call this method without arguments.

ReturnsPromise<HealthCheck>

Browser health diagnostics. This is not the Easy API /health HTTP envelope.

const result = await client.healthCheck();

isChatOnline

Check if chat is online

client.isChatOnline(chatId)Parameters (1)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<boolean | string>
const result = await client.isChatOnline({ chatId: "447123456789@c.us", });

isPlugged

Check if phone is charging

client.isPlugged()No parameters

Call this method without arguments.

ReturnsPromise<boolean>
const result = await client.isPlugged();

leaveGroup

Leave a group

client.leaveGroup(groupId)Parameters (1)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

ReturnsPromise<void>
const result = await client.leaveGroup({ groupId: "447123456789-1445627445@g.us", });

loadEarlierMessages

Loads earlier messages from a chat

client.loadEarlierMessages(chatId, count?, includeMe?)Parameters (3)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

count?Optional
number

Number of messages to load (default: 20)

includeMe?Optional
boolean

Whether to include messages from the host account (default: false)

ReturnsPromise<Message[]>
const result = await client.loadEarlierMessages({ chatId: "447123456789@c.us", });

markAsRead

Mark chat as read

client.markAsRead(chatId)Parameters (1)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<boolean>
const result = await client.markAsRead({ chatId: "447123456789@c.us", });

markAsUnread

Mark chat as unread

client.markAsUnread(chatId)Parameters (1)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<boolean>
const result = await client.markAsUnread({ chatId: "447123456789@c.us", });

muteChat

Mute a chat

client.muteChat(chatId, muteDuration)Parameters (2)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

muteDurationRequired
number | string

Mute duration

ReturnsPromise<string | boolean | number>
const result = await client.muteChat({ chatId: "447123456789@c.us", muteDuration: 1, });

pinChat

Pin a chat

client.pinChat(chatId)Parameters (1)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<boolean>
const result = await client.pinChat({ chatId: "447123456789@c.us", });
Insiders

postImageStatus

Post image status

client.postImageStatus(image, caption?)Parameters (2)
imageRequired
string

Image data URL

caption?Optional
string

Status caption

ReturnsPromise<MessageId | string | boolean>
const result = await client.postImageStatus({ image: "image", });
Insiders

postTextStatus

Post text status

client.postTextStatus(text, backgroundColor?, font?)Parameters (3)
textRequired
string

Status text

backgroundColor?Optional
string

Background color

font?Optional
number

Font style

ReturnsPromise<MessageId | string | boolean>
const result = await client.postTextStatus({ text: "text", });
Insiders

postVideoStatus

Post video status

client.postVideoStatus(video, caption?)Parameters (2)
videoRequired
string

Video data URL

caption?Optional
string

Status caption

ReturnsPromise<MessageId | string | boolean>
const result = await client.postVideoStatus({ video: "video", });

promoteParticipant

Promote participant to admin

client.promoteParticipant(groupId, contactId)Parameters (2)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<boolean | string>
const result = await client.promoteParticipant({  groupId: "447123456789-1445627445@g.us",  contactId: "447123456789@c.us",});

react

React to message with emoji

client.react(messageId, emoji)Parameters (2)
messageIdRequired
stringMessageId

Message ID A WhatsApp message identifier

Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

Also accepts: id, msgId

emojiRequired
string

Emoji reaction

ReturnsPromise<boolean>
const result = await client.react({  messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",  emoji: "emoji",});

rejectGroupJoinRequest

Reject group join request

client.rejectGroupJoinRequest(groupId, contactId)Parameters (2)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<string | boolean>
const result = await client.rejectGroupJoinRequest({  groupId: "447123456789-1445627445@g.us",  contactId: "447123456789@c.us",});

removeLabel

Remove label from chat

client.removeLabel(label, chatId)Parameters (2)
labelRequired
string

Label ID or name

chatIdRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

ReturnsPromise<boolean>
const result = await client.removeLabel({ label: "label", chatId: "447123456789@c.us", });

removeParticipant

Remove participant from group

client.removeParticipant(groupId, contactId)Parameters (2)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<boolean>
const result = await client.removeParticipant({  groupId: "447123456789-1445627445@g.us",  contactId: "447123456789@c.us",});
Insiders

sendAdvancedButtons

Sends an advanced button message with media (deprecated)

client.sendAdvancedButtons(to, body?, buttons, text, footer, filename)Parameters (6)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

body?Optional
string | any

Message body, location, or media

buttonsRequired
any[]

Array of advanced buttons (max 3)

textRequired
string

Message text

footerRequired
string

Message footer

filenameRequired
string

Filename if body is a file

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendAdvancedButtons({  to: "447123456789@c.us",  buttons: [],  text: "text",  footer: "footer",  filename: "filename",});

sendAudio

Sends an audio file to a chat

client.sendAudio(to, file, filename?, quotedMsgId?)Parameters (4)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

fileRequired
stringDataURL

Audio file (path, URL, DataURL, or Base64)

Example: "data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAA..."

filename?Optional
string

Filename with extension

Example: "document.pdf"

quotedMsgId?Optional
stringMessageId

Message ID A WhatsApp message identifier

Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

Also accepts: id, msgId

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendAudio({  to: "447123456789@c.us",  file: "data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAA...",});

sendBanner

Sends a banner image

client.sendBanner(to, base64)Parameters (2)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

base64Required
string

Base64 encoded JPEG

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendBanner({ to: "447123456789@c.us", base64: "base64", });
Insiders

sendButtons

Sends a button message (deprecated)

client.sendButtons(to, body?, buttons, title?, footer?)Parameters (5)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

body?Optional
string | any

Message body or location

buttonsRequired
any[]

Array of buttons (max 3)

title?Optional
string

Message title

footer?Optional
string

Message footer

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendButtons({ to: "447123456789@c.us", buttons: [], });

sendContact

Sends a single contact

client.sendContact(to, contactId)Parameters (2)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

contactIdRequired
string | string[]
ReturnsPromise<MessageIdReturn | boolean | void>
const result = await client.sendContact({ to: "447123456789@c.us", contactId: "447123456789@c.us", });

sendFile

Sends a file or document to a chat

client.sendFile(to, file, filename?, caption?)Parameters (4)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

fileRequired
stringDataURL

File (path, URL, DataURL, Base64, or Buffer)

Example: "data:application/pdf;base64,JVBERi0xLjQK..."

filename?Optional
string

Filename with extension

Example: "document.pdf"

caption?Optional
string

Media caption

Example: "Check out this image!"

ReturnsPromise<MessageIdReturn | string>
const result = await client.sendFile({  to: "447123456789@c.us",  file: "data:application/pdf;base64,JVBERi0xLjQK...",});

sendFileFromUrl

Downloads a file from a URL and sends it to a chat

client.sendFileFromUrl(to, url, filename, caption?, headers?)Parameters (5)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

urlRequired
string

URL of the file to download

filenameRequired
string

Filename for the sent file

caption?Optional
string

Caption for the file

headers?Optional
object

HTTP headers for the download request

ReturnsPromise<string | boolean>

Message ID or success status

const result = await client.sendFileFromUrl({ to: "447123456789@c.us", url: "url", filename: "filename", });

sendImage

Sends an image to a chat

client.sendImage(to, imgData, filename?, caption?, id?, waitForId?)Parameters (6)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

imgDataRequired
stringDataURL

Image file (path, URL, DataURL, or Base64)

Example: "data:image/png;base64,iVBORw0KGgo..."

filename?Optional
string

Filename with extension

Example: "document.pdf"

caption?Optional
string

Media caption

Example: "Check out this image!"

id?Optional
stringMessageId

Message ID A WhatsApp message identifier

Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

Also accepts: id, msgId

waitForId?Optional
boolean

Wait for message ID

Example: true

ReturnsPromise<MessageIdReturn | boolean | string>
const result = await client.sendImage({  to: "447123456789@c.us",  imgData: "data:image/png;base64,iVBORw0KGgo...",});
Insiders

sendInteractive

Send a portable interactive message document (Insiders and above)

client.sendInteractive(to, content)Parameters (2)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

contentRequired
Object · view fields
{ actions: ({ id: string;
label: string;
type: "reply" } | { label: string;
type: "url";
url: string } | { label: string;
phoneNumber: string;
type: "call" } | { code: string;
label: string;
type: "copy" })[];
body: string;
footer?: string;
header?: { text: string;
type: "text" } | { filename?: string;
source: string;
title?: string;
type: "image" } | { filename?: string;
source: string;
title?: string;
type: "video" } | { filename?: string;
source: string;
title?: string;
type: "document" };
type: "buttons";
version?: 1 } | { body: string;
buttonLabel: string;
footer?: string;
sections: { rows: { description?: string;
id: string;
title: string }[];
title?: string }[];
title?: string;
type: "list";
version?: 1 } | { body: string;
footer?: string;
questions: ({ allowCustomAnswer?: boolean;
id: string;
label: string;
options: { id: string;
label: string }[];
type: "singleSelect" | "multiSelect" })[];
title?: string;
type: "form";
version?: 1 } | { body: string;
cards: ({ actions: ({ id: string;
label: string;
type: "reply" } | { label: string;
type: "url";
url: string } | { label: string;
phoneNumber: string;
type: "call" } | { code: string;
label: string;
type: "copy" })[];
body: string;
header: { filename?: string;
source: string;
title?: string;
type: "image" } })[];
footer?: string;
type: "carousel";
version?: 1 } | { actions?: ({ label: string;
type: "url";
url: string } | { label: string;
phoneNumber: string;
type: "call" } | { code: string;
label: string;
type: "copy" })[];
body: string;
booking: { description?: string;
email?: string;
endAt?: string;
labels?: { addToCalendar?: string;
detailsTitle?: string;
language?: string;
manageBooking?: string;
meetingType?: string;
viewOnMap?: string };
location?: string;
managementUrl?: string;
phoneNumber?: string;
startAt: string;
url?: string };
buttonLabel: string;
footer?: string;
title?: string;
type: "booking";
version?: 1 } | { actions: { name: string;
parameters?: object }[];
body: string;
footer?: string;
header?: { text: string;
type: "text" } | { filename?: string;
source: string;
title?: string;
type: "image" } | { filename?: string;
source: string;
title?: string;
type: "video" } | { filename?: string;
source: string;
title?: string;
type: "document" };
parameters?: object;
type: "native";
version?: 1 }
ReturnsPromise<string>
const result = await client.sendInteractive({ to: "447123456789@c.us", content: {}, });

sendLinkWithAutoPreview

Sends a link with auto-generated preview

client.sendLinkWithAutoPreview(to, url, text?, thumbnail?, quotedMsgId?, customSize?)Parameters (6)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

urlRequired
string

Link URL

text?Optional
stringContent

Message content

Example: "Hello, world!"

Also accepts: body, message, text

thumbnail?Optional
string

Base64 thumbnail override

quotedMsgId?Optional
stringMessageId

Message ID A WhatsApp message identifier

Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

Also accepts: id, msgId

customSize?Optional
{ height: number; width: number }

Custom thumbnail size

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendLinkWithAutoPreview({ to: "447123456789@c.us", url: "url", });
Insiders

sendListMessage

Sends a list/menu message (deprecated)

client.sendListMessage(to, sections, title, description, actionText)Parameters (5)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

sectionsRequired
any[]

List sections

titleRequired
string

List title

descriptionRequired
string

List description

actionTextRequired
string

Action button text

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendListMessage({  to: "447123456789@c.us",  sections: [],  title: "title",  description: "description",  actionText: "actionText",});

sendLocation

Sends a location to a chat

client.sendLocation(to, lat, lng, loc?, address?, url?)Parameters (6)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

latRequired
number | string

Latitude coordinate

Example: 51.5074

lngRequired
number | string

Longitude coordinate

Example: -0.1278

loc?Optional
string

Location name or description

Example: "London, UK"

address?Optional
string

Address text

url?Optional
string

Address link

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendLocation({ to: "447123456789@c.us", lat: 51.5074, lng: -0.1278, });

sendMessageWithThumb

Sends a link preview message with custom thumbnail

client.sendMessageWithThumb(thumb, url, title, description, content, to, quotedMsgId?, customSize?)Parameters (8)
thumbRequired
string

Base64 thumbnail (max 200x200px)

urlRequired
string

Link URL

titleRequired
string

Link title

descriptionRequired
string

Link description

contentRequired
stringContent

Message content

Example: "Hello, world!"

Also accepts: body, message, text

toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

quotedMsgId?Optional
stringMessageId

Message ID A WhatsApp message identifier

Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

Also accepts: id, msgId

customSize?Optional
{ height: number; width: number }

Custom thumbnail size

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendMessageWithThumb({  thumb: "thumb",  url: "url",  title: "title",  description: "description",  content: "Hello, world!",  to: "447123456789@c.us",});

sendMultipleContacts

Sends multiple contacts

client.sendMultipleContacts(to, contactIds)Parameters (2)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

contactIdsRequired
string[]ContactId

A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendMultipleContacts({ to: "447123456789@c.us", contactIds: ["447123456789@c.us"], });

sendPaymentRequest

Sends a payment request message

client.sendPaymentRequest(to, amount, currency, message?)Parameters (4)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

amountRequired
number

Amount in 1000 format (e.g £10 => 10000)

currencyRequired
string

3 letter currency code

message?Optional
string

Optional message

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendPaymentRequest({ to: "447123456789@c.us", amount: 1, currency: "currency", });

sendPoll

Sends a poll message

client.sendPoll(to, name, options, selectableCount?)Parameters (4)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

nameRequired
string

Poll question

optionsRequired
string[]

Poll options (2-12)

selectableCount?Optional
number

Number of selectable options

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendPoll({ to: "447123456789@c.us", name: "name", options: ["Yes", "No"], });

sendPtt

Sends a voice note (push-to-talk) to a chat

client.sendPtt(to, file, quotedMsgId?)Parameters (3)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

fileRequired
stringDataURL

Audio file (path, URL, DataURL, or Base64)

Example: "data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAA..."

quotedMsgId?Optional
stringMessageId

Message ID A WhatsApp message identifier

Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

Also accepts: id, msgId

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendPtt({  to: "447123456789@c.us",  file: "data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAA...",});
Insiders

sendRawMessage

Send a constructed WhatsApp protobuf Message payload (Insiders and above); media must already be uploaded

client.sendRawMessage(to, payload)Parameters (2)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

payloadRequired
object
ReturnsPromise<string>
const result = await client.sendRawMessage({ to: "447123456789@c.us", payload: {}, });

sendReplyWithMentions

Sends a reply to a message that includes @mentions

client.sendReplyWithMentions(to, content, replyMessageId, hideTags?, mentions?)Parameters (5)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

contentRequired
stringContent

Message content

Example: "Hello, world!"

Also accepts: body, message, text

replyMessageIdRequired
stringMessageId

Message ID A WhatsApp message identifier

Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

Also accepts: id, msgId

hideTags?Optional
boolean

Removes all tags within the message

mentions?Optional
string[]

List of mentioned contact IDs

Example: ["447123456789@c.us","441234567890@c.us"]

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendReplyWithMentions({  to: "447123456789@c.us",  content: "Hello, world!",  replyMessageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",});

sendSeen

Mark message as seen

client.sendSeen(chatId)Parameters (1)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<boolean>
const result = await client.sendSeen({ chatId: "447123456789@c.us", });

sendText

Sends a text message to a chat

client.sendText(to, content, options?)Parameters (3)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

contentRequired
stringContent

Message content

Example: "Hello, world!"

Also accepts: body, message, text

options?Optional
unknown

Reserved for compatibility with legacy request shapes. The current sendText Client implementation ignores this argument; use reply() or sendTextWithMentions() for quoted replies and mentions. Accepted as unknown for compatibility; currently ignored by sendText. Use reply() or sendTextWithMentions() for supported reply and mention behavior.

ReturnsPromise<MessageIdReturn | boolean | string>

A successful send returns a message ID as a string; some Easy API responses may serialize it as an object with _serialized. A boolean or a non-ID status string is not a message ID: the current WAPI can return values such as Not a contact or Not able to send message to broadcast. The in-process Client converts Not a contact into a rejected Promise because sending to an unknown number requires a Restricted or Premium license; the method is not otherwise license-gated. The in-process Client is declared as Promise<string | false>. Check returned values before passing them to another method, and handle rejected Promises for input, dispatch, license, or provider errors.

const result = await client.sendText("447123456789@c.us", "Hello, world!");const candidate = typeof result === 'string' ? result : typeof result === 'object' && result !== null && '_serialized' in result ? result._serialized : null;const messageId = typeof candidate === 'string' && /^(true|false)_.+_.+$/.test(candidate) ? candidate : null;if (!messageId) {  throw new Error(`Message was not sent: ${String(result)}`);}console.log('Message ID:', messageId);

sendTextWithMentions

Sends a text message that includes @mentions

client.sendTextWithMentions(to, content, hideTags?, mentions?)Parameters (4)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

contentRequired
stringContent

Message content

Example: "Hello, world!"

Also accepts: body, message, text

hideTags?Optional
boolean

Removes all tags within the message

mentions?Optional
string[]

List of mentioned contact IDs

Example: ["447123456789@c.us","441234567890@c.us"]

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendTextWithMentions({ to: "447123456789@c.us", content: "Hello, world!", });

sendVCard

Sends a contact card (vCard)

client.sendVCard(to, vcard, contactName?, contactNumber?)Parameters (4)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

vcardRequired
string

vCard string

contactName?Optional
string

Contact display name

contactNumber?Optional
string

Contact number with country code

ReturnsPromise<boolean>
const result = await client.sendVCard({ to: "447123456789@c.us", vcard: "vcard", });

sendVideoAsGif

Sends a video as an animated GIF

client.sendVideoAsGif(to, file, filename?, caption?, quotedMsgId?)Parameters (5)
toRequired
stringChatId

Recipient chat ID The target chat for a send operation

Example: "447123456789@c.us"

Also accepts: chatId

fileRequired
stringDataURL

Video file (path, URL, DataURL, or Base64)

Example: "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21..."

filename?Optional
string

Filename with extension

Example: "document.pdf"

caption?Optional
string

Media caption

Example: "Check out this image!"

quotedMsgId?Optional
stringMessageId

Message ID A WhatsApp message identifier

Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

Also accepts: id, msgId

ReturnsPromise<MessageIdReturn | boolean>
const result = await client.sendVideoAsGif({  to: "447123456789@c.us",  file: "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21...",});

setChatEphemeral

Set ephemeral messages for chat

client.setChatEphemeral(chatId, ephemeral)Parameters (2)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ephemeralRequired
boolean | number

Ephemeral setting

ReturnsPromise<boolean>
const result = await client.setChatEphemeral({ chatId: "447123456789@c.us", ephemeral: 1, });

setGroupDescription

Set group description

client.setGroupDescription(groupId, description)Parameters (2)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

descriptionRequired
string

New group description

ReturnsPromise<boolean>
const result = await client.setGroupDescription({  groupId: "447123456789-1445627445@g.us",  description: "description",});

setGroupEditToAdminsOnly

Restrict group editing to admins only

client.setGroupEditToAdminsOnly(groupId, onlyAdmins)Parameters (2)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

onlyAdminsRequired
boolean

Admins only setting

ReturnsPromise<boolean>
const result = await client.setGroupEditToAdminsOnly({  groupId: "447123456789-1445627445@g.us",  onlyAdmins: true,});

setGroupIcon

Set group icon

client.setGroupIcon(groupId, image)Parameters (2)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

imageRequired
string

Image data URL

ReturnsPromise<boolean>
const result = await client.setGroupIcon({ groupId: "447123456789-1445627445@g.us", image: "image", });

setGroupTitle

Set group title

client.setGroupTitle(groupId, title)Parameters (2)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

titleRequired
string

New group title

ReturnsPromise<boolean>
const result = await client.setGroupTitle({ groupId: "447123456789-1445627445@g.us", title: "title", });

setGroupToAdminsOnly

Restrict group to admins only

client.setGroupToAdminsOnly(groupId, onlyAdmins)Parameters (2)
groupIdRequired
stringGroupChatId

Group chat ID A WhatsApp group JID

Example: "447123456789-1445627445@g.us"

Also accepts: chatId, groupChatId

onlyAdminsRequired
boolean

Admins only setting

ReturnsPromise<boolean>
const result = await client.setGroupToAdminsOnly({ groupId: "447123456789-1445627445@g.us", onlyAdmins: true, });

setMyName

Set host name

client.setMyName(name)Parameters (1)
nameRequired
string

Display name

Example: "OpenWA Bot"

Also accepts: newName

ReturnsPromise<boolean>
const result = await client.setMyName({ name: "OpenWA Bot", });

setMyStatus

Set host status

client.setMyStatus(statusText)Parameters (1)
statusTextRequired
string

Status text

Example: "Available"

Also accepts: newStatus

ReturnsPromise<boolean>
const result = await client.setMyStatus({ statusText: "Available", });
Insiders

setProfilePicture

Set profile picture

client.setProfilePicture(image)Parameters (1)
imageRequired
stringDataURL

Image file (path, URL, DataURL, or Base64)

Example: "data:image/png;base64,iVBORw0KGgo..."

ReturnsPromise<boolean>
const result = await client.setProfilePicture({ image: "data:image/png;base64,iVBORw0KGgo...", });

starMessage

Star a message

client.starMessage(messageId)Parameters (1)
messageIdRequired
stringMessageId

Message ID A WhatsApp message identifier

Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

Also accepts: id, msgId

ReturnsPromise<boolean>
const result = await client.starMessage({  messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",});

unarchiveChat

Unarchive a chat

client.unarchiveChat(chatId)Parameters (1)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<boolean>
const result = await client.unarchiveChat({ chatId: "447123456789@c.us", });

unblockContact

Unblock a contact

client.unblockContact(contactId)Parameters (1)
contactIdRequired
stringContactId

Contact ID A WhatsApp contact JID

Example: "447123456789@c.us"

Also accepts: id

ReturnsPromise<boolean>
const result = await client.unblockContact({ contactId: "447123456789@c.us", });

unmuteChat

Unmute a chat

client.unmuteChat(chatId)Parameters (1)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<string | boolean | number>
const result = await client.unmuteChat({ chatId: "447123456789@c.us", });

unpinChat

Unpin a chat

client.unpinChat(chatId)Parameters (1)
chatIdRequired
stringChatId

Chat ID (phone number or formatted ID) A contact ID, group ID, or LID JID

Example: "447123456789@c.us"

Also accepts: contactId, id

ReturnsPromise<boolean>
const result = await client.unpinChat({ chatId: "447123456789@c.us", });

unstarMessage

Unstar a message

client.unstarMessage(messageId)Parameters (1)
messageIdRequired
stringMessageId

Message ID A WhatsApp message identifier

Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

Also accepts: id, msgId

ReturnsPromise<boolean>
const result = await client.unstarMessage({  messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",});
Plain-text method index
MethodNamespaceDescriptionLicense
addLabellabelsAdd label to chat-
addParticipantgroupsAdd participant to group-
approveGroupJoinRequestgroupsApprove group join request-
archiveChatchatsArchive a chat-
blockContactcontactsBlock a contact-
checkNumberStatuscontactsCheck if number is on WhatsAppinsiders
checkReadReceiptscontactsCheck read receipts setting-
clearChatchatsClear chat history-
createGroupgroupsCreate new grouprestricted
decryptMediamediaDecrypts media from a message-
deleteAllStatusstatusDelete all statusesinsiders
deleteChatchatsDelete a chat-
deleteMessagemessagesDeletes a message-
deleteStatusstatusDelete statusinsiders
demoteParticipantgroupsDemote participant from admin-
downloadMediamediaDownloads and decrypts media from a message to a file-
forwardMessagesmessagesForwards messages to a chat-
getAllChatIdschatIdsGet all chat IDs-
getAllChatschatsReturns serialized Chat objects from the current session, optionally limited to chats with unread messages.-
getAllCommunitiescommunitiesGet all communities-
getAllContactscontactsRetrieves all contacts-
getAllGroupsgroupsGet all groups-
getAllLabelslabelsGet all labels-
getAllMessagesmessagesRetrieves all messages in the session-
getBatteryLevelsessionGet phone battery level-
getBlockedIdscontactsGet blocked contact IDs-
getBusinessProductsbusinessGet business products-
getBusinessProfilebusinessGet business profile-
getChatchatsGet specific chat by ID-
getChatsByLabellabelsGet chats by label-
getChatWithNonContactschatsGet chats with non-contacts-
getCommonGroupscontactsGet common groups with contact-
getCommunityAdminIdscommunitiesGet community admin IDs-
getCommunityAdminscommunitiesGet community admins-
getCommunityInfocommunitiesGet community metadata-
getCommunityParticipantIdscommunitiesGet community participant IDs-
getCommunityParticipantscommunitiesGet community participants-
getConnectionStatesessionGet connection state-
getContactcontactsGet specific contact-
getFeaturessessionGet enabled features-
getGroupAdminsgroupsGet group admins-
getGroupInfogroupsGet group metadata-
getGroupInviteLinkgroupsGet group invite link-
getGroupMembersgroupsRetrieves members of a group-
getGroupMembersIdgroupsGet group member IDs-
getHostNumbersessionGet host phone number-
getKickedGroupsgroupsGet groups where kicked-
getLicenseTypesessionGet license type-
getLoadedMessageCountsessionGet loaded message count-
getMesessionGet host account info-
getMessageByIdmessagesRetrieves a specific message by ID-
getMessageInfomessagesGet message delivery info-
getMessagesForLLMmessagesGet messages formatted for LLMs-
getMyLastMessagemessagesGet last message sent by host-
getNumberProfilecontactsGet profile of numberinsiders
getOrderbusinessGet order detailsinsiders
getProcessStatssessionGet process statistics-
getProfilePicturecontactsGet profile picture from server-
getSnapshotsessionTake screenshot-
getStarredMessagesmessagesGet starred messagesinsiders
getStatusmystatusGet specific statusinsiders
getStoriesstatusGet all storiesinsiders
getUnsentMessagesmessagesGet unsent/pending messages-
getUserAgentsessionGet user agent-
getVCardsmessagesExtract vCards from message-
getWAVersionsessionGet WhatsApp Web version-
healthChecksessionHealth check-
isChatOnlinechatsCheck if chat is online-
isPluggedsessionCheck if phone is charging-
joinGroupViaLinkgroupsJoin group via invite linkrestricted
leaveGroupgroupsLeave a group-
loadEarlierMessagesmessagesLoads earlier messages from a chat-
markAsReadchatsMark chat as read-
markAsUnreadchatsMark chat as unread-
muteChatchatsMute a chat-
pinChatchatsPin a chat-
postImageStatusstatusPost image statusinsiders
postTextStatusstatusPost text statusinsiders
postVideoStatusstatusPost video statusinsiders
promoteParticipantgroupsPromote participant to admin-
reactmessagesReact to message with emoji-
rejectGroupJoinRequestgroupsReject group join request-
removeLabellabelsRemove label from chat-
removeParticipantgroupsRemove participant from group-
revokeGroupInviteLinkgroupsRevoke group invite link-
sendAdvancedButtonsmessagesSends an advanced button message with media (deprecated)insiders
sendAudiomessagesSends an audio file to a chat-
sendBannermessagesSends a banner image-
sendButtonsmessagesSends a button message (deprecated)insiders
sendContactmessagesSends a single contact-
sendFilemessagesSends a file or document to a chat-
sendFileFromUrlmessagesDownloads a file from a URL and sends it to a chat-
sendImagemessagesSends an image to a chat-
sendInteractivemessagesSend a portable interactive message document (Insiders and above)insiders
sendLinkWithAutoPreviewmessagesSends a link with auto-generated preview-
sendListMessagemessagesSends a list/menu message (deprecated)insiders
sendLocationmessagesSends a location to a chat-
sendMessageWithThumbmessagesSends a link preview message with custom thumbnail-
sendMultipleContactsmessagesSends multiple contacts-
sendPaymentRequestmessagesSends a payment request message-
sendPollmessagesSends a poll message-
sendPttmessagesSends a voice note (push-to-talk) to a chat-
sendRawMessagemessagesSend a constructed WhatsApp protobuf Message payload (Insiders and above); media must already be uploadedinsiders
sendReplyWithMentionsmessagesSends a reply to a message that includes @mentions-
sendSeenmessagesMark message as seen-
sendTextmessagesSends a text message to a chat-
sendTextWithMentionsmessagesSends a text message that includes @mentions-
sendVCardmessagesSends a contact card (vCard)-
sendVideoAsGifmessagesSends a video as an animated GIF-
sendYouTubeLinkmessagesSends a YouTube link with auto-generated preview-
setChatEphemeralchatsSet ephemeral messages for chat-
setGroupDescriptiongroupsSet group description-
setGroupEditToAdminsOnlygroupsRestrict group editing to admins only-
setGroupIcongroupsSet group icon-
setGroupTitlegroupsSet group title-
setGroupToAdminsOnlygroupsRestrict group to admins only-
setMyNamesessionSet host name-
setMyStatussessionSet host status-
setProfilePicturesessionSet profile pictureinsiders
starMessagemessagesStar a message-
unarchiveChatchatsUnarchive a chat-
unblockContactcontactsUnblock a contact-
unmuteChatchatsUnmute a chat-
unpinChatchatsUnpin a chat-
unstarMessagemessagesUnstar a message-

Was this helpful?

Your answer includes the page path and docs version.