Create Report
curl --request POST \
--url https://api.sublay.io/v8/:projectId/reports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"targetId": "<string>",
"targetType": "<string>",
"reason": "<string>",
"details": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/reports"
payload = {
"targetId": "<string>",
"targetType": "<string>",
"reason": "<string>",
"details": "<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({
targetId: '<string>',
targetType: '<string>',
reason: '<string>',
details: '<string>'
})
};
fetch('https://api.sublay.io/v8/:projectId/reports', 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/reports",
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([
'targetId' => '<string>',
'targetType' => '<string>',
'reason' => '<string>',
'details' => '<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/reports"
payload := strings.NewReader("{\n \"targetId\": \"<string>\",\n \"targetType\": \"<string>\",\n \"reason\": \"<string>\",\n \"details\": \"<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/reports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"targetId\": \"<string>\",\n \"targetType\": \"<string>\",\n \"reason\": \"<string>\",\n \"details\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/reports")
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 \"targetId\": \"<string>\",\n \"targetType\": \"<string>\",\n \"reason\": \"<string>\",\n \"details\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyReport Endpoints
Create Report
Submit a content report for an entity, comment, or chat message
Create Report
curl --request POST \
--url https://api.sublay.io/v8/:projectId/reports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"targetId": "<string>",
"targetType": "<string>",
"reason": "<string>",
"details": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/reports"
payload = {
"targetId": "<string>",
"targetType": "<string>",
"reason": "<string>",
"details": "<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({
targetId: '<string>',
targetType: '<string>',
reason: '<string>',
details: '<string>'
})
};
fetch('https://api.sublay.io/v8/:projectId/reports', 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/reports",
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([
'targetId' => '<string>',
'targetType' => '<string>',
'reason' => '<string>',
'details' => '<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/reports"
payload := strings.NewReader("{\n \"targetId\": \"<string>\",\n \"targetType\": \"<string>\",\n \"reason\": \"<string>\",\n \"details\": \"<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/reports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"targetId\": \"<string>\",\n \"targetType\": \"<string>\",\n \"reason\": \"<string>\",\n \"details\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/reports")
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 \"targetId\": \"<string>\",\n \"targetType\": \"<string>\",\n \"reason\": \"<string>\",\n \"details\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySubmits a report on an entity, comment, or chat message. If an open report already exists for the target, the authenticated user’s report is added to it (increments
Returns
Returns
The error message reflects the reported type, e.g.
A user cannot report content they authored.
Only members of a conversation may report a message in it. Applies to
Returned for a malformed
reporterCount). If the same user already reported that open report, a 200 is returned without creating a duplicate.
Resolved reports (dismissed / actioned) are closed: a later report of the same target creates a new report rather than reopening the old one. A target therefore has at most one open report at a time, alongside any number of resolved ones.
Authentication required. Rate limit: 25 requests per 5 minutes.
Body Parameters
string
required
The UUID of the entity, comment, or chat message being reported. For a
message this is the message id — the conversation is resolved server-side,
so no
conversationId is needed.string
required
The type of content being reported. One of:
entity, comment, message.string
required
The reason for the report. Must be one of:
spam, inappropriateContent,
harassment, misinformation, hateSpeech, violence, illegalActivity,
selfHarm, other. Any other value is rejected with report/invalid-body —
use other plus details for anything the taxonomy doesn’t cover.string
Optional additional context or description provided by the reporter.
Response
Returns201 Created when a new report is created:
{ "message": "Report submitted successfully", "code": "report/created" }
200 OK when an existing report is updated with a new reporter:
{ "message": "Report updated successfully", "code": "report/updated" }
200 OK when the user has already reported this target:
{ "message": "Report already registered by this user", "code": "report/already-reported" }
Error Responses
Target Not Found — 404
Target Not Found — 404
{ "error": "<targetType> not found", "code": "report/target-not-found" }
"entity not found" or "comment not found".Self Report — 400
Self Report — 400
{ "error": "You cannot report your own <targetType>.", "code": "report/self-report" }
Not a Conversation Member — 403
Not a Conversation Member — 403
{ "error": "You are not a member of this conversation.", "code": "chat/not-a-member" }
targetType: "message" only.Invalid Body — 400
Invalid Body — 400
{ "error": "...", "code": "report/invalid-body" }
targetId, an unknown targetType, or a reason
outside the accepted set.
