Skip to main content
The space moderation functions let admins and moderators resolve reports, moderate entities, comments, and chat messages, and manage community rules within a space.

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.
string
required
The Sublay space ID where the report was filed.
string
required
The Sublay report ID.
SpaceReportAction[]
required
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"
An action the report’s type doesn’t take is refused with 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 logged-in user.
string
required
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.
string
Reason for the ban, kept in the space’s ban log, up to 1000 characters. Required when actions includes "ban-user".
Returns — Promise<void>. It resolves with no value once the actions are applied. SpaceReportAction is "remove-entity" | "remove-comment" | "remove-message" | "ban-user" | "dismiss".

moderateSpaceEntity

Approves or removes an entity in a space. A draft can’t be moderated: it answers 404 moderation/entity-not-found, like a missing entity.
string
required
The Sublay space ID.
string
required
The ID of the entity to moderate.
string
required
The action to take: "approve" or "remove".
string
The reason for the moderation action.
Returns — 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. Separate 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. A draft can’t be flagged: it answers 404 moderation/entity-not-found, like a missing entity.
string
required
The Sublay space ID containing the entity.
string
required
The ID of the entity to flag or unflag.
boolean
required
The NSFW own-flag to set on the entity.
Returns — Promise<{ nsfw: boolean }>

moderateSpaceComment

Approves or removes a comment in a space.
string
required
The Sublay space ID.
string
required
The ID of the comment to moderate.
string
required
The action to take: "approve" or "remove".
string
The reason for the moderation action.
Returns — 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.

moderateSpaceChatMessage

Removes a chat message in a space conversation.
string
required
The Sublay space ID.
string
required
The ID of the chat message to moderate.
"remove"
required
The moderation action. Chat messages are never held for approval, so "remove" is the only value.
string
The reason for the removal. Trimmed; up to 1,000 characters.
Returns — Promise<{ moderationStatus: "removed" | null }>: null for a message its author deleted (and nobody removed), which is left as it was.

fetchManyRules

Fetches all rules for a space. The rules of a space the logged-in user can’t see are answered 404 space/not-found.
string
required
The Sublay space ID.
Returns — Promise<FetchManyRulesResponse>

fetchRule

Fetches a single rule by ID. A rule of a space the logged-in user can’t see is answered 404 space/not-found.
string
required
The Sublay space ID.
string
required
The ID of the rule to fetch.
Returns — Promise<Rule>

createRule

Creates a rule in a space.
string
required
The Sublay space ID.
string
required
The rule title.
string | null
The rule description.
Returns — Promise<Rule>

updateRule

Updates a rule’s title and/or description.
string
required
The Sublay space ID.
string
required
The ID of the rule to update.
string
The new rule title.
string | null
The new rule description. null clears it.
Returns — Promise<Rule>

deleteRule

Deletes a rule.
string
required
The Sublay space ID.
string
required
The ID of the rule to delete.
Returns — Promise<void>. It resolves with no value once the rule is deleted.

reorderRules

Reorders a space’s rules.
string
required
The Sublay space ID.
string[]
required
The rule IDs in the new order.
Returns — Promise<Rule[]>