open-wa v5 is alpha. Use v4.76.0 for mature production systems unless you are validating v5.
The Client APIAPI ExplorerLicensing

Chats Client API

Generated client method reference for the chats namespace.

Client Chats Methods Wally

Chats Client API

Generated file warning: this page is generated by packages/schema/scripts/gen-client-reference-docs.ts. Do not edit generated method content by hand.

This page documents 15 schema-registry client methods in the chats namespace.

archiveChat

Archive a chat

Overview

PropValue
Namespacechats
Actionupdate
Functionalityboth
Positional parameter orderchatId
Aliaseschats.archive
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/chats/archivearchiveChatActive
AliasPUT/api/archiveChatarchiveChatActive

Usage

const result = await client.archiveChat({
  chatId: "447123456789@c.us",
});
const result = await client.chats.archive({
  chatId: "447123456789@c.us",
});
curl -X PUT "http://localhost:8080/api/chats/archive" \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --data '{
    "chatId": "447123456789@c.us"
  }'

Parameters

Prop

Type

Output

PropValue
Return typeboolean

clearChat

Clear chat history

Overview

PropValue
Namespacechats
Actiondelete
Functionalityboth
Positional parameter orderchatId
Aliaseschats.clear
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryDELETE/api/chats/clearclearChatActive
AliasDELETE/api/clearChatclearChatActive

Usage

const result = await client.clearChat({
  chatId: "447123456789@c.us",
});
const result = await client.chats.clear({
  chatId: "447123456789@c.us",
});
curl -X DELETE "http://localhost:8080/api/chats/clear" \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --data '{
    "chatId": "447123456789@c.us"
  }'

Parameters

Prop

Type

Output

PropValue
Return typeboolean

deleteChat

Delete a chat

Overview

PropValue
Namespacechats
Actiondelete
Functionalityboth
Positional parameter orderchatId
Aliaseschats.delete
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryDELETE/api/chats/deletedeleteChatActive
AliasDELETE/api/deleteChatdeleteChatActive

Usage

const result = await client.deleteChat({
  chatId: "447123456789@c.us",
});
const result = await client.chats.delete({
  chatId: "447123456789@c.us",
});
curl -X DELETE "http://localhost:8080/api/chats/delete" \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --data '{
    "chatId": "447123456789@c.us"
  }'

Parameters

Prop

Type

Output

PropValue
Return typeboolean

getAllChats

Retrieves all chats

Overview

PropValue
Namespacechats
Actionread
Functionalityboth
Positional parameter orderwithNewMessagesOnly
Aliaseschats.all, chats.getAll, chats.list, listChats
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/chats/getAllgetAllChatsActive
AliasGET/api/chats/allchats.allActive
AliasGET/api/chats/listchats.listActive
AliasGET/api/getAllChatsgetAllChatsActive
AliasGET/api/listChatslistChatsActive

Usage

const result = await client.getAllChats({
  withNewMessagesOnly: false,
});
const result = await client.chats.getAll({
  withNewMessagesOnly: false,
});
curl -G "http://localhost:8080/api/chats/getAll" \
  -H "x-api-key: YOUR_API_KEY" \
  --data-urlencode "withNewMessagesOnly=false"

Parameters

Prop

Type

Output

PropValue
Return typeunknown[]

getChat

Get specific chat by ID

Overview

PropValue
Namespacechats
Actionread
Functionalityboth
Positional parameter orderchatId
Aliaseschats.get, chats.getById, getChatById
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/chats/getgetChatActive
AliasGET/api/chats/getByIdchats.getByIdActive
AliasGET/api/getChatgetChatActive
AliasGET/api/getChatByIdgetChatByIdActive

Usage

const result = await client.getChat({
  chatId: "447123456789@c.us",
});
const result = await client.chats.get({
  chatId: "447123456789@c.us",
});
curl -G "http://localhost:8080/api/chats/get" \
  -H "x-api-key: YOUR_API_KEY" \
  --data-urlencode "chatId=447123456789@c.us"

Parameters

Prop

Type

Output

PropValue
Return typeunknown

getChatWithNonContacts

Get chats with non-contacts

Overview

PropValue
Namespacechats
Actionread
Functionalityboth
Positional parameter order-
Aliaseschats.getWithNonContacts
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/chats/getWithNonContactsgetChatWithNonContactsActive
AliasGET/api/getChatWithNonContactsgetChatWithNonContactsActive

Usage

const result = await client.getChatWithNonContacts({});
const result = await client.chats.getWithNonContacts({});
curl -X GET "http://localhost:8080/api/chats/getWithNonContacts" \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --data '{}'

Parameters

This method does not define input parameters.

Output

PropValue
Return typeunknown[]

isChatOnline

Check if chat is online

Overview

PropValue
Namespacechats
Actionread
Functionalityboth
Positional parameter orderchatId
Aliaseschats.isOnline
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/chats/isOnlineisChatOnlineActive
AliasGET/api/isChatOnlineisChatOnlineActive

Usage

const result = await client.isChatOnline({
  chatId: "447123456789@c.us",
});
const result = await client.chats.isOnline({
  chatId: "447123456789@c.us",
});
curl -G "http://localhost:8080/api/chats/isOnline" \
  -H "x-api-key: YOUR_API_KEY" \
  --data-urlencode "chatId=447123456789@c.us"

Parameters

Prop

Type

Output

PropValue
Return typeboolean | string

markAsRead

Mark chat as read

Overview

