Chats Client API
Generated client method reference for the chats namespace.

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
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | update |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | chats.archive |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/chats/archive | archiveChat | Active |
| Alias | PUT | /api/archiveChat | archiveChat | Active |
Usage
const result = await client.archiveChat({
chatId: "447123456789@c.us",
});
// namespaced form: client.chats.archive(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | boolean |
clearChat
Clear chat history
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | delete |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | chats.clear |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | DELETE | /api/chats/clear | clearChat | Active |
| Alias | DELETE | /api/clearChat | clearChat | Active |
Usage
const result = await client.clearChat({
chatId: "447123456789@c.us",
});
// namespaced form: client.chats.clear(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | boolean |
deleteChat
Delete a chat
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | delete |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | chats.delete |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | DELETE | /api/chats/delete | deleteChat | Active |
| Alias | DELETE | /api/deleteChat | deleteChat | Active |
Usage
const result = await client.deleteChat({
chatId: "447123456789@c.us",
});
// namespaced form: client.chats.delete(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | boolean |
getAllChats
Retrieves all chats
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | read |
| Functionality | both |
| Positional parameter order | withNewMessagesOnly |
| Aliases | chats.all, chats.getAll, chats.list, listChats |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/chats/getAll | getAllChats | Active |
| Alias | GET | /api/chats/all | chats.all | Active |
| Alias | GET | /api/chats/list | chats.list | Active |
| Alias | GET | /api/getAllChats | getAllChats | Active |
| Alias | GET | /api/listChats | listChats | Active |
Usage
const result = await client.getAllChats({
withNewMessagesOnly: false,
});
// namespaced form: client.chats.getAll(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | any[] |
Returns raw, unstructured data from WhatsApp Web. Narrow or validate the shape before relying on specific fields.
getChat
Get specific chat by ID
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | read |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | chats.get, chats.getById, getChatById |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/chats/get | getChat | Active |
| Alias | GET | /api/chats/getById | chats.getById | Active |
| Alias | GET | /api/getChat | getChat | Active |
| Alias | GET | /api/getChatById | getChatById | Active |
Usage
const result = await client.getChat({
chatId: "447123456789@c.us",
});
// namespaced form: client.chats.get(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | any |
Returns raw, unstructured data from WhatsApp Web. Narrow or validate the shape before relying on specific fields.
getChatWithNonContacts
Get chats with non-contacts
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | chats.getWithNonContacts |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/chats/getWithNonContacts | getChatWithNonContacts | Active |
| Alias | GET | /api/getChatWithNonContacts | getChatWithNonContacts | Active |
Usage
const result = await client.getChatWithNonContacts({});
// namespaced form: client.chats.getWithNonContacts(...)Parameters
This method does not define input parameters.
Output
| Prop | Value |
|---|---|
| Return type | any[] |
Returns raw, unstructured data from WhatsApp Web. Narrow or validate the shape before relying on specific fields.
isChatOnline
Check if chat is online
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | read |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | chats.isOnline |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/chats/isOnline | isChatOnline | Active |
| Alias | GET | /api/isChatOnline | isChatOnline | Active |
Usage
const result = await client.isChatOnline({
chatId: "447123456789@c.us",
});
// namespaced form: client.chats.isOnline(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | boolean | string |
markAsRead
Mark chat as read
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | update |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | chats.markAsRead |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/chats/markAsRead | markAsRead | Active |
| Alias | PUT | /api/markAsRead | markAsRead | Active |
Usage
const result = await client.markAsRead({
chatId: "447123456789@c.us",
});
// namespaced form: client.chats.markAsRead(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | boolean |
markAsUnread
Mark chat as unread
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | update |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | chats.markAsUnread |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/chats/markAsUnread | markAsUnread | Active |
| Alias | PUT | /api/markAsUnread | markAsUnread | Active |
Usage
const result = await client.markAsUnread({
chatId: "447123456789@c.us",
});
// namespaced form: client.chats.markAsUnread(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | boolean |
muteChat
Mute a chat
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | update |
| Functionality | both |
| Positional parameter order | chatId, muteDuration |
| Aliases | chats.mute |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/chats/mute | muteChat | Active |
| Alias | PUT | /api/muteChat | muteChat | Active |
Usage
const result = await client.muteChat({
chatId: "447123456789@c.us",
muteDuration: 1,
});
// namespaced form: client.chats.mute(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | string | boolean | number |
pinChat
Pin a chat
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | update |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | chats.pin |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/chats/pin | pinChat | Active |
| Alias | PUT | /api/pinChat | pinChat | Active |
Usage
const result = await client.pinChat({
chatId: "447123456789@c.us",
});
// namespaced form: client.chats.pin(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | boolean |
setChatEphemeral
Set ephemeral messages for chat
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | update |
| Functionality | both |
| Positional parameter order | chatId, ephemeral |
| Aliases | chats.setEphemeral |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/chats/setEphemeral | setChatEphemeral | Active |
| Alias | PUT | /api/setChatEphemeral | setChatEphemeral | Active |
Usage
const result = await client.setChatEphemeral({
chatId: "447123456789@c.us",
ephemeral: 1,
});
// namespaced form: client.chats.setEphemeral(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | boolean |
unarchiveChat
Unarchive a chat
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | update |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | chats.unarchive |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/chats/unarchive | unarchiveChat | Active |
| Alias | PUT | /api/unarchiveChat | unarchiveChat | Active |
Usage
const result = await client.unarchiveChat({
chatId: "447123456789@c.us",
});
// namespaced form: client.chats.unarchive(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | boolean |
unmuteChat
Unmute a chat
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | update |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | chats.unmute |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/chats/unmute | unmuteChat | Active |
| Alias | PUT | /api/unmuteChat | unmuteChat | Active |
Usage
const result = await client.unmuteChat({
chatId: "447123456789@c.us",
});
// namespaced form: client.chats.unmute(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | string | boolean | number |
unpinChat
Unpin a chat
Overview
| Prop | Value |
|---|---|
| Namespace | chats |
| Action | update |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | chats.unpin |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/chats/unpin | unpinChat | Active |
| Alias | PUT | /api/unpinChat | unpinChat | Active |
Usage
const result = await client.unpinChat({
chatId: "447123456789@c.us",
});
// namespaced form: client.chats.unpin(...)Parameters
Prop
Type
Output
| Prop | Value |
|---|---|
| Return type | boolean |

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