Skip to content
  • Auto
  • Light
  • Dark
Download Beeper

List

List chats
client.chats.list(ChatListParams { accountIDs, cursor, direction } query?, RequestOptionsoptions?): CursorNoLimit<ChatListResponse { preview } >
get/v1/chats

List all chats sorted by last activity (most recent first). Combines all accounts into a single paginated list.

ParametersExpand Collapse
query: ChatListParams { accountIDs, cursor, direction }
accountIDs?: Array<string>

Limit to specific account IDs. If omitted, fetches from all accounts.

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
ChatListResponse extends Chat { id, accountID, network, 10 more } { preview }
preview?: Message { id, accountID, chatID, 9 more }

Last message preview for this chat, if available.

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 chats
import BeeperDesktop from '@beeper/desktop-api';

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

// Automatically fetches more pages as needed.
for await (const chatListResponse of client.chats.list()) {
  console.log(chatListResponse);
}
{
  "hasMore": true,
  "items": [
    {
      "id": "!instagram_mattwondra:local-instagram.localhost",
      "accountID": "local-instagram_ba_eRfQMmnSNy_p7Ih7HL7RduRpKFU",
      "network": "Instagram",
      "participants": {
        "hasMore": false,
        "items": [
          {
            "id": "@mattwondra:local-instagram.localhost",
            "cannotMessage": false,
            "email": "email",
            "fullName": "Matt Wondra",
            "imgURL": "imgURL",
            "isSelf": false,
            "phoneNumber": "phoneNumber",
            "username": "mattwondra"
          },
          {
            "id": "@batuhan:local-instagram.localhost",
            "cannotMessage": false,
            "email": "email",
            "fullName": "Batuhan İçöz",
            "imgURL": "imgURL",
            "isSelf": true,
            "phoneNumber": "phoneNumber",
            "username": "batuhan"
          }
        ],
        "total": 2
      },
      "title": "Matt Wondra",
      "type": "single",
      "unreadCount": 0,
      "isArchived": false,
      "isMuted": false,
      "isPinned": false,
      "lastActivity": "2025-08-31T19:41:41.000Z",
      "lastReadMessageSortKey": "449706228480",
      "localChatID": "1229391",
      "preview": {
        "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?"
      }
    }
  ],
  "newestCursor": "1725489123456",
  "oldestCursor": "1725489123456"
}
Returns Examples
{
  "hasMore": true,
  "items": [
    {
      "id": "!instagram_mattwondra:local-instagram.localhost",
      "accountID": "local-instagram_ba_eRfQMmnSNy_p7Ih7HL7RduRpKFU",
      "network": "Instagram",
      "participants": {
        "hasMore": false,
        "items": [
          {
            "id": "@mattwondra:local-instagram.localhost",
            "cannotMessage": false,
            "email": "email",
            "fullName": "Matt Wondra",
            "imgURL": "imgURL",
            "isSelf": false,
            "phoneNumber": "phoneNumber",
            "username": "mattwondra"
          },
          {
            "id": "@batuhan:local-instagram.localhost",
            "cannotMessage": false,
            "email": "email",
            "fullName": "Batuhan İçöz",
            "imgURL": "imgURL",
            "isSelf": true,
            "phoneNumber": "phoneNumber",
            "username": "batuhan"
          }
        ],
        "total": 2
      },
      "title": "Matt Wondra",
      "type": "single",
      "unreadCount": 0,
      "isArchived": false,
      "isMuted": false,
      "isPinned": false,
      "lastActivity": "2025-08-31T19:41:41.000Z",
      "lastReadMessageSortKey": "449706228480",
      "localChatID": "1229391",
      "preview": {
        "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?"
      }
    }
  ],
  "newestCursor": "1725489123456",
  "oldestCursor": "1725489123456"
}