Messages Client API
Generated client method reference for the messages namespace.
This page documents 39 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 |
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 |
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 |
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 |
react
React to message with emoji
Signature client.react(messageId: string, emoji: string): Promise<boolean>
Usage
const result = await client.react("false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB", "emoji");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, 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 |
sendAudio
Sends an audio file to a chat
Signature client.sendAudio(to: string, file: string, filename?: string, quotedMsgId?: 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.sendAudio({
to: "447123456789@c.us",
file: "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.
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, file, filename, quotedMsgId |
| 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 \| void>
Usage
const result = await client.sendContact("447123456789@c.us", "447123456789@c.us");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean | void> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean \| void. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<void>. 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 a file or document to a chat
Signature client.sendFile(to: string, file: string, filename?: string, caption?: string): Promise<MessageIdReturn \| string>
Usage
const result = await client.sendFile("447123456789@c.us", "data:application/pdf;base64,JVBERi0xLjQK...");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | string> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| 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, file, filename, caption |
| 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 a file from a URL and sends it to a chat
Signature client.sendFileFromUrl(to: string, url: string, filename: string, caption?: string, headers?: object): Promise<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",
filename: "filename",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<string | boolean> |
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, caption, 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 an image to a chat
Signature client.sendImage(to: string, imgData: string, filename?: string, caption?: string, id?: string, waitForId?: boolean): Promise<MessageIdReturn \| boolean \| string>
Usage
const result = await client.sendImage("447123456789@c.us", "data:image/png;base64,iVBORw0KGgo...");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean | string> |
| MessageIdReturn | View fields |
Resolves to MessageIdReturn \| boolean \| string. 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, imgData, filename, caption, id, waitForId |
| 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
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.sendMultipleContacts({
to: "447123456789@c.us",
contactIds: ["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 | 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 poll message
Signature client.sendPoll(to: string, name: string, options: string[], selectableCount?: 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.sendPoll({
to: "447123456789@c.us",
name: "name",
options: ["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.
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, name, options, selectableCount |
| 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 a voice note (push-to-talk) to a chat
Signature client.sendPtt(to: string, file: string, quotedMsgId?: 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.sendPtt({
to: "447123456789@c.us",
file: "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.
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, file, quotedMsgId |
| 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 |
sendText
Sends a text message to a chat
Signature client.sendText(to: string, content: string, options?: unknown): Promise<MessageIdReturn \| boolean \| string>
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 result = await client.sendText('447123456789@c.us', 'Hello from open-wa');
const messageId = typeof result === 'string' && /^(true|false)_.+_.+$/.test(result) ? result : null;
if (!messageId) throw new Error(`Message was not sent: ${String(result)}`);
console.log('Message ID:', messageId);Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<MessageIdReturn | boolean | string> |
| MessageIdReturn | View fields |
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.
In-process Client resolves to Promise<string \| 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, 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<boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.sendVCard({
to: "447123456789@c.us",
vcard: "vcard",
});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 | 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 a video as an animated GIF
Signature client.sendVideoAsGif(to: string, file: string, filename?: string, caption?: string, quotedMsgId?: 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.sendVideoAsGif({
to: "447123456789@c.us",
file: "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.
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, file, filename, caption, quotedMsgId |
| 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 |
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 |
Was this helpful?
Your answer includes the page path and docs version.
