Handle Entity Report
curl --request PATCH \
--url https://api.sublay.io/v8/:projectId/spaces/:spaceId/reports/entity/:reportId \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityId": "<string>",
"actions": [
"<string>"
],
"summary": "<string>",
"reason": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/spaces/:spaceId/reports/entity/:reportId"
payload = {
"entityId": "<string>",
"actions": ["<string>"],
"summary": "<string>",
"reason": "<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({
entityId: '<string>',
actions: ['<string>'],
summary: '<string>',
reason: '<string>'
})
};
fetch('https://api.sublay.io/v8/:projectId/spaces/:spaceId/reports/entity/: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/reports/entity/: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([
'entityId' => '<string>',
'actions' => [
'<string>'
],
'summary' => '<string>',
'reason' => '<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/reports/entity/:reportId"
payload := strings.NewReader("{\n \"entityId\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"summary\": \"<string>\",\n \"reason\": \"<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/reports/entity/:reportId")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entityId\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"summary\": \"<string>\",\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/spaces/:spaceId/reports/entity/: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 \"entityId\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"summary\": \"<string>\",\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySpace — Moderation
Handle Entity Report
Resolve an entity report within a space
Handle Entity Report
curl --request PATCH \
--url https://api.sublay.io/v8/:projectId/spaces/:spaceId/reports/entity/:reportId \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityId": "<string>",
"actions": [
"<string>"
],
"summary": "<string>",
"reason": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/spaces/:spaceId/reports/entity/:reportId"
payload = {
"entityId": "<string>",
"actions": ["<string>"],
"summary": "<string>",
"reason": "<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({
entityId: '<string>',
actions: ['<string>'],
summary: '<string>',
reason: '<string>'
})
};
fetch('https://api.sublay.io/v8/:projectId/spaces/:spaceId/reports/entity/: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/reports/entity/: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([
'entityId' => '<string>',
'actions' => [
'<string>'
],
'summary' => '<string>',
'reason' => '<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/reports/entity/:reportId"
payload := strings.NewReader("{\n \"entityId\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"summary\": \"<string>\",\n \"reason\": \"<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/reports/entity/:reportId")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entityId\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"summary\": \"<string>\",\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/spaces/:spaceId/reports/entity/: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 \"entityId\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"summary\": \"<string>\",\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyResolves a filed report against an entity in a space. Requires the caller to be a moderator or admin of that space.
Also returned when
Path Parameters
string
required
UUID of the space.
string
required
UUID of the entity report to resolve.
Body Parameters
string
required
UUID of the reported entity. Used when performing
remove-entity.string[]
required
One or more actions to take. Must contain at least one value. Available actions:
"remove-entity"— marks the entity 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 (requiressummary; cannot be combined with other actions)
string
Summary of the action taken. Required when using
dismiss or any non-dismiss action.string
Reason for the ban, kept in the space’s ban log. Required when
ban-user is included in actions.Response
Returns201 Created:
{ "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" }
Entity Not Found — 404
Entity Not Found — 404
{ "error": "Entity not found", "code": "report/entity-not-found" }
Entity Not in Space — 404
Entity Not in Space — 404
{ "error": "Entity does not belong to this space", "code": "report/entity-not-in-space" }
User Not Found — 404
User Not Found — 404
{ "error": "User not found in this project", "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 Required Fields — 400
Missing Required Fields — 400
{ "error": "Summary is required for dismissing a report", "code": "report/missing-fields" }
ban-user is used without reason:{ "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
entityId 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 entity", "code": "report/target-type-mismatch" }

