# List all chats

Returns a paginated list of your team's chats.

[endpoint]
base_url = "https://chat.betterstack.com"
path = "/api/v2/chats"
method = "GET"

[[query_param]]
name = "team_name"
description = "Filter chats belonging to a specified team when using [global API token](https://betterstack.com/docs/ai-sre/api/getting-api-token/#get-a-global-api-token)."
required = false
type = "string"

[[query_param]]
name = "page"
description = "Page number"
required = false
type = "integer"

[[query_param]]
name = "per_page"
description = "Items per page (default: 50, max: 250)"
required = false
type = "integer"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"
[/endpoint]

[responses]
[[response]]
status = 200
description = '''Returns a paginated list of chats, most recently updated first. See [Chat statuses](https://betterstack.com/docs/ai-sre/api/chats/status/#chat-statuses) for what each status means.'''
body = '''{
  "data": [
    {
      "id": "12345",
      "type": "chat",
      "attributes": {
        "team_id": 123456,
        "team_name": "example-team",
        "name": "Checkout 5xx spike",
        "status": "idle",
        "message_count": 4,
        "last_message_at": "2026-09-07T10:32:18.000Z",
        "total_tokens": 15420,
        "created_at": "2026-09-07T10:30:00.000Z",
        "updated_at": "2026-09-07T10:32:18.000Z"
      }
    }
  ],
  "pagination": {
    "first": "https://chat.betterstack.com/api/v2/chats?page=1",
    "last": "https://chat.betterstack.com/api/v2/chats?page=3",
    "prev": null,
    "next": "https://chat.betterstack.com/api/v2/chats?page=2"
  }
}'''

[[response]]
status = 401
description = '''Unauthorized'''
body = '''{
  "errors": "Invalid authentication"
}'''
[/responses]

#### Example cURL

```shell
[label Example]
curl --request GET \
  --url https://chat.betterstack.com/api/v2/chats \
  --header "Authorization: Bearer $TOKEN"
```
