# List messages

> List messages across any combination of channels — inbound + outbound — with filtering.

Source: https://docs.mycrmsim.com/docs/messages/list-messages

```http
GET https://backend.mysmsgateway.app/api/v1/ext/messages
```

- Category: myCRMSIM Messages / Messages
- Auth: Bearer access token
- Scope: `messages.read`
- Guide: [Status and inbound message callbacks — have new SMS and delivery statuses pushed to your app instead of polling](https://docs.mycrmsim.com/guides/app-callbacks)

Returns the messages in the installer's workspaces, every channel in one list, from the same conversation records the app.mycrmsim.com Conversations page shows. All filters are optional and combine with AND semantics.

**One id everywhere.** A row's `id` (and `message_id`, the same value as a string) is the message id the other message endpoints take: GET /messages/{id} for its status, POST /messages/{id}/reactions to react to it, and the `id` in the conversation thread. That holds for inbound messages too.

**Order.** One list across channels, ordered by `created_at` (newest first by default). `breakdown` counts the matching messages per channel; `total` is their sum.

Without `workspace_id`, every workspace the installer owns is listed.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `channel` | query | string | no | Restrict to one or more channels. Single value or comma-separated subset of "sms", "whatsapp", "imessage", "rcs", "twilio", "webchat", "openvox". Omit for all. Example: `sms,whatsapp` |
| `workspace_id` | query | number | no | Filter to one workspace. Must belong to the installer. Example: `7` |
| `phone` | query | string | no | Filter to messages exchanged with this phone number (E.164), or Apple ID email for iMessage — every channel. Example: `+15551234567` |
| `status` | query | string | no | Single value or comma-separated list of statuses. **Case-insensitive** — `?status=Sent`, `?status=SENT` and `?status=sent` all match. Values: "queued", "webhook_sent", "accepted", "sent", "delivered", "read", "failed", "received", "unsent". Example: `sent,delivered` |
| `page` | query | number | no | Page number (>= 1). Default 1. Anything else is a 400. Example: `1` |
| `limit` | query | number | no | Page size (1-100). Default 25. Anything else is a 400. Example: `25` |
| `sort` | query | enum | no | Sort by created_at — "created_at_asc" or "created_at_desc". Default "created_at_desc". One of: `created_at_asc`, `created_at_desc`. |

## Response fields (messages)

| Field | Type | Description |
| --- | --- | --- |
| `id` | number | The message id. The same id works with Get message status, React to message, and in the conversation thread. |
| `message_id` | string | The same id as a string — the `message_id` a Send message response returns. |
| `channel` | enum | Which channel the message belongs to — "sms" \| "whatsapp" \| "imessage" \| "rcs" \| "twilio" \| "webchat" \| "openvox". |
| `workspace_id` | number | The workspace this message belongs to. |
| `contact_id` | number, nullable | The contact the message was sent to / received from. Null for group messages. |
| `direction` | enum | "outbound" (sent from the workspace) or "inbound" (received). |
| `to` | string, nullable | Outbound: the contact's phone (E.164), or Apple ID email for iMessage. Null for inbound messages. |
| `from` | string, nullable | Inbound: the contact's phone or Apple ID email — in a group, the member who wrote it. Null for outbound messages. |
| `is_group` | boolean | True for a message in a group conversation (WhatsApp or iMessage group). |
| `text` | string (text), nullable | The message body. May be null when only media was sent. |
| `effect` | string, nullable | The iMessage send effect on the message (either direction), e.g. "confetti" or "slam"; null when there is none. The text then starts with a "✦ Effect: <name>" line. |
| `reaction` | object, nullable | Set when the message is an iMessage reaction (tapback) to another message, in either direction: { kind, emoji, snippet }. `kind` is love \| like \| dislike \| laugh \| emphasize \| question, or "emoji" for a custom-emoji reaction from a contact; `snippet` is the start of the message reacted to. Null for any other message. The text is the reaction line, e.g. "❤️ Loved: “See you at 5?”". |
| `media` | array<{url,type}>, nullable | Media attachments, or null when there are none. |
| `status` | string, nullable | queued \| webhook_sent \| accepted \| sent \| delivered \| read \| failed \| received \| unsent. |
| `error_message` | string, nullable | Why a failed message failed; null otherwise. |
| `created_at` | string (ISO 8601) | When the message was created. |
| `updated_at` | string (ISO 8601), nullable | When the message was last updated. |

## Response 200

OK — interleaved across channels, newest first

```json
{
  "success": true,
  "data": {
    "messages": [
      {
        "id": 84220,
        "message_id": "84220",
        "channel": "imessage",
        "workspace_id": 7,
        "contact_id": 1234,
        "direction": "inbound",
        "to": null,
        "from": "+15551234567",
        "is_group": false,
        "text": "❤️ Loved: “Here is the brochure.”",
        "effect": null,
        "reaction": {
          "kind": "love",
          "emoji": "❤️",
          "snippet": "Here is the brochure."
        },
        "media": null,
        "status": "received",
        "error_message": null,
        "created_at": "2026-06-09T14:24:00.000Z",
        "updated_at": "2026-06-09T14:24:00.000Z"
      },
      {
        "id": 84218,
        "message_id": "84218",
        "channel": "whatsapp",
        "workspace_id": 7,
        "contact_id": 1234,
        "direction": "outbound",
        "to": "+15551234567",
        "from": null,
        "is_group": false,
        "text": "Here is the brochure.",
        "effect": null,
        "reaction": null,
        "media": [
          {
            "url": "https://cdn.example.com/brochure.pdf",
            "type": "application/pdf"
          }
        ],
        "status": "delivered",
        "error_message": null,
        "created_at": "2026-06-09T14:23:00.000Z",
        "updated_at": "2026-06-09T14:23:05.000Z"
      },
      {
        "id": 84213,
        "message_id": "84213",
        "channel": "sms",
        "workspace_id": 7,
        "contact_id": 1234,
        "direction": "outbound",
        "to": "+15551234567",
        "from": null,
        "is_group": false,
        "text": "Thanks for your enquiry — we open at 09:00.",
        "effect": null,
        "reaction": null,
        "media": null,
        "status": "sent",
        "error_message": null,
        "created_at": "2026-06-09T14:22:07.000Z",
        "updated_at": "2026-06-09T14:22:07.000Z"
      },
      {
        "id": 84190,
        "message_id": "84190",
        "channel": "rcs",
        "workspace_id": 7,
        "contact_id": 1234,
        "direction": "outbound",
        "to": "+15551234567",
        "from": null,
        "is_group": false,
        "text": "Booking confirmed for 4 PM.",
        "effect": null,
        "reaction": null,
        "media": null,
        "status": "failed",
        "error_message": "Device offline",
        "created_at": "2026-06-09T14:20:00.000Z",
        "updated_at": "2026-06-09T14:20:30.000Z"
      }
    ],
    "total": 87,
    "page": 1,
    "limit": 25,
    "breakdown": {
      "sms": 32,
      "whatsapp": 28,
      "imessage": 19,
      "rcs": 8
    }
  }
}
```

## Response 400

Validation — unknown channel value

```json
{
  "success": false,
  "message": "Unknown channel(s): mms. Allowed: sms, whatsapp, imessage, rcs, twilio, webchat, openvox"
}
```

## Response 400

Validation — bad sort key

```json
{
  "success": false,
  "message": "sort must be created_at_asc or created_at_desc."
}
```

## Response 401

Missing or invalid token

```json
{
  "success": false,
  "message": "Invalid or expired access token."
}
```

## Response 403

Missing scope

```json
{
  "success": false,
  "message": "Missing scope(s): messages.read."
}
```

## Response 404

workspace_id is not accessible to this token

```json
{
  "success": false,
  "message": "Workspace not found or not accessible to this token"
}
```

## Response 500

Unexpected server error

```json
{
  "success": false,
  "message": "Failed to list messages."
}
```
