Get messages from multiple chats in bulk
curl --request POST \
--url https://api.fanvue.com/v1/chats/messages/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Fanvue-API-Version: <x-fanvue-api-version>' \
--data '
{
"chatUuids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.fanvue.com/v1/chats/messages/batch"
payload = { "chatUuids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] }
headers = {
"X-Fanvue-API-Version": "<x-fanvue-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Fanvue-API-Version': '<x-fanvue-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({chatUuids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://api.fanvue.com/v1/chats/messages/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"byChat": {
"b2c3d4e5-6f7g-8h9i-0j1k-l2m3n4o5p6q7": {
"messages": [
{
"uuid": "a1b2c3d4-5e6f-7g8h-9i0j-k1l2m3n4o5p6",
"text": "Hey there! How are you doing?",
"sentAt": "2024-01-15T00:00:00.000Z",
"sender": {
"uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"handle": "sarah-jones",
"nickname": "SarahK",
"displayName": "Sarah Jones",
"isTopSpender": true,
"avatarUrl": "https://media.fanvue.com/avatars/example-avatar.jpg",
"registeredAt": "2024-01-10T12:00:00.000Z"
},
"recipient": {
"uuid": "3bbe6394-2830-4646-a8ba-4a0a05426947",
"handle": "johnny-doey",
"nickname": "JohnnyD",
"displayName": "Johnny Doey",
"isTopSpender": true,
"avatarUrl": "https://media.fanvue.com/avatars/example-avatar.jpg",
"registeredAt": "2024-01-10T12:00:00.000Z"
},
"type": "SINGLE_RECIPIENT",
"hasMedia": false,
"mediaType": null,
"mediaUuids": [],
"mediaPreviewUuid": null,
"gif": null,
"pricing": null,
"purchasedAt": null,
"sentByUserId": null,
"appUuid": "f6a7b8c9-0123-4567-89ab-cdef01234567",
"isRead": true
}
],
"hasMore": true,
"oldestMessageUuid": "a1b2c3d4-5e6f-7g8h-9i0j-k1l2m3n4o5p6"
},
"c3d4e5f6-7890-1234-5678-9abcdef01234": {
"error": "not_found"
}
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"message": "<string>",
"nextVersion": "<string>"
}{
"error": "Too many requests",
"rateLimit": {
"scope": "app",
"layer": "<string>",
"limit": 123,
"windowSeconds": 123,
"retryAfterSeconds": 123,
"docs": "<string>"
}
}Chats
Get messages from multiple chats in bulk
Returns the most recent messages for up to 50 chats in a single request, keyed by the input chat UUID (the counterpart user UUID).
This is the bulk counterpart to GET /chats/{userUuid}/messages. It collapses N per-chat round trips into one POST and is intended for initial-sync flows and incremental refreshes.
Per-key errors are reported inside the 200 response body so a single unreachable chat never collapses the whole request — consumers keep the rest and only retry the failing keys.
Modes:
- Default: returns the latest
limitmessages per chat, newest first.hasMoreindicates older messages exist. - Incremental (
sinceMessageUuid): returns messages strictly newer than the cursor message, newest first. The cursor is the message itself, not its timestamp, so a message sharing the cursor’s publish instant is still returned.
Out of scope: Backwards history pagination (a before cursor). Use oldestMessageUuid from the response as the anchor when that ships.
Maximum 50 chat UUIDs per request. Failed keys are reported as
{ "error": "not_found" } — this covers both chats that don’t exist and chats the caller isn’t part of.Read-only: fetching messages in bulk does not mutate read state — messages are not marked read and
isRead reflects each message’s state at read time.Direct messages only. Mass (broadcast) messages are excluded from this endpoint. The per-chat listing endpoints include them interleaved with the 1:1 thread, so the two surfaces legitimately return different messages for the same chat — a message present in a chat listing can be absent here without anything being lost. Creators can list the broadcasts they sent via
GET /chats/mass-messages; that endpoint is creator-only, so fans have no separate listing of received broadcasts and should read them from the per-chat listing.Rate-limit cost. Each request consumes one rate-limit point per 10 chat UUIDs, rounded up: 1-10 chats cost 1 point, 50 chats cost 5.
POST
/
v1
/
chats
/
messages
/
batch
Get messages from multiple chats in bulk
curl --request POST \
--url https://api.fanvue.com/v1/chats/messages/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Fanvue-API-Version: <x-fanvue-api-version>' \
--data '
{
"chatUuids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.fanvue.com/v1/chats/messages/batch"
payload = { "chatUuids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] }
headers = {
"X-Fanvue-API-Version": "<x-fanvue-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Fanvue-API-Version': '<x-fanvue-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({chatUuids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://api.fanvue.com/v1/chats/messages/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"byChat": {
"b2c3d4e5-6f7g-8h9i-0j1k-l2m3n4o5p6q7": {
"messages": [
{
"uuid": "a1b2c3d4-5e6f-7g8h-9i0j-k1l2m3n4o5p6",
"text": "Hey there! How are you doing?",
"sentAt": "2024-01-15T00:00:00.000Z",
"sender": {
"uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"handle": "sarah-jones",
"nickname": "SarahK",
"displayName": "Sarah Jones",
"isTopSpender": true,
"avatarUrl": "https://media.fanvue.com/avatars/example-avatar.jpg",
"registeredAt": "2024-01-10T12:00:00.000Z"
},
"recipient": {
"uuid": "3bbe6394-2830-4646-a8ba-4a0a05426947",
"handle": "johnny-doey",
"nickname": "JohnnyD",
"displayName": "Johnny Doey",
"isTopSpender": true,
"avatarUrl": "https://media.fanvue.com/avatars/example-avatar.jpg",
"registeredAt": "2024-01-10T12:00:00.000Z"
},
"type": "SINGLE_RECIPIENT",
"hasMedia": false,
"mediaType": null,
"mediaUuids": [],
"mediaPreviewUuid": null,
"gif": null,
"pricing": null,
"purchasedAt": null,
"sentByUserId": null,
"appUuid": "f6a7b8c9-0123-4567-89ab-cdef01234567",
"isRead": true
}
],
"hasMore": true,
"oldestMessageUuid": "a1b2c3d4-5e6f-7g8h-9i0j-k1l2m3n4o5p6"
},
"c3d4e5f6-7890-1234-5678-9abcdef01234": {
"error": "not_found"
}
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"message": "<string>",
"nextVersion": "<string>"
}{
"error": "Too many requests",
"rateLimit": {
"scope": "app",
"layer": "<string>",
"limit": 123,
"windowSeconds": 123,
"retryAfterSeconds": 123,
"docs": "<string>"
}
}Required scope
read:chat— Read chat conversations, messages, and chat-related data. This includes viewing chat lists and message history.
Authorizations
Scopes
Headers
Body
application/json
Was this page helpful?