Labels Client API
Generated client method reference for the labels namespace.
This page documents 4 schema-registry client methods in the labels namespace.
addLabel
Add label to chat
Signature client.addLabel(label: string, chatId: 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.addLabel({
label: "label",
chatId: "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.
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 | labels |
| Action | update |
| Functionality | business-only |
| Positional parameter order | label, chatId |
| Aliases | labels.add |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/labels/add | addLabel | Active |
| Alias | PUT | /api/addLabel | addLabel | Active |
getAllLabels
Get all labels
Signature client.getAllLabels(): Promise<Label[]>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getAllLabels();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<Label[]> |
| Label | View fields |
Resolves to Label[]. 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 | labels |
| Action | read |
| Functionality | business-only |
| Positional parameter order | - |
| Aliases | labels.all, labels.getAll, labels.list, listLabels |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/labels/getAll | getAllLabels | Active |
| Alias | GET | /api/getAllLabels | getAllLabels | Active |
| Alias | GET | /api/labels/all | labels.all | Active |
| Alias | GET | /api/labels/list | labels.list | Active |
| Alias | GET | /api/listLabels | listLabels | Active |
getChatsByLabel
Get chats by label
Signature client.getChatsByLabel(label: string): Promise<Chat[]>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getChatsByLabel({
label: "label",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<Chat[]> |
| Chat | View fields |
Resolves to Chat[]. 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. Serialized chat returned by chat lookups and listings. Its id is an opaque ChatId; additional WhatsApp Web fields may be present.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | labels |
| Action | read |
| Functionality | business-only |
| Positional parameter order | label |
| Aliases | labels.getChats, labels.getChatsBy |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/labels/getChats | getChatsByLabel | Active |
| Alias | GET | /api/getChatsByLabel | getChatsByLabel | Active |
| Alias | GET | /api/labels/getChatsBy | labels.getChatsBy | Active |
removeLabel
Remove label from chat
Signature client.removeLabel(label: string, chatId: 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.removeLabel({
label: "label",
chatId: "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.
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 | labels |
| Action | update |
| Functionality | business-only |
| Positional parameter order | label, chatId |
| Aliases | labels.remove |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/labels/remove | removeLabel | Active |
| Alias | PUT | /api/removeLabel | removeLabel | Active |
Was this helpful?
Your answer includes the page path and docs version.
