# List conversations

GET /v1/conversations. Lists the workspace's conversations, or finds them by customer.

`GET https://api.chatwise.so/v1/conversations`

Lists the workspace's conversations, or finds them by customer. The latest activity comes first; conversations without a message come last. A conversation that gets a message while you read the pages moves to the top, so you can miss it.

`from` and `to` filter by `lastMessageAt`.

The API key needs the `conversations:read` scope. See [authentication and scopes](https://chatwise.so/docs/authentication.md).

## Example

**curl**:

```bash
curl 'https://api.chatwise.so/v1/conversations?limit=25&channel=WHATSAPP&status=open' \
  -H "Authorization: Bearer $CHATWISE_API_KEY"
```

**Node.js**:

```js
const response = await fetch("https://api.chatwise.so/v1/conversations?limit=25&channel=WHATSAPP&status=open", {
  headers: {
    Authorization: `Bearer ${process.env.CHATWISE_API_KEY}`,
  },
});
const body = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${body.message}`);
console.log(body.data);
```

**Python**:

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://api.chatwise.so/v1/conversations?limit=25&channel=WHATSAPP&status=open",
    headers={
        "Authorization": f"Bearer {os.environ['CHATWISE_API_KEY']}",
    },
)
with urllib.request.urlopen(request) as response:
    print(json.load(response)["data"])
```

## Query parameters

| Name | Type | Description |
| --- | --- | --- |
| `limit` | integer | How many to return, from 1 to 100. Default: `50`. |
| `cursor` | string | The previous page's `pagination.nextCursor`. Repeat the same filters and order with it. At most 512 characters. |
| `from` | string | Only conversations with a latest message at or after this time. ISO 8601 with a time zone, at most milliseconds. |
| `to` | string | Only conversations with a latest message before this time, which must be after `from`. ISO 8601 with a time zone, at most milliseconds. |
| `channel` | string | Only conversations on this channel. Without it, every channel, Website Chat included. One of `WHATSAPP`, `INSTAGRAM`, `MESSENGER`. |
| `status` | string | Only open or only resolved conversations. Leave out for both. One of `open`, `resolved`. |
| `q` | string | Text in the customer's name, WhatsApp number or Instagram username (with or without `@`), in any case. Spaces around it are ignored. Can't be blank, or contain NUL characters or unpaired surrogates. At most 200 characters. |

Unknown query parameters are refused with a 400.

## Response

**200.** A page of conversations.

```json
{
  "data": [
    {
      "id": "1234",
      "channel": "WHATSAPP",
      "status": "open",
      "participant": {
        "name": "Jordan Example",
        "channelId": "12025550147",
        "phoneNumber": "12025550147",
        "instagramUsername": null
      },
      "createdAt": "2026-11-01T09:12:00.000Z",
      "lastMessageAt": "2026-11-12T09:25:36.000Z"
    }
  ],
  "pagination": {
    "nextCursor": "eyJ2IjoxLCJiaW5kaW5nIjoiZXhhbXBsZSJ9"
  }
}
```

| Field | Type | Description |
| --- | --- | --- |
| `data[].id` | string | The conversation's id. |
| `data[].channel` | string | The channel the conversation is on. One of `WHATSAPP`, `INSTAGRAM`, `MESSENGER`, `WEBSITE_CHAT`. |
| `data[].status` | string | Whether the conversation is open or resolved in the inbox. One of `open`, `resolved`. |
| `data[].participant` | object | The customer. |
| `data[].participant.name` | string or null | The customer's name. A placeholder, or on Website Chat their email, when Chatwise doesn't know it. |
| `data[].participant.channelId` | string or null | The customer's id on the channel: the WhatsApp number, or an Instagram or Messenger id. Null on Website Chat. |
| `data[].participant.phoneNumber` | string or null | The customer's phone number, digits only, on WhatsApp. Null on other channels, and when WhatsApp doesn't show it. |
| `data[].participant.instagramUsername` | string or null | The customer's Instagram username, when known. Null on WhatsApp. |
| `data[].createdAt` | string | When the conversation was created in Chatwise. ISO 8601, in UTC. |
| `data[].lastMessageAt` | string or null | When the latest message was sent. Null before the first one. ISO 8601, in UTC. |
| `pagination.nextCursor` | string or null | Send it as `cursor` for the next page. Null on the last page. |

## Errors

| Status | Message | What it means |
| --- | --- | --- |
| 400 | Validation failed | A parameter or body field is missing, unknown or malformed. `errors` lists each one. |
| 400 | Invalid cursor or cursor does not match this request | The cursor isn't one this route returned, or the filters or order changed since. |
| 401 | A valid Bearer API key is required | The `Authorization` header is missing or isn't `Bearer <API key>`. |
| 401 | Invalid or revoked API key | The key doesn't exist, was revoked, or has expired. |
| 401 | Invalid API key | Chatwise couldn't check the key. Try again. |
| 403 | API key does not have the required scope: conversations:read | The key lacks the route's scope. Create a key that has it. |
| 429 | API key rate limit exceeded | Wait the number of seconds in the `Retry-After` header. |
| 500 | Internal server error | Something failed in Chatwise. Retry reads with backoff. |

The body of an error is described in [errors](https://chatwise.so/docs/errors.md).
