List chats
GET
/v1/whatsapp/sessions/{sessionId}/chatsReturns recent chats.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
limit | integer | Maximum chats to return, from 1 to 1000. Defaults to 1000. |
offset | integer | Number of chats to skip, for paging. |
curl "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/chats?limit=20" \
-H "X-API-Key: $TUSK_WA_KEY"200 OK
[
{
"id": "[email protected]",
"name": "Amina",
"isGroup": false,
"kind": "individual",
"unreadCount": 2,
"timestamp": 1768469400,
"lastMessage": "Thanks!",
"archived": false,
"pinned": false,
"muted": false
}
]Mark a chat as read
POST
/v1/whatsapp/sessions/{sessionId}/chats/readMarks a chat, or specific messages in it, as read.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The chat to mark as read. |
messageIds | string[] | Specific message ids. Omit to mark the whole chat. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/chats/read" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]"
}'200 OK
{
"success": true
}Show typing or recording
POST
/v1/whatsapp/sessions/{sessionId}/chats/typingShows a typing or recording indicator in a chat, or clears it with paused. Handy while a human or a bot prepares a reply.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The chat to show the indicator in. |
staterequired | string | One of typing, recording or paused. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/chats/typing" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"state": "typing"
}'200 OK
{
"success": true
}