> ## Documentation Index
> Fetch the complete documentation index at: https://developer.z-api.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get chats

> Returns all chats from the instance

## Overview

This method is responsible for returning all chats.

***

## Attributes

### Header

<ParamField path="instanceId" type="string" required>
  Your instance ID. Available in the Z-API panel under **Instances**.
</ParamField>

<ParamField path="token" type="string" required>
  Your Z-API instance token.
</ParamField>

### Query Parameters

<ParamField query="page" type="integer" required>
  Used for pagination, specify the chat page you want to fetch
</ParamField>

<ParamField query="pageSize" type="integer" required>
  Specifies the number of chats returned per page
</ParamField>

***

## Response

### 200

<ResponseField name="archived" type="boolean">
  Whether the chat is archived
</ResponseField>

<ResponseField name="pinned" type="boolean">
  Whether the chat is pinned
</ResponseField>

<ResponseField name="phone" type="string">
  Contact phone number
</ResponseField>

<ResponseField name="unread" type="string">
  Number of unread messages
</ResponseField>

<ResponseField name="name" type="string">
  Chat name (returns IDs for groups/broadcast lists)
</ResponseField>

<ResponseField name="lastMessageTime" type="string">
  Last interaction timestamp
</ResponseField>

<ResponseField name="isMuted" type="string">
  0 or 1 indicating if chat is muted
</ResponseField>

<ResponseField name="isMarkedSpam" type="boolean">
  Whether the chat is marked as spam
</ResponseField>

<ResponseField name="isGroup" type="boolean">
  Whether it is a group
</ResponseField>

<ResponseField name="notes" type="object">
  Chat annotations (available only for WhatsApp Business)
</ResponseField>

```json theme={"theme":{"light":"github-light","dark":"poimandres"}}
[
  {
    "archived": "false",
    "pinned": "true",
    "messagesUnread": 0,
    "phone": "5511999999999",
    "unread": "0",
    "name": "Z-API SUPPORT",
    "lastMessageTime": "1622991687",
    "isMuted": "0",
    "isMarkedSpam": "false",
    "isGroupAnnouncement": false,
    "isGroup": false
  },
  {
    "archived": "false",
    "pinned": "true",
    "messagesUnread": 0,
    "phone": "5511999999999",
    "unread": "0",
    "name": "Z-api - Team",
    "lastMessageTime": "1622990503",
    "muteEndTime": 1655953774000,
    "isMuted": "0",
    "isMarkedSpam": "false",
    "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".
