Skip to content

Moderate a live chat

Use this when your chat needs a complete safety loop: users can report content, moderators can review it, decisions change room state, and connected clients reflect those changes.

What you implement: a report control in the chat client and a separate moderator surface on your trusted backend.

sequenceDiagram
    actor U as User
    participant Chat as Chat client
    participant API as TalkLabs API
    participant Mod as Moderator console

    U->>Chat: Report message or user
    Chat->>API: Submit report
    API-->>Chat: Report accepted
    Mod->>API: List moderation queue
    API-->>Mod: Flagged messages and users
    Mod->>API: Approve or reject
    API-->>Mod: Decision applied
    Mod->>API: Optional mute, shadow ban, bounce, or purge
    API-->>Chat: Replace, remove, purge, or user-effect event
    Chat-->>U: Update visible room state
ControlOperation
Report messageReport a message
Report userReport a user in this room
Refresh current effectsList room user effects

Confirm that a report was received. Do not tell the reporter that content was removed until a moderation decision or event update says so.

Moderator taskOperation
Review flagged messagesList messages needing moderation
Approve or reject a messageApply message decision
Review flagged usersList flagged users
Apply a user decisionApply user decision
Temporarily remove a userBounce user
Prevent visible postingShadow ban user
Temporarily stop postingMute user
Remove a user’s room messagesPurge user messages

A useful queue row contains the reported content, the author, report reason, room context, report count, and available decisions. Keep the decision action small:

moderation-route.js — trusted backend
export async function decideMessage(eventId, approve) {
const response = await fetch(
`https://api.sportstalk247.com/api/v3/${APP_ID}` +
`/chat/moderation/queues/events/${eventId}/applydecision`,
{
method: 'POST',
headers: {
'x-api-token': API_TOKEN,
'Content-Type': 'application/json',
},
body: JSON.stringify({ approve }),
},
);
if (!response.ok) throw new Error(`decision failed: ${response.status}`);
return response.json();
}

After a decision succeeds, remove the item from the active queue or refresh that page. Do not infer success from a button click.

Clients should already be processing the room updates stream. Route moderation events through the same reducer:

  • replace updates edited or moderated message content.
  • remove hides or tombstones a message.
  • purge removes the affected user’s messages from local state.
  • mute, bounce, and related events update the affected user’s controls and connection state.

If a client reconnects after missing these events, refresh room history or the affected state instead of assuming its cached view is current.

  • Show the TalkLabs room ID and your custom room ID as separate labeled values.
  • Make approve and reject visually distinct and confirm destructive bulk work.
  • Record the acting moderator in your own audit context where required.
  • Disable a queue action while it is pending.
  • Treat an already-decided item as a refresh condition, not an unknown failure.
  • Keep report reasons and user effects visible without exposing private tokens.