Skip to main content

Overview

Returns a function that allows a space moderator to take action on a chat message report. Available actions are: remove the message, ban the message’s author from the space, or dismiss the report.
Requires the authenticated user to have admin or moderator role in the target space.
ban-user here is space-scoped — it bans the message’s 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.

Usage Example

Parameters

string
required
The ID of the space the report belongs to.
string
required
The ID of the report to action.
string
Optional. The message acted on is the report’s own; if sent, messageId must be that message.
Array<'remove-message' | 'ban-user' | 'dismiss'>
required
One or more actions to take:
  • remove-message — Removes the message.
  • ban-user — Bans the message’s author from the space and the child spaces where they are an active member, and ends their membership of those spaces’ chats (requires reason).
  • dismiss — Marks the report as dismissed.
string
A moderator note describing the action taken.
string
The reason for banning, if applicable.
string
The moderator a service or master key acts for. The request then has exactly that moderator’s permissions.

Returns

Returns Promise<{ message: string; code: string }>.

Notes