Messages Client API
Generated client method reference for the messages namespace.
This page documents 47 schema-registry client methods in the messages namespace.
deleteMessage
Deletes a message
Signature client.deleteMessage(chatId: string, messageId: string[] \| string, onlyLocal?: boolean): Promise<boolean>
Usage
const result = await client.deleteMessage("447123456789@c.us", ["false_447123456789@c.us_ABC123","false_447123456789@c.us_DEF456"]);Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | 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. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | delete |
| Functionality | both |
| Positional parameter order | chatId, messageId, onlyLocal |
| Aliases | messages.delete |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | DELETE | /api/messages/delete | deleteMessage | Active |
| Alias | DELETE | /api/deleteMessage | deleteMessage | Active |
editMessage
Edits the text of a message through the installed private patch
Signature client.editMessage(messageId: string, newContent: string): Promise<boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.editMessage({
messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",
newContent: "newContent",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | update |
| Functionality | both |
| Positional parameter order | messageId, newContent |
| Aliases | messages.edit |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/messages/edit | editMessage | Active |
| Alias | PUT | /api/editMessage | editMessage | Active |
forwardMessages
Forwards messages to a chat
Signature client.forwardMessages(to: string, messages: string[] \| string, skipMyMessages?: boolean): Promise<MessageIdReturn[] \| boolean>
Usage
const result = await client.forwardMessages("447123456789@c.us", ["false_447123456789@c.us_ABC123","false_447123456789@c.us_DEF456"]);Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn[] | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn[] \| boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<MessageIdReturn[] \| boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, messages, skipMyMessages |
| Aliases | messages.forward |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/forward | forwardMessages | Active |
| Alias | POST | /api/forwardMessages | forwardMessages | Active |
getAlbumMessages
Returns currently loaded image and video messages associated with an album, including GIF videos. The album can arrive before its media, so the array may be incomplete. Returns false if the album is not loaded or the ID belongs to another message type.
Signature client.getAlbumMessages(messageId: string): Promise<Message[] \| false>
Usage
const result = await client.getAlbumMessages("false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<Message[] | false> |
| Message | View fields |
A snapshot of currently loaded album media. An empty or partial array does not mean that the sender sent an empty or partial album. Each item retains its caption and can be passed to decryptMedia or downloadMedia.
In-process Client resolves to Promise<Message[] \| false>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
A snapshot of currently loaded album media. An empty or partial array does not mean that the sender sent an empty or partial album. Each item retains its caption and can be passed to decryptMedia or downloadMedia.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | read |
| Functionality | both |
| Positional parameter order | messageId |
| Aliases | messages.getAlbum |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/messages/getAlbum | getAlbumMessages | Active |
| Alias | GET | /api/getAlbumMessages | getAlbumMessages | Active |
getAllMessages
Retrieves all messages in the session
Signature client.getAllMessages(chatId?: string, includeMe?: boolean, includeNotifications?: boolean): Promise<Message[]>
Usage
const result = await client.getAllMessages();Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<Message[]> |
| Message | View fields |
Resolves to Message[]. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<Message[]>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | read |
| Functionality | both |
| Positional parameter order | chatId, includeMe, includeNotifications |
| Aliases | listMessages, messages.all, messages.getAll, messages.list |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/messages/getAll | getAllMessages | Active |
| Alias | GET | /api/getAllMessages | getAllMessages | Active |
| Alias | GET | /api/listMessages | listMessages | Active |
| Alias | GET | /api/messages/all | messages.all | Active |
| Alias | GET | /api/messages/list | messages.list | Active |
getMessageById
Retrieves a specific message by ID
Signature client.getMessageById(messageId: string): Promise<Message \| null \| false>
Usage
const result = await client.getMessageById("false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<Message | null | false> |
| Message | View fields |
Resolves to Message \| null \| false. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<Message \| false \| null>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | read |
| Functionality | both |
| Positional parameter order | messageId |
| Aliases | getMessage, messages.get, messages.getById |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/messages/get | getMessageById | Active |
| Alias | GET | /api/getMessage | getMessage | Active |
| Alias | GET | /api/getMessageById | getMessageById | Active |
| Alias | GET | /api/messages/getById | messages.getById | Active |
getMessageInfo
Get message delivery info
Signature client.getMessageInfo(messageId: string): Promise<MessageInfo>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getMessageInfo({
messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageInfo> |
| MessageInfo | View fields |
Resolves to MessageInfo. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | read |
| Functionality | both |
| Positional parameter order | messageId |
| Aliases | messages.getInfo |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/messages/getInfo | getMessageInfo | Active |
| Alias | GET | /api/getMessageInfo | getMessageInfo | Active |
getMessagesForLLM
Get messages formatted for LLMs
Signature client.getMessagesForLLM(chatId: string, last?: number): Promise<LLMMessage[]>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getMessagesForLLM({
chatId: "447123456789@c.us",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<LLMMessage[]> |
| LLMMessage | View fields |
Resolves to LLMMessage[]. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | read |
| Functionality | both |
| Positional parameter order | chatId, last |
| Aliases | getGptArray, messages.getForLLM, messages.getGptArray |
| Deprecated aliases | getGptArray, messages.getGptArray |
| License | none |
| WAPI override | getGptArray |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/messages/getForLLM | getMessagesForLLM | Active |
| Deprecated alias | GET | /api/getGptArray | getGptArray | Deprecated |
| Alias | GET | /api/getMessagesForLLM | getMessagesForLLM | Active |
| Deprecated alias | GET | /api/messages/getGptArray | messages.getGptArray | Deprecated |
getMyLastMessage
Get last message sent by host
Signature client.getMyLastMessage(chatId?: string): Promise<Message \| undefined>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getMyLastMessage();Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<Message | undefined> |
| Message | View fields |
Resolves to Message \| undefined. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | read |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | messages.getMyLast |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/messages/getMyLast | getMyLastMessage | Active |
| Alias | GET | /api/getMyLastMessage | getMyLastMessage | Active |
getPollResults
Hydrates the local poll vote store and returns synced counts, choices and votes. Hidden-voter polls omit voter identities and the votes array. Unsynced votes may be absent.
Signature client.getPollResults(messageId: string): Promise<PollResults>
Usage
const result = await client.getPollResults("false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<PollResults> |
| PollResults | View fields |
Resolves to PollResults. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<PollResults>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | get |
| Functionality | both |
| Positional parameter order | messageId |
| Aliases | messages.getPollResults |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/getPollResults | getPollResults | Active |
| Alias | POST | /api/getPollResults | getPollResults | Active |
getStarredMessages
Get starred messages
Signature client.getStarredMessages(chatId?: string): Promise<Message[]>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getStarredMessages();Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<Message[]> |
| Message | View fields |
Resolves to Message[]. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | read |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | messages.getStarred |
| Deprecated aliases | - |
| License | insiders |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/messages/getStarred | getStarredMessages | Active |
| Alias | GET | /api/getStarredMessages | getStarredMessages | Active |
getUnsentMessages
Get unsent/pending messages
Signature client.getUnsentMessages(): Promise<Message[]>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getUnsentMessages();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<Message[]> |
| Message | View fields |
Resolves to Message[]. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | messages.getUnsent |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/messages/getUnsent | getUnsentMessages | Active |
| Alias | GET | /api/getUnsentMessages | getUnsentMessages | Active |
getVCards
Extract vCards from message
Signature client.getVCards(messageId: string): Promise<string[]>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getVCards({
messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<string[]> |
Resolves to string[]. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | read |
| Functionality | both |
| Positional parameter order | messageId |
| Aliases | messages.getVCards |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/messages/getVCards | getVCards | Active |
| Alias | GET | /api/getVCards | getVCards | Active |
loadEarlierMessages
Loads earlier messages from a chat
Signature client.loadEarlierMessages(chatId: string, count?: number, includeMe?: boolean): Promise<Message[]>
Usage
const result = await client.loadEarlierMessages("447123456789@c.us");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<Message[]> |
| Message | View fields |
Resolves to Message[]. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<Message[]>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | read |
| Functionality | both |
| Positional parameter order | chatId, count, includeMe |
| Aliases | loadOlderMessages, messages.loadEarlier, messages.loadOlder |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/loadEarlier | loadEarlierMessages | Active |
| Alias | POST | /api/loadEarlierMessages | loadEarlierMessages | Active |
| Alias | POST | /api/loadOlderMessages | loadOlderMessages | Active |
| Alias | POST | /api/messages/loadOlder | messages.loadOlder | Active |
pinMessage
Pins a message in its chat for everyone, subject to native permissions. This differs from pinChat, which changes the current account chat list.
Signature client.pinMessage(messageId: string, duration?: "OneDay" \| "SevenDays" \| "ThirtyDays"): Promise<boolean>
Usage
const result = await client.pinMessage("false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | set |
| Functionality | both |
| Positional parameter order | messageId, duration |
| Aliases | messages.pin |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/pin | pinMessage | Active |
| Alias | POST | /api/pinMessage | pinMessage | Active |
react
React to message with emoji
Signature client.react(messageId: string, emoji: string): Promise<boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.react({
messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",
emoji: "emoji",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | messageId, emoji |
| Aliases | messages.react |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/react | react | Active |
| Alias | POST | /api/react | react | Active |
sendAdvancedButtons
Sends an advanced button message with media (deprecated)
Signature client.sendAdvancedButtons(to: string, body?: string \| any, buttons: any[], text: string, footer: string, filename: string): Promise<MessageIdReturn \| boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.sendAdvancedButtons({
to: "447123456789@c.us",
buttons: [],
text: "text",
footer: "footer",
filename: "filename",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, body, buttons, text, footer, filename |
| Aliases | messages.sendAdvancedButtons |
| Deprecated aliases | - |
| License | insiders |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendAdvancedButtons | sendAdvancedButtons | Active |
| Alias | POST | /api/sendAdvancedButtons | sendAdvancedButtons | Active |
sendAlbum
Sends images and videos together as a native WhatsApp album with one caption on its first item. GIFs use MP4 video data with isGif: true. Documents are rejected. Phone-number IDs are resolved to LIDs; the destination chat must already be loaded and allow sending. WhatsApp controls the minimum item count and upload limits. Runtime failures include the parent and submitted child IDs when available; inspect the chat before retrying.
Signature client.sendAlbum(to: string, media: { file: string; filename: string; isGif?: boolean }[], caption?: string, quotedMsgId?: string): Promise<AlbumSendResult>
Usage
import { readFile } from 'node:fs/promises';
// Put these real image files in your process working directory.
const media = await Promise.all(['photo-1.jpg', 'photo-2.jpg', 'photo-3.jpg', 'photo-4.jpg'].map(async filename => ({
filename,
file: `data:image/jpeg;base64,${(await readFile(filename)).toString('base64')}`,
})));
const result = await client.sendAlbum('447123456789@c.us', media, 'One caption for the album');Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<AlbumSendResult> |
| AlbumSendResult | View fields |
Submitted album parent and child message IDs, in input order. Submission does not confirm recipient delivery. Runtime failures include the album ID and submitted child IDs when available. A lost connection can leave the send outcome unknown; inspect the chat before retrying.
In-process Client resolves to Promise<AlbumSendResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Submitted album parent and child message IDs, in input order. Submission does not confirm recipient delivery. Runtime failures include the album ID and submitted child IDs when available. A lost connection can leave the send outcome unknown; inspect the chat before retrying.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, media, caption, quotedMsgId |
| Aliases | messages.sendAlbum |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendAlbum | sendAlbum | Active |
| Alias | POST | /api/sendAlbum | sendAlbum | Active |
sendAudio
Sends an audio attachment with an optional quoted message. Use sendPtt for voice notes and view-once audio.
Signature client.sendAudio(to: string, file: string, filename?: string, options?: { quotedMsgId?: string }): Promise<MessageIdReturn \| boolean>
Usage
const result = await client.sendAudio("447123456789@c.us", "data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAA...");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<MediaSendResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, file, filename, options |
| Aliases | messages.sendAudio |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendAudio | sendAudio | Active |
| Alias | POST | /api/sendAudio | sendAudio | Active |
sendBanner
Sends a banner image
Signature client.sendBanner(to: string, base64: string): Promise<MessageIdReturn \| boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.sendBanner({
to: "447123456789@c.us",
base64: "base64",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, base64 |
| Aliases | messages.sendBanner |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendBanner | sendBanner | Active |
| Alias | POST | /api/sendBanner | sendBanner | Active |
sendButtons
Sends a button message (deprecated)
Signature client.sendButtons(to: string, body?: string \| any, buttons: any[], title?: string, footer?: string): Promise<MessageIdReturn \| boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.sendButtons({
to: "447123456789@c.us",
buttons: [],
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, body, buttons, title, footer |
| Aliases | messages.sendButtons |
| Deprecated aliases | - |
| License | insiders |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendButtons | sendButtons | Active |
| Alias | POST | /api/sendButtons | sendButtons | Active |
sendContact
Sends a single contact
Signature client.sendContact(to: string, contactId: string \| string[]): Promise<MessageIdReturn \| boolean \| (MessageIdReturn \| boolean)[]>
Usage
const result = await client.sendContact("447123456789@c.us", "447123456789@c.us");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean | (MessageIdReturn | boolean)[]> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean \| (MessageIdReturn \| boolean)[]. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<MessageId \| boolean \| (MessageId \| boolean)[]>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, contactId |
| Aliases | messages.sendContact |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendContact | sendContact | Active |
| Alias | POST | /api/sendContact | sendContact | Active |
sendFile
Sends an image, video, audio file or document using MIME detection or an explicit typed presentation. Incompatible options are rejected before sending. Media is not transcoded.
Signature client.sendFile(to: string, file: string, filename?: string, options?: { caption?: string; quotedMsgId?: string; type?: "auto"; viewOnce?: boolean } \| { caption?: string; quotedMsgId?: string; type: "image"; viewOnce?: boolean } \| { caption?: string; isGif?: boolean; quotedMsgId?: string; type: "video"; videoNote?: boolean; viewOnce?: boolean } \| { ptt?: boolean; quotedMsgId?: string; type: "audio"; viewOnce?: boolean } \| { caption?: string; quotedMsgId?: string; type: "document" }): Promise<MessageIdReturn \| boolean>
Usage
const result = await client.sendFile("447123456789@c.us", "data:application/pdf;base64,JVBERi0xLjQK...");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<MediaSendResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, file, filename, options |
| Aliases | messages.sendFile |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendFile | sendFile | Active |
| Alias | POST | /api/sendFile | sendFile | Active |
sendFileFromUrl
Downloads media and sends it through sendFile with the same typed presentation options.
Signature client.sendFileFromUrl(to: string, url: string, filename?: string, options?: { caption?: string; quotedMsgId?: string; type?: "auto"; viewOnce?: boolean } \| { caption?: string; quotedMsgId?: string; type: "image"; viewOnce?: boolean } \| { caption?: string; isGif?: boolean; quotedMsgId?: string; type: "video"; videoNote?: boolean; viewOnce?: boolean } \| { ptt?: boolean; quotedMsgId?: string; type: "audio"; viewOnce?: boolean } \| { caption?: string; quotedMsgId?: string; type: "document" }, headers?: object): Promise<MessageIdReturn \| string \| boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.sendFileFromUrl({
to: "447123456789@c.us",
url: "url",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | string | boolean> |
| MessageIdReturn | View fields |
Message ID or success status
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API. Message ID or success status
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, url, filename, options, headers |
| Aliases | messages.sendFileFromUrl |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendFileFromUrl | sendFileFromUrl | Active |
| Alias | POST | /api/sendFileFromUrl | sendFileFromUrl | Active |
sendImage
Sends media through the native attachment pipeline, including images and videos. Options select presentation, view once, GIF playback or circular video notes; media is not transcoded. Returns submission status, not a delivery receipt.
Signature client.sendImage(to: string, file: string, filename?: string, options?: { caption?: string; quotedMsgId?: string; type?: "auto"; viewOnce?: boolean } \| { caption?: string; quotedMsgId?: string; type: "image"; viewOnce?: boolean } \| { caption?: string; isGif?: boolean; quotedMsgId?: string; type: "video"; videoNote?: boolean; viewOnce?: boolean } \| { ptt?: boolean; quotedMsgId?: string; type: "audio"; viewOnce?: boolean } \| { caption?: string; quotedMsgId?: string; type: "document" }): Promise<MessageIdReturn \| boolean>
Usage
const result = await client.sendImage("447123456789@c.us", "data:application/pdf;base64,JVBERi0xLjQK...");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<MediaSendResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, file, filename, options |
| Aliases | messages.sendImage |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendImage | sendImage | Active |
| Alias | POST | /api/sendImage | sendImage | Active |
sendInteractive
Send a portable interactive message document (Insiders and above)
Signature client.sendInteractive(to: string, content: { 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>
Usage
const result = await client.sendInteractive("447123456789@c.us", {});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<string> |
Resolves to string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<MessageId>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, content |
| Aliases | messages.sendInteractive |
| Deprecated aliases | - |
| License | insiders |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendInteractive | sendInteractive | Active |
| Alias | POST | /api/sendInteractive | sendInteractive | Active |
sendLinkWithAutoPreview
Sends a link with auto-generated preview
Signature client.sendLinkWithAutoPreview(to: string, url: string, text?: string, thumbnail?: string, quotedMsgId?: string, customSize?: { height: number; width: number }): Promise<MessageIdReturn \| boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.sendLinkWithAutoPreview({
to: "447123456789@c.us",
url: "url",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, url, text, thumbnail, quotedMsgId, customSize |
| Aliases | messages.sendLink, messages.sendLinkWithAutoPreview, sendLink |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendLinkWithAutoPreview | sendLinkWithAutoPreview | Active |
| Alias | POST | /api/messages/sendLink | messages.sendLink | Active |
| Alias | POST | /api/sendLink | sendLink | Active |
| Alias | POST | /api/sendLinkWithAutoPreview | sendLinkWithAutoPreview | Active |
sendListMessage
Sends a list/menu message (deprecated)
Signature client.sendListMessage(to: string, sections: any[], title: string, description: string, actionText: string): Promise<MessageIdReturn \| boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.sendListMessage({
to: "447123456789@c.us",
sections: [],
title: "title",
description: "description",
actionText: "actionText",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, sections, title, description, actionText |
| Aliases | messages.sendList, sendList |
| Deprecated aliases | - |
| License | insiders |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendList | sendListMessage | Active |
| Alias | POST | /api/sendList | sendList | Active |
| Alias | POST | /api/sendListMessage | sendListMessage | Active |
sendLocation
Sends a location to a chat
Signature client.sendLocation(to: string, lat: number \| string, lng: number \| string, loc?: string, address?: string, url?: string): Promise<MessageIdReturn \| boolean>
Usage
const result = await client.sendLocation("447123456789@c.us", 51.5074, -0.1278);Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<MessageId \| false>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, lat, lng, loc, address, url |
| Aliases | messages.sendLocation |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendLocation | sendLocation | Active |
| Alias | POST | /api/sendLocation | sendLocation | Active |
sendMessageWithThumb
Sends a link preview message with custom thumbnail
Signature client.sendMessageWithThumb(thumb: string, url: string, title: string, description: string, content: string, to: string, quotedMsgId?: string, customSize?: { height: number; width: number }): Promise<MessageIdReturn \| boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.sendMessageWithThumb({
thumb: "thumb",
url: "url",
title: "title",
description: "description",
content: "Hello, world!",
to: "447123456789@c.us",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | thumb, url, title, description, content, to, quotedMsgId, customSize |
| Aliases | messages.sendLinkWithThumbnail, messages.sendWithThumb, sendLinkWithThumbnail |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendLinkWithThumbnail | sendMessageWithThumb | Active |
| Alias | POST | /api/messages/sendWithThumb | messages.sendWithThumb | Active |
| Alias | POST | /api/sendLinkWithThumbnail | sendLinkWithThumbnail | Active |
| Alias | POST | /api/sendMessageWithThumb | sendMessageWithThumb | Active |
sendMultipleContacts
Sends multiple contacts
Signature client.sendMultipleContacts(to: string, contactIds: string[]): Promise<MessageIdReturn \| boolean>
Usage
const result = await client.sendMultipleContacts("447123456789@c.us", ["447123456789@c.us"]);Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<MessageId \| boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, contactIds |
| Aliases | messages.sendContacts, messages.sendMultipleContacts, sendContacts |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendContacts | sendMultipleContacts | Active |
| Alias | POST | /api/messages/sendMultipleContacts | messages.sendMultipleContacts | Active |
| Alias | POST | /api/sendContacts | sendContacts | Active |
| Alias | POST | /api/sendMultipleContacts | sendMultipleContacts | Active |
sendPaymentRequest
Sends a payment request message
Signature client.sendPaymentRequest(to: string, amount: number, currency: string, message?: string): Promise<MessageIdReturn \| boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.sendPaymentRequest({
to: "447123456789@c.us",
amount: 1,
currency: "currency",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, amount, currency, message |
| Aliases | messages.sendPaymentRequest |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendPaymentRequest | sendPaymentRequest | Active |
| Alias | POST | /api/sendPaymentRequest | sendPaymentRequest | Active |
sendPoll
Sends a text poll with a selection limit, quote, optional closing time in Unix milliseconds and hidden voter names. Closing time and hidden names require native WhatsApp support for the sending account/chat. These fields select the native V6 poll payload.
Signature client.sendPoll(to: string, name: string, options: string[], config?: { endTime?: number; hideVoterNames?: boolean; quotedMsgId?: string; selectableCount?: number }): Promise<MessageIdReturn \| boolean>
Usage
const result = await client.sendPoll("447123456789@c.us", "name", ["Yes", "No"]);Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<MessageId \| boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, name, options, config |
| Aliases | messages.sendPoll |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendPoll | sendPoll | Active |
| Alias | POST | /api/sendPoll | sendPoll | Active |
sendPtt
Sends prepared audio as a voice note, optionally view once. It does not transcode the input; use suitable voice-note audio such as Ogg Opus.
Signature client.sendPtt(to: string, file: string, options?: { quotedMsgId?: string; viewOnce?: boolean }): Promise<MessageIdReturn \| boolean>
Usage
const result = await client.sendPtt("447123456789@c.us", "data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAA...");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<MediaSendResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, file, options |
| Aliases | messages.sendPtt, messages.sendVoiceNote, sendVoiceNote |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendPtt | sendPtt | Active |
| Alias | POST | /api/messages/sendVoiceNote | messages.sendVoiceNote | Active |
| Alias | POST | /api/sendPtt | sendPtt | Active |
| Alias | POST | /api/sendVoiceNote | sendVoiceNote | Active |
sendRawMessage
Send a constructed WhatsApp protobuf Message payload (Insiders and above); media must already be uploaded
Signature client.sendRawMessage(to: string, payload: object): Promise<string>
Usage
const result = await client.sendRawMessage("447123456789@c.us", {});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<string> |
Resolves to string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<MessageId>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, payload |
| Aliases | messages.sendRaw |
| Deprecated aliases | - |
| License | insiders |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendRaw | sendRawMessage | Active |
| Alias | POST | /api/sendRawMessage | sendRawMessage | Active |
sendReplyWithMentions
Sends a reply to a message that includes @mentions
Signature client.sendReplyWithMentions(to: string, content: string, replyMessageId: string, hideTags?: boolean, mentions?: string[]): Promise<MessageIdReturn \| boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.sendReplyWithMentions({
to: "447123456789@c.us",
content: "Hello, world!",
replyMessageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, content, replyMessageId, hideTags, mentions |
| Aliases | messages.sendReplyWithMentions |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendReplyWithMentions | sendReplyWithMentions | Active |
| Alias | POST | /api/sendReplyWithMentions | sendReplyWithMentions | Active |
sendSeen
Mark message as seen
Signature client.sendSeen(chatId: string): Promise<boolean>
Usage
const result = await client.sendSeen("447123456789@c.us");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | update |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | messages.sendSeen |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/messages/sendSeen | sendSeen | Active |
| Alias | PUT | /api/sendSeen | sendSeen | Active |
sendSticker
Render a sticker locally using automatic whole-job backend selection and ordered effects, then submit through the private donor finalizer. Author and pack labels are configurable; donor app links are owned by the installed patch. Returns a submitted message ID, not a delivery receipt. Unknown send outcomes must be reconciled before retrying.
Signature client.sendSticker(to: string, input: string, job?: { author?: string; backend?: "auto" \| "browser" \| "standalone"; background?: string; circle?: boolean; effects?: (string \| { name: string; options?: object })[]; fit?: "contain" \| "cover"; fps?: number; loopCount?: number; pack?: string; quality?: number; quotedMsgId?: string; trim?: number[] }): Promise<MessageId>
Usage
const result = await client.sendSticker("447123456789@c.us", "input");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageId> |
| MessageId | View fields |
Validated serialized message ID. This confirms the send returned an ID, not delivery or reading.
In-process Client resolves to Promise<MessageId>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Validated serialized message ID. This confirms the send returned an ID, not delivery or reading.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, input, job |
| Aliases | messages.sendSticker |
| Deprecated aliases | - |
| License | none |
| WAPI override | sendStickerJob |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendSticker | sendSticker | Active |
| Alias | POST | /api/sendSticker | sendSticker | Active |
sendText
Sends a text message and returns a validated serialized message ID. The in-process Client throws SendTextError on failure. An unknown outcome means the message may have been sent: check the chat before retrying. Starting a chat with a new number requires an applied restricted or premium license.
Signature client.sendText(to: string, content: string, options?: unknown): Promise<MessageId>
Start with await client.sendText(to, content). The registry still accepts an optional options value for compatibility, but the current Client implementation ignores it. Use reply(to, content, messageId) for quoted replies and sendTextWithMentions(to, content, hideTags, mentions) for mentions.
Usage
const messageId = await client.sendText('447123456789@c.us', 'Hello from open-wa');
console.log('Message ID:', messageId);Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageId> |
| MessageId | View fields |
Resolves to a validated serialized MessageId string, not a delivery or read receipt. The in-process Client throws SendTextError, exported by @open-wa/wa-automate and @open-wa/client, on failure. Its code is INVALID_ARGUMENT, LICENSE_REQUIRED, SEND_REJECTED, INVALID_SEND_RESULT, or SEND_FAILED. Its outcome is not_sent for invalid arguments and known runtime rejections, or unknown when the runtime returns no valid ID or browser evaluation fails. An unknown outcome means the message may already have been sent: check the chat before retrying. The client never retries automatically. Starting a chat with a new number still requires an applied restricted or premium license. HTTP and remote clients expose failures through their own error envelopes.
In-process Client resolves to Promise<MessageId>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Validated serialized message ID. This confirms the send returned an ID, not delivery or reading.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, content, options |
| Aliases | messages.sendText |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendText | sendText | Active |
| Alias | POST | /api/sendText | sendText | Active |
sendTextWithMentions
Sends a text message that includes @mentions
Signature client.sendTextWithMentions(to: string, content: string, hideTags?: boolean, mentions?: string[]): Promise<MessageIdReturn \| boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.sendTextWithMentions({
to: "447123456789@c.us",
content: "Hello, world!",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, content, hideTags, mentions |
| Aliases | messages.sendTextWithMentions |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendTextWithMentions | sendTextWithMentions | Active |
| Alias | POST | /api/sendTextWithMentions | sendTextWithMentions | Active |
sendVCard
Sends a contact card (vCard)
Signature client.sendVCard(to: string, vcard: string, contactName?: string, contactNumber?: string): Promise<MessageIdReturn \| boolean>
Usage
const result = await client.sendVCard("447123456789@c.us", "vcard");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<MessageId \| boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, vcard, contactName, contactNumber |
| Aliases | messages.sendVCard |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendVCard | sendVCard | Active |
| Alias | POST | /api/sendVCard | sendVCard | Active |
sendVideoAsGif
Sends MP4 video with WhatsApp GIF playback. GIF is a video presentation flag; this method does not convert a GIF image or transcode video.
Signature client.sendVideoAsGif(to: string, file: string, filename?: string, options?: { caption?: string; quotedMsgId?: string }): Promise<MessageIdReturn \| boolean>
Usage
const result = await client.sendVideoAsGif("447123456789@c.us", "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21...");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<MediaSendResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, file, filename, options |
| Aliases | messages.sendVideoAsGif |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendVideoAsGif | sendVideoAsGif | Active |
| Alias | POST | /api/sendVideoAsGif | sendVideoAsGif | Active |
sendYouTubeLink
Sends a YouTube link with auto-generated preview
Signature client.sendYouTubeLink(to: string, url: string, text?: string, thumbnail?: string, quotedMsgId?: string, customSize?: { height: number; width: number }): Promise<MessageIdReturn \| boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.sendYouTubeLink({
to: "447123456789@c.us",
url: "url",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | to, url, text, thumbnail, quotedMsgId, customSize |
| Aliases | messages.sendYoutubeLink, messages.sendYouTubeLink, sendYoutubeLink |
| Deprecated aliases | messages.sendYoutubeLink, sendYoutubeLink |
| License | none |
| WAPI override | sendYoutubeLink |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/sendYouTubeLink | sendYouTubeLink | Active |
| Deprecated alias | POST | /api/messages/sendYoutubeLink | messages.sendYoutubeLink | Deprecated |
| Deprecated alias | POST | /api/sendYoutubeLink | sendYoutubeLink | Deprecated |
| Alias | POST | /api/sendYouTubeLink | sendYouTubeLink | Active |
starMessage
Star a message
Signature client.starMessage(messageId: string): Promise<boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.starMessage({
messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | update |
| Functionality | both |
| Positional parameter order | messageId |
| Aliases | messages.star |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/messages/star | starMessage | Active |
| Alias | PUT | /api/starMessage | starMessage | Active |
unpinMessage
Removes a message pin for everyone, subject to native chat permissions.
Signature client.unpinMessage(messageId: string): Promise<boolean>
Usage
const result = await client.unpinMessage("false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | set |
| Functionality | both |
| Positional parameter order | messageId |
| Aliases | messages.unpin |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/unpin | unpinMessage | Active |
| Alias | POST | /api/unpinMessage | unpinMessage | Active |
unstarMessage
Unstar a message
Signature client.unstarMessage(messageId: string): Promise<boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.unstarMessage({
messageId: "false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | update |
| Functionality | both |
| Positional parameter order | messageId |
| Aliases | messages.unstar |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/messages/unstar | unstarMessage | Active |
| Alias | PUT | /api/unstarMessage | unstarMessage | Active |
voteOnPoll
Votes using option IDs returned by getPollResults; an empty array removes the current vote. The poll must be open and allow this account to vote.
Signature client.voteOnPoll(messageId: string, optionIds: number[]): Promise<boolean>
Usage
const result = await client.voteOnPoll("false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB", []);Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | messages |
| Action | send |
| Functionality | both |
| Positional parameter order | messageId, optionIds |
| Aliases | messages.voteOnPoll |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/messages/voteOnPoll | voteOnPoll | Active |
| Alias | POST | /api/voteOnPoll | voteOnPoll | Active |
Was this helpful?
Your answer includes the page path and docs version.
