Skip to content
Download Beeper

List messages

$client->messages->list(string chatID, ?string cursor, ?Direction direction): CursorSortKey<Message>
GET/v1/chats/{chatID}/messages

List all messages in a chat with cursor-based pagination. Sorted by timestamp.

ParametersExpand Collapse
chatID: string

Unique identifier of the chat.

cursor?:optional string

Opaque pagination cursor; do not inspect. Use together with 'direction'.

direction?:optional Direction

Pagination direction used with 'cursor': 'before' fetches older results, 'after' fetches newer results. Defaults to 'before' when only 'cursor' is provided.

ReturnsExpand Collapse
string id

Message ID.

string accountID

Beeper account ID the message belongs to.

string chatID

Unique identifier of the chat.

string senderID

Sender user ID.

string sortKey

A unique, sortable key used to sort messages.

\Datetime timestamp

Message timestamp.

?list<Attachment> attachments

Attachments included with this message, if any.

?bool isSender

True if the authenticated user sent the message.

?bool isUnread

True if the message is unread for the authenticated user. May be omitted.

?string linkedMessageID

ID of the message this is a reply to, if any.

?list<Reaction> reactions

Reactions to the message, if any.

?string senderName

Resolved sender display name (impersonator/full name/username/participant name).

?string text

Plain-text body if present. May include a JSON fallback with text entities for rich messages.

?Type type

Message content type. Useful for distinguishing reactions, media messages, and state events from regular text messages.

List messages

<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client();

$page = $client->messages->list(
  '!NCdzlIaMjZUmvmvyHU:beeper.com',
  cursor: '1725489123456|c29tZUltc2dQYWdl',
  direction: 'before',
);

var_dump($page);
{
  "hasMore": true,
  "items": [
    {
      "id": "1343993",
      "accountID": "local-signal_ba_7N74FrU29pxij_TnqfxeUHj53FY",
      "chatID": "!signal_adamvy:local-signal.localhost",
      "senderID": "@adamvy:local-signal.localhost",
      "sortKey": "aaaa1",
      "timestamp": "2025-08-28T11:04:29.621Z",
      "attachments": [
        {
          "type": "unknown",
          "id": "id",
          "duration": 0,
          "fileName": "fileName",
          "fileSize": 0,
          "isGif": true,
          "isSticker": true,
          "isVoiceNote": true,
          "mimeType": "mimeType",
          "posterImg": "posterImg",
          "size": {
            "height": 0,
            "width": 0
          },
          "srcURL": "srcURL"
        }
      ],
      "isSender": false,
      "isUnread": false,
      "linkedMessageID": "linkedMessageID",
      "reactions": [
        {
          "id": "id",
          "participantID": "participantID",
          "reactionKey": "reactionKey",
          "emoji": true,
          "imgURL": "imgURL"
        }
      ],
      "senderName": "Adam Van Ymeren",
      "text": "Hey, can we reschedule our meeting to 3pm?",
      "type": "TEXT"
    }
  ]
}
Returns Examples
{
  "hasMore": true,
  "items": [
    {
      "id": "1343993",
      "accountID": "local-signal_ba_7N74FrU29pxij_TnqfxeUHj53FY",
      "chatID": "!signal_adamvy:local-signal.localhost",
      "senderID": "@adamvy:local-signal.localhost",
      "sortKey": "aaaa1",
      "timestamp": "2025-08-28T11:04:29.621Z",
      "attachments": [
        {
          "type": "unknown",
          "id": "id",
          "duration": 0,
          "fileName": "fileName",
          "fileSize": 0,
          "isGif": true,
          "isSticker": true,
          "isVoiceNote": true,
          "mimeType": "mimeType",
          "posterImg": "posterImg",
          "size": {
            "height": 0,
            "width": 0
          },
          "srcURL": "srcURL"
        }
      ],
      "isSender": false,
      "isUnread": false,
      "linkedMessageID": "linkedMessageID",
      "reactions": [
        {
          "id": "id",
          "participantID": "participantID",
          "reactionKey": "reactionKey",
          "emoji": true,
          "imgURL": "imgURL"
        }
      ],
      "senderName": "Adam Van Ymeren",
      "text": "Hey, can we reschedule our meeting to 3pm?",
      "type": "TEXT"
    }
  ]
}