spaces module: report handling, content moderation actions, and community rules management.
Reports
handleSpaceReport
Handles a report filed in a space, whatever was reported: an entity, a comment or a chat message in the space’s conversation (PATCH /spaces/:spaceId/reports/:reportId). The server reads the reported content and its author from the report, so the call names neither. See Handle Report for every rule and error.
The user the request acts as: they must be a moderator or admin of the space, and the action is recorded as theirs.
One or more actions to apply. Which ones a report takes depends on what was reported:
- an entity report:
"remove-entity","ban-user","dismiss" - a comment report:
"remove-comment","ban-user","dismiss" - a chat message report:
"remove-message","ban-user","dismiss"
400 report/invalid-actions, and "dismiss" can’t be combined with other actions. "ban-user" bans the author of the reported content from the space and requires reason; it is refused with 400 report/cannot-ban-self when that author is the acting user.The resolution note stored on the report, up to 1000 characters. Required for every report type; without it (or with only whitespace) the request is refused with
400 report/missing-fields.Reason for the ban, kept in the space’s ban log, up to 1000 characters. Required when
actions includes "ban-user".Promise<void>. It resolves with no value once the actions are applied.
SpaceReportAction is "remove-entity" | "remove-comment" | "remove-message" | "ban-user" | "dismiss".
Reports on DM and group conversations are project-level and are resolved in the Sublay
dashboard, not through this SDK.
Content Moderation
moderateSpaceEntity
Approves or removes an entity within a space. A draft can’t be moderated: it answers404 moderation/entity-not-found, like a missing entity.
The user the request acts as: they must be a moderator or admin of the space, and the action is recorded as theirs.
Promise<{ moderationStatus: "approved" | "removed" | null }>: the status after the request. Content its owner deleted takes no moderation change and answers with its existing status, which can be null.
setSpaceEntityNsfw
Sets the NSFW own-flag on an entity within a space — including other users’ entities. This is a separate axis frommoderateSpaceEntity: it labels the entity (nsfw), it does not approve/remove it. Requires the acting user to be an admin or moderator of the space. A draft can’t be flagged: it answers 404 moderation/entity-not-found, like a missing entity.
The user the request acts as: they must be a moderator or admin of the space, and the action is recorded as theirs.
Promise<{ nsfw: boolean }>
moderateSpaceComment
Approves or removes a comment within a space.The user the request acts as: they must be a moderator or admin of the space, and the action is recorded as theirs.
Promise<{ moderationStatus: "approved" | "removed" | null }>: the status after the request. Content its owner deleted takes no moderation change and answers with its existing status, which can be null.
Rules
Rules are community guidelines displayed to members. They are ordered and each consists of a title and optional description.fetchManyRules
Fetches all rules for a space. The rules of a space the viewer can’t see are answered404 space/not-found.
Read as this user: exactly what their own access token would get. Omit it for the anonymous view.
Promise<FetchManyRulesResponse>
fetchRule
Fetches a single rule by its ID. A rule of a space the viewer can’t see is answered404 space/not-found.
Read as this user: exactly what their own access token would get. Omit it for the anonymous view.
Promise<Rule>
createRule
Creates a new rule for a space.The user the request acts as: they must be an admin of the space, and the action is recorded as theirs.
Promise<Rule>
updateRule
Updates an existing rule’s title or description.The user the request acts as: they must be an admin of the space, and the action is recorded as theirs.
Promise<Rule>
deleteRule
Deletes a rule from a space.The user the request acts as: they must be an admin of the space, and the action is recorded as theirs.
Promise<void>. It resolves with no value once the rule is deleted.
reorderRules
Sets the display order of all rules for a space by providing an ordered array of rule IDs.The user the request acts as: they must be an admin of the space, and the action is recorded as theirs.
Promise<Rule[]> — the full list of rules in their new order.
