# List group messages

`GET https://app.whatsetter.com/api/v1/groups/{id}/messages`

The group's transcript, newest first. `sender` keeps one member's
messages (international phone digits), `from_agent=true` keeps only
what WhatSetter sent through the connected number (AI or manual
replies), `since` / `until` bound the window. Media is flagged
(`has_media`, `media_type`) but never linked. Requires scope
`groups:read`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes |  |
| `since` | query | string | no | ISO-8601 — only messages sent at or after this instant. |
| `until` | query | string | no | ISO-8601 — only messages sent at or before this instant. |
| `sender` | query | string | no | One member's phone, international digits (e.g. `33612345678`). |
| `from_agent` | query | boolean | no | `true` = only messages WhatSetter sent (AI or manual); `false` = only members' messages. |
| `limit` | query | integer | no |  |
| `cursor` | query | string | no | Opaque cursor from the previous page's `pagination.next_cursor`. |

## Example request

```bash
curl --request GET \
  --url 'https://app.whatsetter.com/api/v1/groups/{id}/messages' \
  --header 'Authorization: Bearer ws_live_…'
```

## Responses

### 200: Page of messages

```json
{
  "data": [
    {
      "id": "",
      "whatsapp_message_id": "",
      "sender": {
        "phone": "",
        "name": ""
      },
      "from_agent": false,
      "ai_generated": false,
      "text": "",
      "type": "",
      "is_mention": false,
      "has_media": false,
      "media_type": "",
      "sent_at": ""
    }
  ],
  "pagination": {
    "has_more": false,
    "next_cursor": ""
  }
}
```

### 401: Missing, unknown or revoked API key

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 404: Resource not found in this workspace

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 422: Invalid parameter or body (also an invalid or expired `cursor`)

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```


Source: https://docs.whatsetter.com/api-reference/operations/listgroupmessages/