PropValue
Namespacechats
Actionupdate
Functionalityboth
Positional parameter orderchatId
Aliaseschats.markAsRead
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/chats/markAsReadmarkAsReadActive
AliasPUT/api/markAsReadmarkAsReadActive

Usage

const result = await client.markAsRead({
  chatId: "447123456789@c.us",
});
const result = await client.chats.markAsRead({
  chatId: "447123456789@c.us",
});
curl -X PUT "http://localhost:8080/api/chats/markAsRead" \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --data '{
    "chatId": "447123456789@c.us"
  }'

Parameters

Prop

Type

Output

PropValue
Return typeboolean

markAsUnread

Mark chat as unread

Overview

PropValue
Namespacechats
Actionupdate
Functionalityboth
Positional parameter orderchatId
Aliaseschats.markAsUnread
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/chats/markAsUnreadmarkAsUnreadActive
AliasPUT/api/markAsUnreadmarkAsUnreadActive

Usage

const result = await client.markAsUnread({
  chatId: "447123456789@c.us",
});
const result = await client.chats.markAsUnread({
  chatId: "447123456789@c.us",
});
curl -X PUT "http://localhost:8080/api/chats/markAsUnread" \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --data '{
    "chatId": "447123456789@c.us"
  }'

Parameters

Prop

Type

Output

PropValue
Return typeboolean

muteChat

Mute a chat

Overview

PropValue
Namespacechats
Actionupdate
Functionalityboth
Positional parameter orderchatId, muteDuration
Aliaseschats.mute
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/chats/mutemuteChatActive
AliasPUT/api/muteChatmuteChatActive

Usage

const result = await client.muteChat({
  chatId: "447123456789@c.us",
  muteDuration: 1,
});
const result = await client.chats.mute({
  chatId: "447123456789@c.us",
  muteDuration: 1,
});
curl -X PUT "http://localhost:8080/api/chats/mute" \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --data '{
    "chatId": "447123456789@c.us",
    "muteDuration": 1
  }'

Parameters

Prop

Type

Output

PropValue
Return typestring | boolean | number

pinChat

Pin a chat

Overview

PropValue
Namespacechats
Actionupdate
Functionalityboth
Positional parameter orderchatId
Aliaseschats.pin
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/chats/pinpinChatActive
AliasPUT/api/pinChatpinChatActive

Usage

const result = await client.pinChat({
  chatId: "447123456789@c.us",
});
const result = await client.chats.pin({
  chatId: "447123456789@c.us",
});
curl -X PUT "http://localhost:8080/api/chats/pin" \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --data '{
    "chatId": "447123456789@c.us"
  }'

Parameters

Prop

Type

Output

PropValue
Return typeboolean

setChatEphemeral

Set ephemeral messages for chat

Overview

PropValue
Namespacechats
Actionupdate
Functionalityboth
Positional parameter orderchatId, ephemeral
Aliaseschats.setEphemeral
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/chats/setEphemeralsetChatEphemeralActive
AliasPUT/api/setChatEphemeralsetChatEphemeralActive

Usage

const result = await client.setChatEphemeral({
  chatId: "447123456789@c.us",
  ephemeral: 1,
});
const result = await client.chats.setEphemeral({
  chatId: "447123456789@c.us",
  ephemeral: 1,
});
curl -X PUT "http://localhost:8080/api/chats/setEphemeral" \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --data '{
    "chatId": "447123456789@c.us",
    "ephemeral": 1
  }'

Parameters

Prop

Type

Output

PropValue
Return typeboolean

unarchiveChat

Unarchive a chat

Overview

PropValue
Namespacechats
Actionupdate
Functionalityboth
Positional parameter orderchatId
Aliaseschats.unarchive
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/chats/unarchiveunarchiveChatActive
AliasPUT/api/unarchiveChatunarchiveChatActive

Usage

const result = await client.unarchiveChat({
  chatId: "447123456789@c.us",
});
const result = await client.chats.unarchive({
  chatId: "447123456789@c.us",
});
curl -X PUT "http://localhost:8080/api/chats/unarchive" \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --data '{
    "chatId": "447123456789@c.us"
  }'

Parameters

Prop

Type

Output

PropValue
Return typeboolean

unmuteChat

Unmute a chat

Overview

PropValue
Namespacechats
Actionupdate
Functionalityboth
Positional parameter orderchatId
Aliaseschats.unmute
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/chats/unmuteunmuteChatActive
AliasPUT/api/unmuteChatunmuteChatActive

Usage

const result = await client.unmuteChat({
  chatId: "447123456789@c.us",
});
const result = await client.chats.unmute({
  chatId: "447123456789@c.us",
});
curl -X PUT "http://localhost:8080/api/chats/unmute" \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --data '{
    "chatId": "447123456789@c.us"
  }'

Parameters

Prop

Type

Output

PropValue
Return typestring | boolean | number

unpinChat

Unpin a chat

Overview

PropValue
Namespacechats
Actionupdate
Functionalityboth
Positional parameter orderchatId
Aliaseschats.unpin
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/chats/unpinunpinChatActive
AliasPUT/api/unpinChatunpinChatActive

Usage

const result = await client.unpinChat({
  chatId: "447123456789@c.us",
});
const result = await client.chats.unpin({
  chatId: "447123456789@c.us",
});
curl -X PUT "http://localhost:8080/api/chats/unpin" \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --data '{
    "chatId": "447123456789@c.us"
  }'

Parameters

Prop

Type

Output

PropValue
Return typeboolean
Wally the Walrus typing

Was this helpful?

Wally and his cute companion coffee mug are coding day and night to keep this up-to-date!

On this page