c5ddcd5c7e72
Get messages from a chat
Returns a paginated list of text messages between the authenticated user and the specified user. Messages are ordered by creation date (newest first).
Pass beforeMessageUuid to anchor pagination to a known message and fetch the messages immediately older than it (stable keyset pagination). When supplied, beforeMessageUuid takes precedence over page; an unknown or unpublished anchor is ignored and the first page is returned.
Pass startDate and/or endDate to restrict results to a time window on the message publish date. Both are optional and combine with page/size pagination. Both bounds are exclusive: startDate returns messages published strictly after it, endDate messages published strictly before it. This is the recommended way to fetch "what changed since X" instead of paging blindly after a mass message.
Note that endDate suppresses markAsRead: because an upper-bounded window deliberately excludes the newest messages, marking the conversation read would clear unread state on messages this call never returned. Requests carrying endDate therefore never mark the chat as read, whatever markAsRead is set to.
<Info> **Polling for real-time updates? Use a webhook instead.**If you are calling this endpoint on a schedule to detect new activity, subscribe to the creator.message.received, creator.message.sent, creator.message.deleted, creator.message.reaction webhook events instead — you'll get pushed updates in real time without polling. See the webhook documentation. </Info>
Path parameters
Query parameters
Page number to retrieve (starts from 1)
Page number to retrieve (starts from 1)
Number of items to return per page (1-50, default: 15)
Number of items to return per page (1-50, default: 15)
Whether to mark the chat as read after retrieving messages
Whether to mark the chat as read after retrieving messages
Anchor cursor: return messages older than this message UUID. Takes precedence over page.
Anchor cursor: return messages older than this message UUID. Takes precedence over page.
Only return messages published after this ISO 8601 datetime (with optional timezone offset, e.g. 2024-10-20T00:00:00+01:00 or 2024-10-20T00:00:00Z). Exclusive lower bound. Combines with page/size.
Only return messages published after this ISO 8601 datetime (with optional timezone offset, e.g. 2024-10-20T00:00:00+01:00 or 2024-10-20T00:00:00Z). Exclusive lower bound. Combines with page/size.
Only return messages published before this ISO 8601 datetime (with optional timezone offset, e.g. 2024-10-25T00:00:00+01:00 or 2024-10-25T00:00:00Z). Non-inclusive - messages before this date are included. Combines with page/size.
Only return messages published before this ISO 8601 datetime (with optional timezone offset, e.g. 2024-10-25T00:00:00+01:00 or 2024-10-25T00:00:00Z). Non-inclusive - messages before this date are included. Combines with page/size.
Headers
API version to use for the request
Response
List of messages