Client API
Client methods, return values, and examples.
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');Add label to chat
client.addLabel(label, chatId)Parameters (2)
labelRequiredstringLabel ID or name
chatIdRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
Promise<boolean>const result = await client.addLabel({ label: "label", chatId: "447123456789@c.us", });Add participant to group
client.addParticipant(groupId, contactId)Parameters (2)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<boolean>const result = await client.addParticipant({ groupId: "447123456789-1445627445@g.us", contactId: "447123456789@c.us",});Approve group join request
client.approveGroupJoinRequest(groupId, contactId)Parameters (2)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<string | boolean>const result = await client.approveGroupJoinRequest({ groupId: "447123456789-1445627445@g.us", contactId: "447123456789@c.us",});Archive a chat
client.archiveChat(chatId)Parameters (1)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<boolean>const result = await client.archiveChat({ chatId: "447123456789@c.us", });Block a contact
client.blockContact(contactId)Parameters (1)
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<boolean>const result = await client.blockContact({ contactId: "447123456789@c.us", });Check if number is on WhatsApp
client.checkNumberStatus(contactId)Parameters (1)
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<NumberCheck>const result = await client.checkNumberStatus({ contactId: "447123456789@c.us", });Check read receipts setting
client.checkReadReceipts(contactId)Parameters (1)
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<boolean | string>const result = await client.checkReadReceipts({ contactId: "447123456789@c.us", });Clear chat history
client.clearChat(chatId)Parameters (1)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<boolean>const result = await client.clearChat({ chatId: "447123456789@c.us", });Create new group
client.createGroup(name, contacts)Parameters (2)
nameRequiredstringGroup name
contactsRequiredstring[]ContactIdContact IDs to add A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<GroupCreationResult | null>const result = await client.createGroup({ name: "name", contacts: ["447123456789@c.us"], });Decrypts media from a message
client.decryptMedia(message)Parameters (1)
messageRequiredObject · 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
Promise<DataURL>// Use the full media message received by your message handler.const result = await client.decryptMedia({ message });Delete all statuses
client.deleteAllStatus()No parameters
Call this method without arguments.
Promise<boolean>const result = await client.deleteAllStatus();Delete a chat
client.deleteChat(chatId)Parameters (1)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<boolean>const result = await client.deleteChat({ chatId: "447123456789@c.us", });Deletes a message
client.deleteMessage(chatId, messageId, onlyLocal?)Parameters (3)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
messageIdRequiredstring[] | stringMessageId[]Message ID(s) to process
Example: ["false_447123456789@c.us_ABC123","false_447123456789@c.us_DEF456"]
Also accepts: messages
onlyLocal?OptionalbooleanDelete only locally
Promise<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"],});Delete status
client.deleteStatus(statusesToDelete)Parameters (1)
statusesToDeleteRequiredstring | string[]Status ID(s)
Promise<boolean>const result = await client.deleteStatus({ statusesToDelete: [], });Demote participant from admin
client.demoteParticipant(groupId, contactId)Parameters (2)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<boolean | string>const result = await client.demoteParticipant({ groupId: "447123456789-1445627445@g.us", contactId: "447123456789@c.us",});Downloads and decrypts media from a message to a file
client.downloadMedia(message, path)Parameters (2)
messageRequiredObject · 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
pathRequiredstringFile path to save the media
Promise<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" });Forwards messages to a chat
client.forwardMessages(to, messages, skipMyMessages?)Parameters (3)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
messagesRequiredstring[] | stringMessageId[]Message ID(s) to process
Example: ["false_447123456789@c.us_ABC123","false_447123456789@c.us_DEF456"]
Also accepts: messages
skipMyMessages?OptionalbooleanSkip own messages
Example: false
Promise<MessageIdReturn[] | boolean>const result = await client.forwardMessages({ to: "447123456789@c.us", messages: ["false_447123456789@c.us_ABC123","false_447123456789@c.us_DEF456"],});Get all chat IDs
client.getAllChatIds()No parameters
Call this method without arguments.
Promise<ChatId[]>Opaque conversation identifier. Use the exact value returned by a message event or chat lookup.
const result = await client.getAllChatIds();Returns serialized Chat objects from the current session, optionally limited to chats with unread messages.
client.getAllChats(withNewMessagesOnly?)Parameters (1)
withNewMessagesOnly?OptionalbooleanOnly chats with unread messages
Example: false
Promise<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();Get all communities
client.getAllCommunities()No parameters
Call this method without arguments.
Promise<GroupChatId[]>Opaque group conversation identifier returned by a group lookup or join method.
const result = await client.getAllCommunities();Retrieves all contacts
client.getAllContacts()No parameters
Call this method without arguments.
Promise<Contact[]>const result = await client.getAllContacts();Get all groups
client.getAllGroups(withNewMessagesOnly?)Parameters (1)
withNewMessagesOnly?OptionalbooleanOnly chats with unread messages
Example: false
Promise<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();Get all labels
client.getAllLabels()No parameters
Call this method without arguments.
Promise<Label[]>const result = await client.getAllLabels();Retrieves all messages in the session
client.getAllMessages(chatId?, includeMe?, includeNotifications?)Parameters (3)
chatId?OptionalstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
includeMe?OptionalbooleanInclude own messages
includeNotifications?OptionalbooleanInclude notification messages
Promise<Message[]>const result = await client.getAllMessages();Get phone battery level
client.getBatteryLevel()No parameters
Call this method without arguments.
Promise<number>const result = await client.getBatteryLevel();Get blocked contact IDs
client.getBlockedIds()No parameters
Call this method without arguments.
Promise<ContactId[] | false>const result = await client.getBlockedIds();Get business products
client.getBusinessProducts(contactId)Parameters (1)
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<Product[] | false>const result = await client.getBusinessProducts({ contactId: "447123456789@c.us", });Get business profile
client.getBusinessProfile(contactId)Parameters (1)
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<BusinessProfile>const result = await client.getBusinessProfile({ contactId: "447123456789@c.us", });Get specific chat by ID
client.getChat(chatId)Parameters (1)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<Chat | null | undefined | false>const result = await client.getChat({ chatId: "447123456789@c.us", });Get chats by label
client.getChatsByLabel(label)Parameters (1)
labelRequiredstringLabel name
Promise<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", });Get chats with non-contacts
client.getChatWithNonContacts()No parameters
Call this method without arguments.
Promise<Contact[]>const result = await client.getChatWithNonContacts();Get common groups with contact
client.getCommonGroups(contactId)Parameters (1)
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<CommonGroup[] | false>const result = await client.getCommonGroups({ contactId: "447123456789@c.us", });Get community admin IDs
client.getCommunityAdminIds(communityId)Parameters (1)
communityIdRequiredstringGroupChatIdCommunity ID A WhatsApp community JID
Example: "447123456789-1445627445@g.us"
Promise<CommunityAdminIds[]>const result = await client.getCommunityAdminIds({ communityId: "447123456789-1445627445@g.us", });Get community admins
client.getCommunityAdmins(communityId)Parameters (1)
communityIdRequiredstringGroupChatIdCommunity ID A WhatsApp community JID
Example: "447123456789-1445627445@g.us"
Promise<CommunityAdmins[]>const result = await client.getCommunityAdmins({ communityId: "447123456789-1445627445@g.us", });Get community metadata
client.getCommunityInfo(communityId)Parameters (1)
communityIdRequiredstringGroupChatIdCommunity ID A WhatsApp community JID
Example: "447123456789-1445627445@g.us"
Promise<CommunityMetadata>const result = await client.getCommunityInfo({ communityId: "447123456789-1445627445@g.us", });Get community participant IDs
client.getCommunityParticipantIds(communityId)Parameters (1)
communityIdRequiredstringGroupChatIdCommunity ID A WhatsApp community JID
Example: "447123456789-1445627445@g.us"
Promise<CommunityParticipantIds[]>const result = await client.getCommunityParticipantIds({ communityId: "447123456789-1445627445@g.us", });Get community participants
client.getCommunityParticipants(communityId)Parameters (1)
communityIdRequiredstringGroupChatIdCommunity ID A WhatsApp community JID
Example: "447123456789-1445627445@g.us"
Promise<CommunityParticipants[]>const result = await client.getCommunityParticipants({ communityId: "447123456789-1445627445@g.us", });Get connection state
client.getConnectionState()No parameters
Call this method without arguments.
Promise<string>const result = await client.getConnectionState();Get specific contact
client.getContact(contactId)Parameters (1)
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<Contact | null>const result = await client.getContact({ contactId: "447123456789@c.us", });Get enabled features
client.getFeatures()No parameters
Call this method without arguments.
Promise<FeatureFlags>WhatsApp feature flags keyed by name. Values are provider-defined and must be narrowed before use.
const result = await client.getFeatures();Get group admins
client.getGroupAdmins(groupId)Parameters (1)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
Promise<ContactId[]>Opaque WhatsApp contact identifier. Preserve the exact value returned by the API.
const result = await client.getGroupAdmins({ groupId: "447123456789-1445627445@g.us", });Get group metadata
client.getGroupInfo(groupId)Parameters (1)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
Promise<GroupMetadata | null>const result = await client.getGroupInfo({ groupId: "447123456789-1445627445@g.us", });Get group invite link
client.getGroupInviteLink(groupId)Parameters (1)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
Promise<string>const result = await client.getGroupInviteLink({ groupId: "447123456789-1445627445@g.us", });Retrieves members of a group
client.getGroupMembers(groupId)Parameters (1)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
Promise<Contact[]>const result = await client.getGroupMembers({ groupId: "447123456789-1445627445@g.us", });Get group member IDs
client.getGroupMembersId(groupId)Parameters (1)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
Promise<ContactId[]>Opaque WhatsApp contact identifier. Preserve the exact value returned by the API.
const result = await client.getGroupMembersId({ groupId: "447123456789-1445627445@g.us", });Get host phone number
client.getHostNumber()No parameters
Call this method without arguments.
Promise<string>const result = await client.getHostNumber();Get groups where kicked
client.getKickedGroups()No parameters
Call this method without arguments.
Promise<GroupChatId[]>Opaque group conversation identifier returned by a group lookup or join method.
const result = await client.getKickedGroups();Get license type
client.getLicenseType()No parameters
Call this method without arguments.
Promise<LicenseType | false>const result = await client.getLicenseType();Get loaded message count
client.getLoadedMessageCount()No parameters
Call this method without arguments.
Promise<number>const result = await client.getLoadedMessageCount();Get host account info
client.getMe()No parameters
Call this method without arguments.
Promise<HostAccount>Host account attributes plus the current account ID. Additional WhatsApp Web attributes vary by version.
const result = await client.getMe();Retrieves a specific message by ID
client.getMessageById(messageId)Parameters (1)
messageIdRequiredstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
Promise<Message | null | false>const result = await client.getMessageById({ messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",});Get message delivery info
client.getMessageInfo(messageId)Parameters (1)
messageIdRequiredstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
Promise<MessageInfo>const result = await client.getMessageInfo({ messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",});Get messages formatted for LLMs
client.getMessagesForLLM(chatId, last?)Parameters (2)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
last?OptionalnumberPromise<LLMMessage[]>const result = await client.getMessagesForLLM({ chatId: "447123456789@c.us", });Get last message sent by host
client.getMyLastMessage(chatId?)Parameters (1)
chatId?OptionalstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<Message | undefined>const result = await client.getMyLastMessage();Get profile of number
client.getNumberProfile(contactId)Parameters (1)
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<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", });Get process statistics
client.getProcessStats()No parameters
Call this method without arguments.
Promise<ProcessStats>Process diagnostics keyed by process ID. The provider controls each entry; no stable entry shape is guaranteed.
const result = await client.getProcessStats();Get profile picture from server
client.getProfilePicture(chatId)Parameters (1)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<string>const result = await client.getProfilePicture({ chatId: "447123456789@c.us", });Take screenshot
client.getSnapshot(chatId?, width?, height?)Parameters (3)
chatId?OptionalstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
width?Optionalnumberheight?OptionalnumberPromise<string>const result = await client.getSnapshot();Get specific status
client.getStatus(contactId)Parameters (1)
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<ContactStatus>const result = await client.getStatus({ contactId: "447123456789@c.us", });Get all stories
client.getStories()No parameters
Call this method without arguments.
Promise<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();Get unsent/pending messages
client.getUnsentMessages()No parameters
Call this method without arguments.
Promise<Message[]>const result = await client.getUnsentMessages();Get user agent
client.getUserAgent(userAgent?)Parameters (1)
userAgent?OptionalstringUser agent string
Example: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
Also accepts: userA
Promise<string>const result = await client.getUserAgent();Extract vCards from message
client.getVCards(messageId)Parameters (1)
messageIdRequiredstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
Promise<string[]>const result = await client.getVCards({ messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB", });Get WhatsApp Web version
client.getWAVersion()No parameters
Call this method without arguments.
Promise<string>const result = await client.getWAVersion();Health check
client.healthCheck()No parameters
Call this method without arguments.
Promise<HealthCheck>Browser health diagnostics. This is not the Easy API /health HTTP envelope.
const result = await client.healthCheck();Check if chat is online
client.isChatOnline(chatId)Parameters (1)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<boolean | string>const result = await client.isChatOnline({ chatId: "447123456789@c.us", });Check if phone is charging
client.isPlugged()No parameters
Call this method without arguments.
Promise<boolean>const result = await client.isPlugged();Join group via invite link
client.joinGroupViaLink(link, returnChatObj?)Parameters (2)
linkRequiredstringGroup invite link
returnChatObj?OptionalbooleanReturn chat object
Promise<GroupChatId | boolean | number | Chat>const result = await client.joinGroupViaLink({ link: "link", });Leave a group
client.leaveGroup(groupId)Parameters (1)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
Promise<void>const result = await client.leaveGroup({ groupId: "447123456789-1445627445@g.us", });Loads earlier messages from a chat
client.loadEarlierMessages(chatId, count?, includeMe?)Parameters (3)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
count?OptionalnumberNumber of messages to load (default: 20)
includeMe?OptionalbooleanWhether to include messages from the host account (default: false)
Promise<Message[]>const result = await client.loadEarlierMessages({ chatId: "447123456789@c.us", });Mark chat as read
client.markAsRead(chatId)Parameters (1)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<boolean>const result = await client.markAsRead({ chatId: "447123456789@c.us", });Mark chat as unread
client.markAsUnread(chatId)Parameters (1)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<boolean>const result = await client.markAsUnread({ chatId: "447123456789@c.us", });Mute a chat
client.muteChat(chatId, muteDuration)Parameters (2)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
muteDurationRequirednumber | stringMute duration
Promise<string | boolean | number>const result = await client.muteChat({ chatId: "447123456789@c.us", muteDuration: 1, });Pin a chat
client.pinChat(chatId)Parameters (1)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<boolean>const result = await client.pinChat({ chatId: "447123456789@c.us", });Post image status
client.postImageStatus(image, caption?)Parameters (2)
imageRequiredstringImage data URL
caption?OptionalstringStatus caption
Promise<MessageId | string | boolean>const result = await client.postImageStatus({ image: "image", });Post text status
client.postTextStatus(text, backgroundColor?, font?)Parameters (3)
textRequiredstringStatus text
backgroundColor?OptionalstringBackground color
font?OptionalnumberFont style
Promise<MessageId | string | boolean>const result = await client.postTextStatus({ text: "text", });Post video status
client.postVideoStatus(video, caption?)Parameters (2)
videoRequiredstringVideo data URL
caption?OptionalstringStatus caption
Promise<MessageId | string | boolean>const result = await client.postVideoStatus({ video: "video", });Promote participant to admin
client.promoteParticipant(groupId, contactId)Parameters (2)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<boolean | string>const result = await client.promoteParticipant({ groupId: "447123456789-1445627445@g.us", contactId: "447123456789@c.us",});React to message with emoji
client.react(messageId, emoji)Parameters (2)
messageIdRequiredstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
emojiRequiredstringEmoji reaction
Promise<boolean>const result = await client.react({ messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB", emoji: "emoji",});Reject group join request
client.rejectGroupJoinRequest(groupId, contactId)Parameters (2)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<string | boolean>const result = await client.rejectGroupJoinRequest({ groupId: "447123456789-1445627445@g.us", contactId: "447123456789@c.us",});Remove label from chat
client.removeLabel(label, chatId)Parameters (2)
labelRequiredstringLabel ID or name
chatIdRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
Promise<boolean>const result = await client.removeLabel({ label: "label", chatId: "447123456789@c.us", });Remove participant from group
client.removeParticipant(groupId, contactId)Parameters (2)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<boolean>const result = await client.removeParticipant({ groupId: "447123456789-1445627445@g.us", contactId: "447123456789@c.us",});Revoke group invite link
client.revokeGroupInviteLink(groupId)Parameters (1)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
Promise<string | boolean>const result = await client.revokeGroupInviteLink({ groupId: "447123456789-1445627445@g.us", });Sends an advanced button message with media (deprecated)
client.sendAdvancedButtons(to, body?, buttons, text, footer, filename)Parameters (6)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
body?Optionalstring | anyMessage body, location, or media
buttonsRequiredany[]Array of advanced buttons (max 3)
textRequiredstringMessage text
footerRequiredstringMessage footer
filenameRequiredstringFilename if body is a file
Promise<MessageIdReturn | boolean>const result = await client.sendAdvancedButtons({ to: "447123456789@c.us", buttons: [], text: "text", footer: "footer", filename: "filename",});Sends an audio file to a chat
client.sendAudio(to, file, filename?, quotedMsgId?)Parameters (4)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
fileRequiredstringDataURLAudio file (path, URL, DataURL, or Base64)
Example: "data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAA..."
filename?OptionalstringFilename with extension
Example: "document.pdf"
quotedMsgId?OptionalstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
Promise<MessageIdReturn | boolean>const result = await client.sendAudio({ to: "447123456789@c.us", file: "data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAA...",});Sends a banner image
client.sendBanner(to, base64)Parameters (2)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
base64RequiredstringBase64 encoded JPEG
Promise<MessageIdReturn | boolean>const result = await client.sendBanner({ to: "447123456789@c.us", base64: "base64", });Sends a button message (deprecated)
client.sendButtons(to, body?, buttons, title?, footer?)Parameters (5)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
body?Optionalstring | anyMessage body or location
buttonsRequiredany[]Array of buttons (max 3)
title?OptionalstringMessage title
footer?OptionalstringMessage footer
Promise<MessageIdReturn | boolean>const result = await client.sendButtons({ to: "447123456789@c.us", buttons: [], });Sends a single contact
client.sendContact(to, contactId)Parameters (2)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
contactIdRequiredstring | string[]Promise<MessageIdReturn | boolean | void>const result = await client.sendContact({ to: "447123456789@c.us", contactId: "447123456789@c.us", });Sends a file or document to a chat
client.sendFile(to, file, filename?, caption?)Parameters (4)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
fileRequiredstringDataURLFile (path, URL, DataURL, Base64, or Buffer)
Example: "data:application/pdf;base64,JVBERi0xLjQK..."
filename?OptionalstringFilename with extension
Example: "document.pdf"
caption?OptionalstringMedia caption
Example: "Check out this image!"
Promise<MessageIdReturn | string>const result = await client.sendFile({ to: "447123456789@c.us", file: "data:application/pdf;base64,JVBERi0xLjQK...",});Downloads a file from a URL and sends it to a chat
client.sendFileFromUrl(to, url, filename, caption?, headers?)Parameters (5)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
urlRequiredstringURL of the file to download
filenameRequiredstringFilename for the sent file
caption?OptionalstringCaption for the file
headers?OptionalobjectHTTP headers for the download request
Promise<string | boolean>Message ID or success status
const result = await client.sendFileFromUrl({ to: "447123456789@c.us", url: "url", filename: "filename", });Sends an image to a chat
client.sendImage(to, imgData, filename?, caption?, id?, waitForId?)Parameters (6)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
imgDataRequiredstringDataURLImage file (path, URL, DataURL, or Base64)
Example: "data:image/png;base64,iVBORw0KGgo..."
filename?OptionalstringFilename with extension
Example: "document.pdf"
caption?OptionalstringMedia caption
Example: "Check out this image!"
id?OptionalstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
waitForId?OptionalbooleanWait for message ID
Example: true
Promise<MessageIdReturn | boolean | string>const result = await client.sendImage({ to: "447123456789@c.us", imgData: "data:image/png;base64,iVBORw0KGgo...",});Send a portable interactive message document (Insiders and above)
client.sendInteractive(to, content)Parameters (2)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
contentRequiredObject · 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 }Promise<string>const result = await client.sendInteractive({ to: "447123456789@c.us", content: {}, });Sends a link with auto-generated preview
client.sendLinkWithAutoPreview(to, url, text?, thumbnail?, quotedMsgId?, customSize?)Parameters (6)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
urlRequiredstringLink URL
text?OptionalstringContentMessage content
Example: "Hello, world!"
Also accepts: body, message, text
thumbnail?OptionalstringBase64 thumbnail override
quotedMsgId?OptionalstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
customSize?Optional{ height: number; width: number }Custom thumbnail size
Promise<MessageIdReturn | boolean>const result = await client.sendLinkWithAutoPreview({ to: "447123456789@c.us", url: "url", });Sends a list/menu message (deprecated)
client.sendListMessage(to, sections, title, description, actionText)Parameters (5)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
sectionsRequiredany[]List sections
titleRequiredstringList title
descriptionRequiredstringList description
actionTextRequiredstringAction button text
Promise<MessageIdReturn | boolean>const result = await client.sendListMessage({ to: "447123456789@c.us", sections: [], title: "title", description: "description", actionText: "actionText",});Sends a location to a chat
client.sendLocation(to, lat, lng, loc?, address?, url?)Parameters (6)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
latRequirednumber | stringLatitude coordinate
Example: 51.5074
lngRequirednumber | stringLongitude coordinate
Example: -0.1278
loc?OptionalstringLocation name or description
Example: "London, UK"
address?OptionalstringAddress text
url?OptionalstringAddress link
Promise<MessageIdReturn | boolean>const result = await client.sendLocation({ to: "447123456789@c.us", lat: 51.5074, lng: -0.1278, });Sends a link preview message with custom thumbnail
client.sendMessageWithThumb(thumb, url, title, description, content, to, quotedMsgId?, customSize?)Parameters (8)
thumbRequiredstringBase64 thumbnail (max 200x200px)
urlRequiredstringLink URL
titleRequiredstringLink title
descriptionRequiredstringLink description
contentRequiredstringContentMessage content
Example: "Hello, world!"
Also accepts: body, message, text
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
quotedMsgId?OptionalstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
customSize?Optional{ height: number; width: number }Custom thumbnail size
Promise<MessageIdReturn | boolean>const result = await client.sendMessageWithThumb({ thumb: "thumb", url: "url", title: "title", description: "description", content: "Hello, world!", to: "447123456789@c.us",});Sends multiple contacts
client.sendMultipleContacts(to, contactIds)Parameters (2)
Promise<MessageIdReturn | boolean>const result = await client.sendMultipleContacts({ to: "447123456789@c.us", contactIds: ["447123456789@c.us"], });Sends a payment request message
client.sendPaymentRequest(to, amount, currency, message?)Parameters (4)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
amountRequirednumberAmount in 1000 format (e.g £10 => 10000)
currencyRequiredstring3 letter currency code
message?OptionalstringOptional message
Promise<MessageIdReturn | boolean>const result = await client.sendPaymentRequest({ to: "447123456789@c.us", amount: 1, currency: "currency", });Sends a poll message
client.sendPoll(to, name, options, selectableCount?)Parameters (4)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
nameRequiredstringPoll question
optionsRequiredstring[]Poll options (2-12)
selectableCount?OptionalnumberNumber of selectable options
Promise<MessageIdReturn | boolean>const result = await client.sendPoll({ to: "447123456789@c.us", name: "name", options: ["Yes", "No"], });Sends a voice note (push-to-talk) to a chat
client.sendPtt(to, file, quotedMsgId?)Parameters (3)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
fileRequiredstringDataURLAudio file (path, URL, DataURL, or Base64)
Example: "data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAA..."
quotedMsgId?OptionalstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
Promise<MessageIdReturn | boolean>const result = await client.sendPtt({ to: "447123456789@c.us", file: "data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAA...",});Send a constructed WhatsApp protobuf Message payload (Insiders and above); media must already be uploaded
client.sendRawMessage(to, payload)Parameters (2)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
payloadRequiredobjectPromise<string>const result = await client.sendRawMessage({ to: "447123456789@c.us", payload: {}, });Sends a reply to a message that includes @mentions
client.sendReplyWithMentions(to, content, replyMessageId, hideTags?, mentions?)Parameters (5)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
contentRequiredstringContentMessage content
Example: "Hello, world!"
Also accepts: body, message, text
replyMessageIdRequiredstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
hideTags?OptionalbooleanRemoves all tags within the message
mentions?Optionalstring[]List of mentioned contact IDs
Example: ["447123456789@c.us","441234567890@c.us"]
Promise<MessageIdReturn | boolean>const result = await client.sendReplyWithMentions({ to: "447123456789@c.us", content: "Hello, world!", replyMessageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",});Mark message as seen
client.sendSeen(chatId)Parameters (1)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<boolean>const result = await client.sendSeen({ chatId: "447123456789@c.us", });Sends a text message to a chat
client.sendText(to, content, options?)Parameters (3)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
contentRequiredstringContentMessage content
Example: "Hello, world!"
Also accepts: body, message, text
options?OptionalunknownReserved 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.
Promise<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);Sends a text message that includes @mentions
client.sendTextWithMentions(to, content, hideTags?, mentions?)Parameters (4)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
contentRequiredstringContentMessage content
Example: "Hello, world!"
Also accepts: body, message, text
hideTags?OptionalbooleanRemoves all tags within the message
mentions?Optionalstring[]List of mentioned contact IDs
Example: ["447123456789@c.us","441234567890@c.us"]
Promise<MessageIdReturn | boolean>const result = await client.sendTextWithMentions({ to: "447123456789@c.us", content: "Hello, world!", });Sends a contact card (vCard)
client.sendVCard(to, vcard, contactName?, contactNumber?)Parameters (4)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
vcardRequiredstringvCard string
contactName?OptionalstringContact display name
contactNumber?OptionalstringContact number with country code
Promise<boolean>const result = await client.sendVCard({ to: "447123456789@c.us", vcard: "vcard", });Sends a video as an animated GIF
client.sendVideoAsGif(to, file, filename?, caption?, quotedMsgId?)Parameters (5)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
fileRequiredstringDataURLVideo file (path, URL, DataURL, or Base64)
Example: "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21..."
filename?OptionalstringFilename with extension
Example: "document.pdf"
caption?OptionalstringMedia caption
Example: "Check out this image!"
quotedMsgId?OptionalstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
Promise<MessageIdReturn | boolean>const result = await client.sendVideoAsGif({ to: "447123456789@c.us", file: "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21...",});Sends a YouTube link with auto-generated preview
client.sendYouTubeLink(to, url, text?, thumbnail?, quotedMsgId?, customSize?)Parameters (6)
toRequiredstringChatIdRecipient chat ID The target chat for a send operation
Example: "447123456789@c.us"
Also accepts: chatId
urlRequiredstringYouTube URL
text?OptionalstringContentMessage content
Example: "Hello, world!"
Also accepts: body, message, text
thumbnail?OptionalstringBase64 thumbnail override
quotedMsgId?OptionalstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
customSize?Optional{ height: number; width: number }Custom thumbnail size
Promise<MessageIdReturn | boolean>const result = await client.sendYouTubeLink({ to: "447123456789@c.us", url: "url", });Set ephemeral messages for chat
client.setChatEphemeral(chatId, ephemeral)Parameters (2)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
ephemeralRequiredboolean | numberEphemeral setting
Promise<boolean>const result = await client.setChatEphemeral({ chatId: "447123456789@c.us", ephemeral: 1, });Set group description
client.setGroupDescription(groupId, description)Parameters (2)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
descriptionRequiredstringNew group description
Promise<boolean>const result = await client.setGroupDescription({ groupId: "447123456789-1445627445@g.us", description: "description",});Restrict group editing to admins only
client.setGroupEditToAdminsOnly(groupId, onlyAdmins)Parameters (2)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
onlyAdminsRequiredbooleanAdmins only setting
Promise<boolean>const result = await client.setGroupEditToAdminsOnly({ groupId: "447123456789-1445627445@g.us", onlyAdmins: true,});Set group icon
client.setGroupIcon(groupId, image)Parameters (2)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
imageRequiredstringImage data URL
Promise<boolean>const result = await client.setGroupIcon({ groupId: "447123456789-1445627445@g.us", image: "image", });Set group title
client.setGroupTitle(groupId, title)Parameters (2)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
titleRequiredstringNew group title
Promise<boolean>const result = await client.setGroupTitle({ groupId: "447123456789-1445627445@g.us", title: "title", });Restrict group to admins only
client.setGroupToAdminsOnly(groupId, onlyAdmins)Parameters (2)
groupIdRequiredstringGroupChatIdGroup chat ID A WhatsApp group JID
Example: "447123456789-1445627445@g.us"
Also accepts: chatId, groupChatId
onlyAdminsRequiredbooleanAdmins only setting
Promise<boolean>const result = await client.setGroupToAdminsOnly({ groupId: "447123456789-1445627445@g.us", onlyAdmins: true, });Set host name
client.setMyName(name)Parameters (1)
nameRequiredstringDisplay name
Example: "OpenWA Bot"
Also accepts: newName
Promise<boolean>const result = await client.setMyName({ name: "OpenWA Bot", });Set host status
client.setMyStatus(statusText)Parameters (1)
statusTextRequiredstringStatus text
Example: "Available"
Also accepts: newStatus
Promise<boolean>const result = await client.setMyStatus({ statusText: "Available", });Set profile picture
client.setProfilePicture(image)Parameters (1)
imageRequiredstringDataURLImage file (path, URL, DataURL, or Base64)
Example: "data:image/png;base64,iVBORw0KGgo..."
Promise<boolean>const result = await client.setProfilePicture({ image: "data:image/png;base64,iVBORw0KGgo...", });Star a message
client.starMessage(messageId)Parameters (1)
messageIdRequiredstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
Promise<boolean>const result = await client.starMessage({ messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",});Unarchive a chat
client.unarchiveChat(chatId)Parameters (1)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<boolean>const result = await client.unarchiveChat({ chatId: "447123456789@c.us", });Unblock a contact
client.unblockContact(contactId)Parameters (1)
contactIdRequiredstringContactIdContact ID A WhatsApp contact JID
Example: "447123456789@c.us"
Also accepts: id
Promise<boolean>const result = await client.unblockContact({ contactId: "447123456789@c.us", });Unmute a chat
client.unmuteChat(chatId)Parameters (1)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<string | boolean | number>const result = await client.unmuteChat({ chatId: "447123456789@c.us", });Unpin a chat
client.unpinChat(chatId)Parameters (1)
chatIdRequiredstringChatIdChat ID (phone number or formatted ID) A contact ID, group ID, or LID JID
Example: "447123456789@c.us"
Also accepts: contactId, id
Promise<boolean>const result = await client.unpinChat({ chatId: "447123456789@c.us", });Unstar a message
client.unstarMessage(messageId)Parameters (1)
messageIdRequiredstringMessageIdMessage ID A WhatsApp message identifier
Example: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"
Also accepts: id, msgId
Promise<boolean>const result = await client.unstarMessage({ messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",});Plain-text method index
| Method | Namespace | Description | License |
|---|---|---|---|
addLabel | labels | Add label to chat | - |
addParticipant | groups | Add participant to group | - |
approveGroupJoinRequest | groups | Approve group join request | - |
archiveChat | chats | Archive a chat | - |
blockContact | contacts | Block a contact | - |
checkNumberStatus | contacts | Check if number is on WhatsApp | insiders |
checkReadReceipts | contacts | Check read receipts setting | - |
clearChat | chats | Clear chat history | - |
createGroup | groups | Create new group | restricted |
decryptMedia | media | Decrypts media from a message | - |
deleteAllStatus | status | Delete all statuses | insiders |
deleteChat | chats | Delete a chat | - |
deleteMessage | messages | Deletes a message | - |
deleteStatus | status | Delete status | insiders |
demoteParticipant | groups | Demote participant from admin | - |
downloadMedia | media | Downloads and decrypts media from a message to a file | - |
forwardMessages | messages | Forwards messages to a chat | - |
getAllChatIds | chatIds | Get all chat IDs | - |
getAllChats | chats | Returns serialized Chat objects from the current session, optionally limited to chats with unread messages. | - |
getAllCommunities | communities | Get all communities | - |
getAllContacts | contacts | Retrieves all contacts | - |
getAllGroups | groups | Get all groups | - |
getAllLabels | labels | Get all labels | - |
getAllMessages | messages | Retrieves all messages in the session | - |
getBatteryLevel | session | Get phone battery level | - |
getBlockedIds | contacts | Get blocked contact IDs | - |
getBusinessProducts | business | Get business products | - |
getBusinessProfile | business | Get business profile | - |
getChat | chats | Get specific chat by ID | - |
getChatsByLabel | labels | Get chats by label | - |
getChatWithNonContacts | chats | Get chats with non-contacts | - |
getCommonGroups | contacts | Get common groups with contact | - |
getCommunityAdminIds | communities | Get community admin IDs | - |
getCommunityAdmins | communities | Get community admins | - |
getCommunityInfo | communities | Get community metadata | - |
getCommunityParticipantIds | communities | Get community participant IDs | - |
getCommunityParticipants | communities | Get community participants | - |
getConnectionState | session | Get connection state | - |
getContact | contacts | Get specific contact | - |
getFeatures | session | Get enabled features | - |
getGroupAdmins | groups | Get group admins | - |
getGroupInfo | groups | Get group metadata | - |
getGroupInviteLink | groups | Get group invite link | - |
getGroupMembers | groups | Retrieves members of a group | - |
getGroupMembersId | groups | Get group member IDs | - |
getHostNumber | session | Get host phone number | - |
getKickedGroups | groups | Get groups where kicked | - |
getLicenseType | session | Get license type | - |
getLoadedMessageCount | session | Get loaded message count | - |
getMe | session | Get host account info | - |
getMessageById | messages | Retrieves a specific message by ID | - |
getMessageInfo | messages | Get message delivery info | - |
getMessagesForLLM | messages | Get messages formatted for LLMs | - |
getMyLastMessage | messages | Get last message sent by host | - |
getNumberProfile | contacts | Get profile of number | insiders |
getOrder | business | Get order details | insiders |
getProcessStats | session | Get process statistics | - |
getProfilePicture | contacts | Get profile picture from server | - |
getSnapshot | session | Take screenshot | - |
getStarredMessages | messages | Get starred messages | insiders |
getStatus | mystatus | Get specific status | insiders |
getStories | status | Get all stories | insiders |
getUnsentMessages | messages | Get unsent/pending messages | - |
getUserAgent | session | Get user agent | - |
getVCards | messages | Extract vCards from message | - |
getWAVersion | session | Get WhatsApp Web version | - |
healthCheck | session | Health check | - |
isChatOnline | chats | Check if chat is online | - |
isPlugged | session | Check if phone is charging | - |
joinGroupViaLink | groups | Join group via invite link | restricted |
leaveGroup | groups | Leave a group | - |
loadEarlierMessages | messages | Loads earlier messages from a chat | - |
markAsRead | chats | Mark chat as read | - |
markAsUnread | chats | Mark chat as unread | - |
muteChat | chats | Mute a chat | - |
pinChat | chats | Pin a chat | - |
postImageStatus | status | Post image status | insiders |
postTextStatus | status | Post text status | insiders |
postVideoStatus | status | Post video status | insiders |
promoteParticipant | groups | Promote participant to admin | - |
react | messages | React to message with emoji | - |
rejectGroupJoinRequest | groups | Reject group join request | - |
removeLabel | labels | Remove label from chat | - |
removeParticipant | groups | Remove participant from group | - |
revokeGroupInviteLink | groups | Revoke group invite link | - |
sendAdvancedButtons | messages | Sends an advanced button message with media (deprecated) | insiders |
sendAudio | messages | Sends an audio file to a chat | - |
sendBanner | messages | Sends a banner image | - |
sendButtons | messages | Sends a button message (deprecated) | insiders |
sendContact | messages | Sends a single contact | - |
sendFile | messages | Sends a file or document to a chat | - |
sendFileFromUrl | messages | Downloads a file from a URL and sends it to a chat | - |
sendImage | messages | Sends an image to a chat | - |
sendInteractive | messages | Send a portable interactive message document (Insiders and above) | insiders |
sendLinkWithAutoPreview | messages | Sends a link with auto-generated preview | - |
sendListMessage | messages | Sends a list/menu message (deprecated) | insiders |
sendLocation | messages | Sends a location to a chat | - |
sendMessageWithThumb | messages | Sends a link preview message with custom thumbnail | - |
sendMultipleContacts | messages | Sends multiple contacts | - |
sendPaymentRequest | messages | Sends a payment request message | - |
sendPoll | messages | Sends a poll message | - |
sendPtt | messages | Sends a voice note (push-to-talk) to a chat | - |
sendRawMessage | messages | Send a constructed WhatsApp protobuf Message payload (Insiders and above); media must already be uploaded | insiders |
sendReplyWithMentions | messages | Sends a reply to a message that includes @mentions | - |
sendSeen | messages | Mark message as seen | - |
sendText | messages | Sends a text message to a chat | - |
sendTextWithMentions | messages | Sends a text message that includes @mentions | - |
sendVCard | messages | Sends a contact card (vCard) | - |
sendVideoAsGif | messages | Sends a video as an animated GIF | - |
sendYouTubeLink | messages | Sends a YouTube link with auto-generated preview | - |
setChatEphemeral | chats | Set ephemeral messages for chat | - |
setGroupDescription | groups | Set group description | - |
setGroupEditToAdminsOnly | groups | Restrict group editing to admins only | - |
setGroupIcon | groups | Set group icon | - |
setGroupTitle | groups | Set group title | - |
setGroupToAdminsOnly | groups | Restrict group to admins only | - |
setMyName | session | Set host name | - |
setMyStatus | session | Set host status | - |
setProfilePicture | session | Set profile picture | insiders |
starMessage | messages | Star a message | - |
unarchiveChat | chats | Unarchive a chat | - |
unblockContact | contacts | Unblock a contact | - |
unmuteChat | chats | Unmute a chat | - |
unpinChat | chats | Unpin a chat | - |
unstarMessage | messages | Unstar a message | - |
Was this helpful?
Your answer includes the page path and docs version.
