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",
});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
| 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",
});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
| 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",
});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
| 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,
});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
| Prop | Value |
|---|---|
| Return type | unknown[] |
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",
});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
| Prop | Value |
|---|---|
| Return type | unknown |
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({});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
| Prop | Value |
|---|---|
| Return type | unknown[] |
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",
});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
| 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",
});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
| 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",
});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
| 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,
});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
| 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",
});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
| 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,
});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
| 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",
});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
| 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",
});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
| 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",
});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
| 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!
