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.
Safety workflow
Section titled “Safety workflow”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
Map the two surfaces
Section titled “Map the two surfaces”User-facing chat
Section titled “User-facing chat”| Control | Operation |
|---|---|
| Report message | Report a message |
| Report user | Report a user in this room |
| Refresh current effects | List 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 console
Section titled “Moderator console”| Moderator task | Operation |
|---|---|
| Review flagged messages | List messages needing moderation |
| Approve or reject a message | Apply message decision |
| Review flagged users | List flagged users |
| Apply a user decision | Apply user decision |
| Temporarily remove a user | Bounce user |
| Prevent visible posting | Shadow ban user |
| Temporarily stop posting | Mute user |
| Remove a user’s room messages | Purge user messages |
Build the queue around decisions
Section titled “Build the queue around decisions”A useful queue row contains the reported content, the author, report reason, room context, report count, and available decisions. Keep the decision action small:
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.
Reflect decisions in the room
Section titled “Reflect decisions in the room”Clients should already be processing the room updates stream. Route moderation events through the same reducer:
replaceupdates edited or moderated message content.removehides or tombstones a message.purgeremoves 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.
Moderator UX checklist
Section titled “Moderator UX checklist”- 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.