Set Entity NSFW
curl --request PATCH \
--url https://api.sublay.io/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"nsfw": true
}'import requests
url = "https://api.sublay.io/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw"
payload = { "nsfw": True }
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({nsfw: true})
};
fetch('https://api.sublay.io/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw', 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/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw",
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([
'nsfw' => true
]),
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/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw"
payload := strings.NewReader("{\n \"nsfw\": true\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/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"nsfw\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw")
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 \"nsfw\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"nsfw": true
}Space — Moderation
Set Entity NSFW
Set or clear the NSFW flag on an entity within a space
Set Entity NSFW
curl --request PATCH \
--url https://api.sublay.io/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"nsfw": true
}'import requests
url = "https://api.sublay.io/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw"
payload = { "nsfw": True }
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({nsfw: true})
};
fetch('https://api.sublay.io/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw', 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/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw",
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([
'nsfw' => true
]),
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/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw"
payload := strings.NewReader("{\n \"nsfw\": true\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/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"nsfw\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/spaces/:spaceId/entities/:entityId/nsfw")
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 \"nsfw\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"nsfw": true
}Sets the
Requires the
See also: useSetSpaceEntityNsfw
nsfw flag on an entity in a space, including entities authored by other users. Requires the caller to be a moderator or admin of the space.
NSFW is a separate axis from moderation. This endpoint writes the entity’s own
nsfw field and never touches moderationStatus — labelling content does not hide it the way Moderate Entity with "remove" does. Effective NSFW is computed live on read, so a space’s own NSFW setting still applies on top of this flag.entities bundle in addition to spaces.
Path Parameters
Body Parameters
Response
Error Responses
Invalid Body — 400
Invalid Body — 400
{ "error": "Invalid request body.", "code": "moderation/invalid-body" }
Entities Bundle Unavailable — 403
Entities Bundle Unavailable — 403
{
"error": "Entities bundle is not available for this project",
"code": "database/tables-not-available"
}
Entity Not Found — 404
Entity Not Found — 404
{ "error": "Entity not found.", "code": "moderation/entity-not-found" }
Entity Not In Space — 404
Entity Not In Space — 404
The entity exists but belongs to a different space.
{
"error": "Entity does not belong to this space.",
"code": "moderation/entity-not-in-space"
}
Server Error — 500
Server Error — 500
{
"error": "Failed to set entity NSFW flag.",
"code": "moderation/server-error"
}

