open-wa
DocsAPI reference

Labels Client API

Generated client method reference for the labels namespace.

Labels Client API

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

PropValue
Return typePromise<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

PropValue
Namespacelabels
Actionupdate
Functionalitybusiness-only
Positional parameter orderlabel, chatId
Aliaseslabels.add
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/labels/addaddLabelActive
AliasPUT/api/addLabeladdLabelActive

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

PropValue
Return typePromise<Label[]>
LabelView 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

PropValue
Namespacelabels
Actionread
Functionalitybusiness-only
Positional parameter order-
Aliaseslabels.all, labels.getAll, labels.list, listLabels
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/labels/getAllgetAllLabelsActive
AliasGET/api/getAllLabelsgetAllLabelsActive
AliasGET/api/labels/alllabels.allActive
AliasGET/api/labels/listlabels.listActive
AliasGET/api/listLabelslistLabelsActive

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

PropValue
Return typePromise<Chat[]>
ChatView 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

PropValue
Namespacelabels
Actionread
Functionalitybusiness-only
Positional parameter orderlabel
Aliaseslabels.getChats, labels.getChatsBy
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/labels/getChatsgetChatsByLabelActive
AliasGET/api/getChatsByLabelgetChatsByLabelActive
AliasGET/api/labels/getChatsBylabels.getChatsByActive

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

PropValue
Return typePromise<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

PropValue
Namespacelabels
Actionupdate
Functionalitybusiness-only
Positional parameter orderlabel, chatId
Aliaseslabels.remove
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/labels/removeremoveLabelActive
AliasPUT/api/removeLabelremoveLabelActive

Was this helpful?

Your answer includes the page path and docs version.

On this page