Skip to main content
Handle Report
Resolves a report filed in a space, whatever was reported: an entity, a comment, or a message in the space’s conversation. Requires the caller to be a moderator or admin of that space. The request names only the report. The server reads what was reported from the report itself and acts on that content; ban-user bans that content’s author. Which actions a report takes depends on what was reported:
Requires the moderation bundle, which holds reports: without it the request returns 403 database/tables-not-available. A chat message report also needs the chat bundle, and remove-entity needs the entities bundle. See Bundles.

Path Parameters

string
required
UUID of the space.
string
required
UUID of the report to resolve. It must be a report filed in this space.

Body Parameters

string[]
required
One or more actions to take, from the ones the report’s type allows (see the table above). Must contain at least one value.
  • "remove-entity", "remove-comment", "remove-message" — marks the reported content as removed via moderation
  • "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, so they can no longer post to them, receive them or read their history (see space conversations). The same rules as Ban Member apply, with the same errors: a moderator cannot ban a moderator or admin, only the space creator can ban an admin, and the last admin of a space cannot be banned. You can’t ban yourself: when you are the author of the reported content, the request is refused (400 report/cannot-ban-self). A refused ban rolls back the whole request, including any removal in the same request, and the report stays pending. An author who is not a member of the space (for example, who left before the report was handled) is banned all the same: the ban is kept as a banned membership, so they can’t join the space or its child spaces. If the author is already banned in the space, the ban is not repeated and the rest of the request still applies; it is still re-applied to their active memberships in child spaces, under the same rules. Requires reason.
  • "dismiss" — dismisses the report without action. Cannot be combined with other actions.
string
required
What the moderator did, up to 1000 characters. Stored as actionTaken on the report. Required for every report type, whatever the action; an empty or whitespace-only summary counts as missing (400 report/missing-fields).
string
Reason for the ban, up to 1000 characters, kept in the space’s ban log. Required when ban-user is included in actions.
string
Required with a service key: the user this request acts as. The request has exactly that user’s permissions, so it is refused unless they are a moderator or admin of the space, and it is recorded as theirs. A user token always acts as its own user and must not send it (400 space/acting-user-not-allowed).

Response

Returns 204 No Content with no body.

Error Responses

Returned when spaceId or reportId isn’t a valid UUID. Checked before sign-in, permissions and the endpoint’s other checks.
No Authorization header was sent. The body is text/plain (Unauthorized), not JSON. An expired or invalid token returns 403 instead — see Authentication.
A service key sent no actingUserId.
actingUserId is not a user id.
A user token sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
actingUserId was sent in the query string. On this endpoint every field, actingUserId included, goes in the request body.
Returned when a service key names an actingUserId that isn’t a user in this project.
The request named the reported content or its author. The server reads both from the report, so entityId, commentId, messageId and userId are refused. param names the field:
No space with this id exists in the project.
The caller (or the user named by actingUserId) is not a moderator or admin of the space.
A bundle the request needs isn’t installed: moderation for any report, chat for a chat message report, entities for remove-entity. While the bundle is still being installed, the response is 503 database/tables-provisioning instead.
remove-entity on a project without the entities bundle:
The body failed validation, such as an unknown action, an empty actions array, a summary or reason over 1000 characters, or a field of the wrong type. error describes the problem.
No report with this id is in this space: the id names nothing, names a report in another space, or names a report a space moderator doesn’t handle (a user report). All answer the same way.
An action doesn’t fit what was reported. The message lists the actions this report takes and the ones that were refused:
Also returned when dismiss is combined with another action (on a chat message report the message ends with a period):
The request has no summary (or only whitespace), on any report type. Nothing is changed: the report stays pending and no removal or ban in the same request is applied. With dismiss:
With any other action:
ban-user was sent without reason:
The reported content no longer exists, or isn’t in this space. The code names the content type:
ban-user was requested, but the reported content has no author to ban (for example, its author deleted their account).
ban-user would ban the moderator handling the report: they are the author of the reported content. Nothing is changed: the report stays pending and no removal in the same request is applied.
The author of the reported content isn’t a user in this project. On a chat message report the message is "User not found.".
ban-user broke one of the Ban Member rules, in this space or in a child space the ban reaches. spaceId names that space.
See also: useHandleSpaceReport · Fetch Moderated Reports