## List `$client->messages->list(string chatID, ?string cursor, ?Direction direction): CursorSortKey` **get** `/v1/chats/{chatID}/messages` List all messages in a chat with cursor-based pagination. Sorted by timestamp. ### Parameters - `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. ### Returns - `Message` - `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 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 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. ### Example ```php messages->list( '!NCdzlIaMjZUmvmvyHU:beeper.com', cursor: '1725489123456|c29tZUltc2dQYWdl', direction: 'before', ); var_dump($page); ```