Skip to main content
This page covers the moderation and administrative functions on the spaces module: report handling, content moderation actions, and community rules management.

Reports

handleEntityReport

Resolves a report filed against an entity in a space by applying one or more moderation actions.
string
required
The Sublay space ID where the report was filed.
string
required
The Sublay report ID.
string
required
The Sublay entity ID the report targets.
string[]
required
One or more actions to apply: "remove-entity", "ban-user", and/or "dismiss".
string
Optional moderator summary of the resolution.
string
Optional reason, stored for audit purposes.
string
The Sublay user ID of the moderator performing the action.
ReturnsPromise<HandleReportResponse>

handleCommentReport

Resolves a report filed against a comment in a space by applying one or more moderation actions.
string
required
The Sublay space ID where the report was filed.
string
required
The Sublay report ID.
string
required
The Sublay comment ID the report targets.
string[]
required
One or more actions to apply: "remove-comment", "ban-user", and/or "dismiss".
string
Optional moderator summary of the resolution.
string
Optional reason, stored for audit purposes.
string
The Sublay user ID of the moderator performing the action.
ReturnsPromise<HandleReportResponse>
Chat message reports are handled by spaces.handleSpaceChatReport, which is documented with the other space-conversation functions in Chat → Space conversations. 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.
string
required
The Sublay space ID.
string
required
The Sublay entity ID to moderate.
string
required
"approve" — makes the entity visible, or "remove" — hides/removes it from the space.
string
Optional reason for the moderation action, stored for audit purposes.
ReturnsPromise<ModerationResponse>

setSpaceEntityNsfw

Sets the NSFW own-flag on an entity within a space — including other users’ entities. This is a separate axis from moderateSpaceEntity: it labels the entity (nsfw), it does not approve/remove it. Requires the acting user to be an admin or moderator of the space.
string
required
The Sublay space ID containing the entity.
string
required
The Sublay entity ID to flag or unflag.
boolean
required
The NSFW own-flag to set on the entity.
ReturnsPromise<{ message: string; nsfw: boolean }>

moderateSpaceComment

Approves or removes a comment within a space.
string
required
The Sublay space ID.
string
required
The Sublay comment ID to moderate.
string
required
"approve" or "remove".
string
Optional reason for the moderation action.
ReturnsPromise<ModerationResponse>

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.
string
required
The Sublay space ID.
ReturnsPromise<FetchManyRulesResponse>

fetchRule

Fetches a single rule by its ID.
string
required
The Sublay space ID.
string
required
The Sublay rule ID.
ReturnsPromise<Rule>

createRule

Creates a new rule for a space.
string
required
The Sublay space ID.
string
required
Short title for the rule.
string
Extended explanation of the rule.
ReturnsPromise<Rule>

updateRule

Updates an existing rule’s title or description.
string
required
The Sublay space ID.
string
required
The Sublay rule ID to update.
string
New title.
string
New description.
ReturnsPromise<Rule>

deleteRule

Deletes a rule from a space.
string
required
The Sublay space ID.
string
required
The Sublay rule ID to delete.
ReturnsPromise<DeleteRuleResponse>

reorderRules

Sets the display order of all rules for a space by providing an ordered array of rule IDs.
string
required
The Sublay space ID.
string[]
required
Complete ordered array of all rule IDs for the space.
ReturnsPromise<Rule[]> — the full list of rules in their new order.