Get messages from a chat
Changed onReturns a paginated list of text messages between the authenticated user and the specified user. Messages are ordered by creation date (newest first).
The thread includes mass (broadcast) messages the creator sent that reached this user, interleaved with the 1:1 messages by publish date. POST /chats/messages/batch returns direct messages only, so the two endpoints return different messages for the same chat.
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>
Request
- Base URLhttps://api.fanvue.com
- AuthOAuth 2Authorization codehttps://auth.fanvue.com/oauth2/authToken URLhttps://auth.fanvue.com/oauth2/tokenScopesread:chat
Path parameters
Query parameters
Page number to retrieve (starts from 1)
Number of items to return per page (1-50, default: 15)
Whether to mark the chat as read after retrieving messages
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 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
Changes
- warning
added the new
AUTOMATED_FREE_TRIAL_ENDINGenum value to thedata/items/typeresponse property for the response status - warning
added the new
AUTOMATED_NEW_FREE_TRIALenum value to thedata/items/typeresponse property for the response status - warning
added the new
Too many concurrent requestsenum value to theerrorresponse property for the response status
2 more changes in this revision
- warning