Get Space Conversation
curl --request GET \
--url https://api.sublay.io/v8/:projectId/spaces/:spaceId/conversation \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/spaces/:spaceId/conversation"
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/spaces/:spaceId/conversation', 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/spaces/:spaceId/conversation",
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/spaces/:spaceId/conversation"
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/spaces/:spaceId/conversation")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/spaces/:spaceId/conversation")
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{
"currentMember": {},
"memberCount": 123
}Space — Chat
Get Space Conversation
Get or create the chat conversation for a space
Get Space Conversation
curl --request GET \
--url https://api.sublay.io/v8/:projectId/spaces/:spaceId/conversation \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/spaces/:spaceId/conversation"
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/spaces/:spaceId/conversation', 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/spaces/:spaceId/conversation",
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/spaces/:spaceId/conversation"
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/spaces/:spaceId/conversation")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/spaces/:spaceId/conversation")
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{
"currentMember": {},
"memberCount": 123
}Returns the chat conversation associated with a space. If no conversation exists yet, one is created automatically. Requires authentication. The caller must be an active member of the space: a request still awaiting approval, a rejected request and a ban are all refused.
See also: useFetchSpaceConversation hook
Path Parameters
string
required
UUID of the space.
Response
Returns a Conversation object with two additional fields:object | null
The caller’s
ConversationMember record for this conversation. Created or re-activated on first call.number
Number of currently active members in the conversation.
Each space has at most one associated conversation. This endpoint is idempotent — calling it multiple times returns the same conversation.
Error Responses
Not a Member — 403
Not a Member — 403
Also returned when the caller’s request to join was rejected.
{ "error": "You are not a member of this space.", "code": "chat/not-a-member" }
Awaiting Approval — 403
Awaiting Approval — 403
{ "error": "Your request to join this space is awaiting approval.", "code": "chat/membership-pending" }
Banned — 403
Banned — 403
{ "error": "You are banned from this space.", "code": "chat/banned" }

