List Conversations
curl --request GET \
--url https://api.sublay.io/v8/:projectId/chat/conversations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/chat/conversations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/chat/conversations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/v8/:projectId/chat/conversations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v8/:projectId/chat/conversations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sublay.io/v8/:projectId/chat/conversations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/chat/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"conversations": [
{
"unreadCount": 123,
"memberCount": 123,
"mutedUntil": {},
"mutedForever": true,
"lastMessage": {
"id": "<string>",
"conversationId": "<string>",
"content": {},
"gif": {},
"userId": "<string>",
"userDeletedAt": {},
"createdAt": "<string>",
"files": [
null
],
"user": {}
},
"otherMembers": [
{}
]
}
],
"hasMore": true
}Chat — Conversations
List Conversations
Get the current user’s conversations, ordered by most recent activity
List Conversations
curl --request GET \
--url https://api.sublay.io/v8/:projectId/chat/conversations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/chat/conversations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/chat/conversations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/v8/:projectId/chat/conversations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v8/:projectId/chat/conversations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sublay.io/v8/:projectId/chat/conversations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/chat/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"conversations": [
{
"unreadCount": 123,
"memberCount": 123,
"mutedUntil": {},
"mutedForever": true,
"lastMessage": {
"id": "<string>",
"conversationId": "<string>",
"content": {},
"gif": {},
"userId": "<string>",
"userDeletedAt": {},
"createdAt": "<string>",
"files": [
null
],
"user": {}
},
"otherMembers": [
{}
]
}
],
"hasMore": true
}Returns a cursor-paginated list of
To fetch a single conversation in this same shape — one that was paginated out, or just created — use Fetch Conversation Preview. Both endpoints are served by the same query, so the shapes stay identical.
ConversationPreview objects for the acting user. Only active memberships are included. Results are ordered by lastMessageAt descending (conversations with no messages appear last, ordered by createdAt).
A
direct conversation stays out of both parties’ lists until it has a visible last message, so an opened-but-never-sent DM is invisible to the other side. If a DM’s only message is later deleted or moderated away, it drops back out of the list and reappears when either party sends again. group and space conversations appear from creation.Query Parameters
string
Comma-separated list of conversation types to include. Valid values:
direct, group, space. If omitted, all types are returned. Example: types=direct,groupstring
The
lastMessageAt timestamp of the last item in the previous page. Used for cursor pagination. Omit for the first page.string
The
createdAt timestamp of the last item in the previous page. Required together with cursor when paginating.number
Number of conversations to return per page. Defaults to
20. Maximum 50.string
The acting user whose conversations are listed. Service/master keys only — a service key must pass it (there is no implicit session user); an end-user token infers it from the auth token and may not name a different user.
Response
ConversationPreview[]
Array of conversation preview objects. Each item is a Conversation extended with the following fields:
Show ConversationPreview fields
Show ConversationPreview fields
number
Number of unread messages in this conversation for the acting user.
number
Number of active members.
string | null
ISO timestamp until which the acting user has muted this conversation.
null when the conversation is not muted, and also when it is muted forever.boolean
Whether the acting user has muted this conversation indefinitely. A forever mute returns
mutedForever: true with mutedUntil: null — the far-future storage sentinel is never exposed as a date. Read the boolean; never string-match a date.ChatMessage | null
The most recent visible message in the conversation, or
null if there is none. The same object the message:created socket event delivers, so both paths render identically.Show lastMessage fields
Show lastMessage fields
string
UUID of the message.
string
UUID of the conversation the message belongs to.
string | null
Message text, truncated to 100 characters for list performance. Fetch the message itself for the full content.
object | null
Attached GIF, if the message carries one.
string
UUID of the sender.
string | null
Set when the sender’s account has been deleted.
string
ISO timestamp of when the message was sent.
File[]
Attached files, with proxy URLs and image variants resolved. Empty array when the message has no attachments.
object | null
Sender identity (
id, name, username, avatar, reputation) — populated for group and space conversations only. Always null for direct conversations, where the counterparty is already in otherMembers.object[]
Up to 5 active members of the conversation other than the acting user, each with public user fields (
id, name, username, avatar). Populated for direct and group conversations only — a DM/group has no name, so the counterparty is how a client renders the title and avatar. Capped at 5 (a preview avatar stack needs a few, not all — use memberCount for the full group total). Always an empty array ([]) for space conversations, whose membership can be large and which carry their own name. Ordered by member join time.boolean
Whether more conversations exist beyond this page.

