Text Moderation API

Moderation

POST
/api/censor.php
Screen text through the authoritative server-side filter — returns clean flag + masked display text, max 1000 chars (requires API TOKEN)
POST /api/censor.php

Body {"text": "..."} — up to 1000 UTF-8 characters. clean is false when a listed word is found; filtered is the masked, display-safe copy (rich-text and control characters stripped). No player session needed — API token only.

Request:
$ curl -X POST "/api/censor.php" \
  -H "X-Api-Token: API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text": "message a player wants to display"}'
Response (clean text):
{"success": true, "clean": true, "filtered": "message a player wants to display"}
Response (flagged text — filtered is the masked, display-safe version):
{"success": true, "clean": false, "filtered": "********"}
Note: rate limited per game + client IP (120 requests per 60s) — a 429 reply includes a retry_after field in seconds.
Local filtering and name rules

Each official SDK ships a local hash-scan TextFilter for instant offline checks — it never weakens server decisions, so a missed local flag still fails server-side. Per-game character policies for player names (name_rules) and lobby titles (room_rules) live in the cabinet game settings and are enforced at register/rename and room creation; the same rules feed the SDK-side validate_name helpers for live local feedback.