Skip to content
Download Beeper

List messages

client.messages.list(stringchatID, MessageListParams { cursor, direction } query?, RequestOptionsoptions?): CursorSortKey<Message { id, accountID, chatID, 9 more } >
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.

query: MessageListParams { cursor, direction }
cursor?: string

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

direction?: "after" | "before"

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

Accepts one of the following:
"after"
"before"
ReturnsExpand Collapse
Message { id, accountID, chatID, 9 more }
id: string

Message ID.

accountID: string

Beeper account ID the message belongs to.

chatID: string

Unique identifier of the chat.

senderID: string

Sender user ID.

sortKey: string

A unique, sortable key used to sort messages.

timestamp: string

Message timestamp.

formatdate-time
attachments?: Array<Attachment { type, duration, fileName, 8 more } >

Attachments included with this message, if any.

type: "unknown" | "img" | "video" | "audio"

Attachment type.

Accepts one of the following:
"unknown"
"img"
"video"
"audio"
duration?: number

Duration in seconds (audio/video).

fileName?: string

Original filename if available.

fileSize?: number

File size in bytes if known.

isGif?: boolean

True if the attachment is a GIF.

isSticker?: boolean

True if the attachment is a sticker.

isVoiceNote?: boolean

True if the attachment is a voice note.

mimeType?: string

MIME type if known (e.g., 'image/png').

posterImg?: string

Preview image URL for video attachments (poster frame). May be temporary or local-only to this device; download promptly if durable access is needed.

size?: Size { height, width }

Pixel dimensions of the attachment: width/height in px.

height?: number
width?: number
srcURL?: string

Public URL or local file path to fetch the asset. May be temporary or local-only to this device; download promptly if durable access is needed.

isSender?: boolean

True if the authenticated user sent the message.

isUnread?: boolean

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

reactions?: Array<Reaction { id, participantID, reactionKey, 2 more } >

Reactions to the message, if any.

id: string

Reaction ID, typically ${participantID}${reactionKey} if multiple reactions allowed, or just participantID otherwise.

participantID: string

User ID of the participant who reacted.

reactionKey: string

The reaction key: an emoji (😄), a network-specific key, or a shortcode like "smiling-face".

emoji?: boolean

True if the reactionKey is an emoji.

imgURL?: string

URL to the reaction's image. May be temporary or local-only to this device; download promptly if durable access is needed.

senderName?: string

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

text?: string

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

List messages
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: 'My Access Token',
});

// Automatically fetches more pages as needed.
for await (const message of client.messages.list('!NCdzlIaMjZUmvmvyHU:beeper.com')) {
  console.log(message.id);
}
{
  "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",
          "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,
      "reactions": [
        {
          "id": "id",
          "participantID": "participantID",
          "reactionKey": "reactionKey",
          "emoji": true,
          "imgURL": "imgURL"
        }
      ],
      "senderName": "Adam Van Ymeren",
      "text": "Hey, can we reschedule our meeting to 3pm?"
    }
  ]
}
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",
          "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,
      "reactions": [
        {
          "id": "id",
          "participantID": "participantID",
          "reactionKey": "reactionKey",
          "emoji": true,
          "imgURL": "imgURL"
        }
      ],
      "senderName": "Adam Van Ymeren",
      "text": "Hey, can we reschedule our meeting to 3pm?"
    }
  ]
}