Overview
useHandleSpaceReport returns a function that lets a space moderator act on a report filed in their space, whatever was reported: an entity, a comment, or a message in the space’s conversation.
You name only the report. The server reads what was reported from the report itself and acts on that content, and ban-user bans that content’s author. Which actions a report takes depends on what was reported:
An action that doesn’t fit the report is refused (
400 report/invalid-actions). Several actions can be combined in one call (for example, remove the content and ban its author); dismiss can’t be combined with any other.
Requires the signed-in user to have the
admin or moderator role in the space. Reports need the moderation bundle; a chat message report also needs the chat bundle.ban-user here is space-scoped: it bans the author from the space and the child spaces where they are an active member, and ends their membership of those spaces’ chats. Project-wide suspension is a separate, dashboard-only action; a space moderator cannot suspend a user across the whole project. You can’t ban yourself: when you are the author of the reported content, the call is refused (400 report/cannot-ban-self) and nothing changes.Usage Example
Parameters
string
required
The ID of the space the report belongs to.
string
required
The ID of the report to act on.
SpaceReportAction[]
required
One or more actions, from the ones the report’s type allows (see the table above).
SpaceReportAction is "remove-entity" | "remove-comment" | "remove-message" | "ban-user" | "dismiss".remove-entity,remove-comment,remove-message— removes the reported content.ban-user— bans the author of the reported content from the space and the child spaces where they are an active member, and ends their membership of those spaces’ chats (requiresreason). The same rules asuseBanMemberapply.dismiss— marks the report as dismissed without acting on the content.
string
required
A moderator note describing what was done, up to 1000 characters. Stored on the report. Required for every report type; without it (or with only whitespace) the request is refused with
400 report/missing-fields.string
Why the author is banned, up to 1000 characters; kept in the space’s ban log. Required with
ban-user.Returns
ReturnsPromise<void>. It resolves with no value once the actions are applied.
Notes
- Reports are created with
useCreateReport. To fetch the reports waiting in a space, useuseFetchModeratedReports. - To moderate content directly, without a report, see
useModerateSpaceEntityanduseModerateSpaceComment. - Every error the call can return is listed on Handle Report.

