Skip to main content
GET
/
instances
/
{instanceId}
/
token
/
{token}
/
chats
/
{phone}
Get chat metadata
curl --request GET \
  --url https://api.z-api.io/instances/{instanceId}/token/{token}/chats/{phone} \
  --header 'Client-Token: <api-key>'
{
  "phone": "<string>",
  "unread": "<string>",
  "lastMessageTime": "<string>",
  "isMuted": "<string>",
  "isMarkedSpam": true,
  "profileThumbnail": "<string>",
  "isGroupAnnouncement": true,
  "isGroup": true,
  "about": "<string>",
  "notes": {}
}

Overview

This method is responsible for returning a chat’s metadata information.

Attributes

instanceId
string
required
Your instance ID. Available in the Z-API panel under Instances.
token
string
required
Your Z-API instance token.

Path

phone
string
required
Contact phone number in DDI DDD NUMBER format. E.g.: 551199999999

Response

200

phone
string
Contact phone number
unread
string
Number of unread messages
lastMessageTime
string
Last interaction timestamp
isMuted
string
0 or 1 indicating if the chat is muted
isMarkedSpam
boolean
Whether the chat is marked as spam
profileThumbnail
string
Chat photo URL (deleted after 48h by WhatsApp)
isGroupAnnouncement
boolean
Whether it is an announcement group
isGroup
boolean
Whether it is a group
about
string
Profile status
notes
object
Chat annotations (available only for WhatsApp Business)
{
  "phone": "5511999999999",
  "unread": "0",
  "lastMessageTime": "1619461666",
  "isMuted": "0",
  "isMarkedSpam": "false",
  "profileThumbnail": "https://pps.whatsapp.net/...",
  "messagesUnread": 0,
  "about": "Profile status",
  "isGroupAnnouncement": false,
  "isGroup": false,
  "notes": {
    "id": "KlesU6f4f/Qd5d6VuAbvOMi31rg/F92owVe/xDYad1C=",
    "content": "annotation text",
    "createdAt": 1655953774000,
    "lastUpdateAt": 1655953774000
  }
}

405

Make sure you are correctly sending the method specification, that is, verify that you sent POST or GET as specified at the beginning of this topic.

415

If you receive a 415 error, make sure to add the “Content-Type” header to your request, which in most cases is “application/json”.