Mute Conversation
curl --request POST \
--url https://api.sublay.io/v8/:projectId/chat/conversations/:conversationId/mute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duration": {},
"userId": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/chat/conversations/:conversationId/mute"
payload = {
"duration": {},
"userId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({duration: {}, userId: '<string>'})
};
fetch('https://api.sublay.io/v8/:projectId/chat/conversations/:conversationId/mute', 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/:conversationId/mute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'duration' => [
],
'userId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v8/:projectId/chat/conversations/:conversationId/mute"
payload := strings.NewReader("{\n \"duration\": {},\n \"userId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sublay.io/v8/:projectId/chat/conversations/:conversationId/mute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"duration\": {},\n \"userId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/chat/conversations/:conversationId/mute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"duration\": {},\n \"userId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyChat — Conversations
Mute Conversation
Set or clear the authenticated user’s mute on a conversation
Mute Conversation
curl --request POST \
--url https://api.sublay.io/v8/:projectId/chat/conversations/:conversationId/mute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duration": {},
"userId": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/chat/conversations/:conversationId/mute"
payload = {
"duration": {},
"userId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({duration: {}, userId: '<string>'})
};
fetch('https://api.sublay.io/v8/:projectId/chat/conversations/:conversationId/mute', 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/:conversationId/mute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'duration' => [
],
'userId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v8/:projectId/chat/conversations/:conversationId/mute"
payload := strings.NewReader("{\n \"duration\": {},\n \"userId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sublay.io/v8/:projectId/chat/conversations/:conversationId/mute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"duration\": {},\n \"userId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/chat/conversations/:conversationId/mute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"duration\": {},\n \"userId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySets or clears the acting user’s mute on a conversation. Muting suppresses the
Returned when a service/master key omits the required
Returned when
message push for this conversation only — the message is still delivered, socket-emitted, and readable. Timed mutes expire lazily (push resumes once the window passes).
Requires authentication. Acting-user-scoped: an end-user token (Authorization: Bearer <accessToken>) mutes its own membership. A service/master key acts on behalf of a named user via the optional body userId — a service key without userId is rejected, and an end-user token may not name a different user (both consistent with every other per-user write). Requires the chat bundle.
Path Parameters
string
required
The ID of the conversation to mute or unmute.
Body Parameters
string | null
required
The mute duration choice — send the choice, never a raw timestamp. One of:
"8h"— mute for 8 hours from now"24h"— mute for 24 hours from now"1w"— mute for 1 week from now"forever"— mute indefinitelynull— clear the mute (unmute)
string
The acting user whose membership is muted. 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
Returns200 with the acting user’s own (self-serialized) member row under currentMember. The mutedUntil / mutedForever fields reflect the new state.
{
"currentMember": {
"id": "mbr_abc123",
"conversationId": "cnv_abc123",
"userId": "usr_abc123",
"role": "member",
"mutedForever": true,
"mutedUntil": null,
"isActive": true
}
}
“Forever” is an explicit signal. A
forever mute returns mutedForever: true with mutedUntil: null — the far-future storage sentinel is never exposed as a date. A timed mute returns mutedForever: false with a real ISO mutedUntil. An unmuted conversation returns mutedForever: false, mutedUntil: null. Read the boolean; never string-match a date.Error Responses
Unauthorized — 401 / 403
Unauthorized — 401 / 403
{ "error": "Unauthorized", "code": "chat/unauthorized" }
403 chat/unauthorized when an end-user token names a userId other than its own. A 401 is returned when no valid credential is present.Missing User ID — 400
Missing User ID — 400
{ "error": "Missing user ID", "code": "chat/missing-user-id" }
userId (it has no implicit session user).Not Found — 404
Not Found — 404
{ "error": "Conversation not found.", "code": "chat/not-found" }
Not a Member — 400
Not a Member — 400
{ "error": "You are not an active member of this conversation.", "code": "chat/not-a-member" }
Invalid Body — 400
Invalid Body — 400
{ "error": "...", "code": "chat/invalid-body" }
duration is not one of the accepted choices (or null).
