Handle Message Report
curl --request PATCH \
--url https://api.sublay.io/v8/:projectId/spaces/:spaceId/chat/reports/:reportId \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
"<string>"
],
"messageId": "<string>",
"summary": "<string>",
"reason": "<string>",
"actingUserId": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/spaces/:spaceId/chat/reports/:reportId"
payload = {
"actions": ["<string>"],
"messageId": "<string>",
"summary": "<string>",
"reason": "<string>",
"actingUserId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
actions: ['<string>'],
messageId: '<string>',
summary: '<string>',
reason: '<string>',
actingUserId: '<string>'
})
};
fetch('https://api.sublay.io/v8/:projectId/spaces/:spaceId/chat/reports/:reportId', 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/chat/reports/:reportId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'actions' => [
'<string>'
],
'messageId' => '<string>',
'summary' => '<string>',
'reason' => '<string>',
'actingUserId' => '<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/spaces/:spaceId/chat/reports/:reportId"
payload := strings.NewReader("{\n \"actions\": [\n \"<string>\"\n ],\n \"messageId\": \"<string>\",\n \"summary\": \"<string>\",\n \"reason\": \"<string>\",\n \"actingUserId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sublay.io/v8/:projectId/spaces/:spaceId/chat/reports/:reportId")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n \"<string>\"\n ],\n \"messageId\": \"<string>\",\n \"summary\": \"<string>\",\n \"reason\": \"<string>\",\n \"actingUserId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/spaces/:spaceId/chat/reports/:reportId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"actions\": [\n \"<string>\"\n ],\n \"messageId\": \"<string>\",\n \"summary\": \"<string>\",\n \"reason\": \"<string>\",\n \"actingUserId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySpace — Moderation
Handle Message Report
Resolve a reported chat message within a space
Handle Message Report
curl --request PATCH \
--url https://api.sublay.io/v8/:projectId/spaces/:spaceId/chat/reports/:reportId \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
"<string>"
],
"messageId": "<string>",
"summary": "<string>",
"reason": "<string>",
"actingUserId": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/spaces/:spaceId/chat/reports/:reportId"
payload = {
"actions": ["<string>"],
"messageId": "<string>",
"summary": "<string>",
"reason": "<string>",
"actingUserId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
actions: ['<string>'],
messageId: '<string>',
summary: '<string>',
reason: '<string>',
actingUserId: '<string>'
})
};
fetch('https://api.sublay.io/v8/:projectId/spaces/:spaceId/chat/reports/:reportId', 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/chat/reports/:reportId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'actions' => [
'<string>'
],
'messageId' => '<string>',
'summary' => '<string>',
'reason' => '<string>',
'actingUserId' => '<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/spaces/:spaceId/chat/reports/:reportId"
payload := strings.NewReader("{\n \"actions\": [\n \"<string>\"\n ],\n \"messageId\": \"<string>\",\n \"summary\": \"<string>\",\n \"reason\": \"<string>\",\n \"actingUserId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sublay.io/v8/:projectId/spaces/:spaceId/chat/reports/:reportId")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n \"<string>\"\n ],\n \"messageId\": \"<string>\",\n \"summary\": \"<string>\",\n \"reason\": \"<string>\",\n \"actingUserId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/spaces/:spaceId/chat/reports/:reportId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"actions\": [\n \"<string>\"\n ],\n \"messageId\": \"<string>\",\n \"summary\": \"<string>\",\n \"reason\": \"<string>\",\n \"actingUserId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyResolves a filed report against a chat message in a space’s integrated conversation. Requires the caller to be a moderator or admin of that space.
Path Parameters
string
required
UUID of the space.
string
required
UUID of the chat message report to resolve.
Body Parameters
string[]
required
One or more actions to take. Must contain at least one value. Available actions:
"remove-message"— marks the reported message as removed via moderation"ban-user"— bans the author of the reported content from the space and the child spaces where they are an active member, and ends their membership of those spaces’ chats, so they can no longer post to or receive them (they keep read access to messages from before the ban). The same rules as Ban Member apply, with the same errors: a moderator cannot ban a moderator or admin, only the space creator can ban an admin, and the last admin of a space cannot be banned. A refused ban rolls back the whole request, including any removal in the same request. An author who is not a member of the space (for example, who left before the report was handled) is banned all the same: the ban is kept as a banned membership, so they can’t join the space or its child spaces. If the author is already banned in the space, the ban is not repeated and the rest of the request still applies; it is still re-applied to their active memberships in child spaces, under the same rules (requiresreason)"dismiss"— dismisses the report without action (cannot be combined with other actions)
string
Optional. The message acted on is the report’s own; if sent,
messageId must be that message.string
Optional summary of the action taken. Stored as
actionTaken on the report record.string
Reason for the ban, kept in the space’s ban log. Required when
ban-user is included in actions.string
Service or master key only: the moderator the key acts for. The request then has exactly that moderator’s permissions, so it is refused if they cannot moderate the space or are not allowed the ban.
Response
Returns200 OK:
{ "message": "Report handled successfully.", "code": "report/handled" }
Error Responses
Report Not Found — 404
Report Not Found — 404
{ "error": "Report not found.", "code": "report/not-found" }
Report Not in Space — 404
Report Not in Space — 404
{ "error": "Report does not belong to this space.", "code": "report/not-found-in-space" }
Message Not Found — 404
Message Not Found — 404
{ "error": "Message not found.", "code": "chat/message-not-found" }
User Not Found — 404
User Not Found — 404
{ "error": "User not found.", "code": "report/user-not-found" }
Invalid Action Combination — 400
Invalid Action Combination — 400
{ "error": "Cannot combine 'dismiss' with other actions.", "code": "report/invalid-actions" }
Missing Reason — 400
Missing Reason — 400
{ "error": "reason is required for banning a user", "code": "report/missing-fields" }
userId Not Accepted — 400
userId Not Accepted — 400
ban-user bans the author of the reported content, so the request takes no userId.{ "error": "userId is not accepted: ban-user bans the author of the reported content.", "code": "report/user-id-not-accepted" }
No Author — 400
No Author — 400
The reported content has no author to ban (for example, its author deleted their account).
{ "error": "The reported content has no author to ban.", "code": "report/no-author" }
Target Mismatch — 400
Target Mismatch — 400
The
messageId sent does not match what the report is about, or the report is about another kind of content.{ "error": "The supplied target id does not match the target of this report", "code": "report/target-mismatch" }
{ "error": "This report targets a comment, not a message", "code": "report/target-type-mismatch" }
Not a Moderator — 403
Not a Moderator — 403
The user named by
actingUserId cannot moderate this space.{ "error": "Moderator access required", "code": "space/moderator-required" }
Acting User Not Found — 400
Acting User Not Found — 400
{ "error": "Acting user not found.", "code": "chat/acting-user-not-found" }
Unauthorized — 403
Unauthorized — 403
A user token sent an
actingUserId other than its own user.{ "error": "Unauthorized", "code": "chat/unauthorized" }

