Web Dashboard API
Overview
XBans registers a WebModule with the XCore web dashboard, providing REST API endpoints for managing sanctions through the web interface. This allows server administrators to review and manage moderation data from a browser without being in-game.
The web dashboard module is only available when the XCore web panel is enabled in XCore's configuration. See the XCore documentation for web panel setup.
Authentication
All API endpoints require a valid Bearer token in the Authorization header: the dashboard session that /xcore dashboard hands out in game.
Authorization: Bearer <your-token>
Authentication uses constant-time token comparison to prevent timing attacks. Unauthenticated requests receive a 401 Unauthorized response.
A session acts with the in-game permissions of the player it belongs to, checked on every request. Every XBans page and endpoint needs xcore.dashboard.xbans, and each endpoint also needs the permission listed beside it below: for a list, the one its screen asks for in game; for a sanction, the one its command asks for. What concerns one player also needs xcore.dashboard.players. A request without it receives 403 Forbidden naming the permission, and a page or button its reader may not use is left out. A moderator given xcore.dashboard and xcore.dashboard.xbans therefore works from the browser with the XBans permissions they already have. Saving XBans' configuration from the dashboard's editor needs xcore.dashboard.config, xcore.dashboard.config.save and xbans.admin, like /xbans reload; its keys and webhook addresses read <hidden> there. Operators have every one of these permissions.
Banning a player closes their dashboard sessions at once, so a banned member of staff loses the dashboard too. A shadow ban does not, as that would give it away.
API Endpoints
All XBans endpoints are prefixed with /api/xbans. Read endpoints are GET; write endpoints are POST with a JSON body.
Read endpoints
| Method | Endpoint | Description | Permission |
|---|---|---|---|
GET | /api/xbans/stats | Sanction counts (active bans, mutes, warns, reports, jails, totals) | — |
GET | /api/xbans/bans | List all active bans | xbans.sanctions |
GET | /api/xbans/ip-bans | List all active IP bans | xbans.sanctions |
GET | /api/xbans/mutes | List all active mutes | xbans.sanctions |
GET | /api/xbans/ip-mutes | List all active IP mutes | xbans.sanctions |
GET | /api/xbans/warns | List all active warnings | xbans.sanctions |
GET | /api/xbans/reports | List all reports | xbans.sanctions |
GET | /api/xbans/jaillist | List all jailed players | xbans.sanctions |
GET | /api/xbans/jails | List configured jail locations | — |
GET | /api/xbans/watchlist | List watchlisted players | xbans.watchlist |
GET | /api/xbans/appeals | The appeals queue | xbans.command.appeals |
GET | /api/xbans/players | List all known players | xbans.players and xcore.dashboard.players |
GET | /api/xbans/player/:name | Get a player's sanction profile | xbans.profil and xcore.dashboard.players |
GET | /api/xbans/player/:name/history | A player's sanction history | xbans.history and xcore.dashboard.players |
GET | /api/xbans/player/:name/alts | The accounts sharing an address with the player | xbans.command.alts and xcore.dashboard.players |
GET | /api/xbans/player/:name/notes | The staff notes on the player | xbans.note and xcore.dashboard.players |
GET | /api/xbans/audit | Audit log (paginated, searchable, filterable) | xbans.admin |
GET | /api/xbans/classifier | The classifier's training samples, newest first | xbans.admin |
Write endpoints
Issue or lift sanctions through the API. Body parameters typically include player (the name), reason and duration (optional); bans and mutes also take server. A sanction sent this way does what the command does: exemptions, rank immunity and require-reason are checked, it is announced in game and on Discord, and it is recorded under the name of the dashboard session that sent it. A duration the commands would refuse is refused. A player jailed from the dashboard is teleported to the jail, and freezing a player who is not connected is refused.
| Method | Endpoint | Description | Permission |
|---|---|---|---|
POST | /api/xbans/ban / /unban | Issue / lift a ban | xbans.ban / xbans.unban |
POST | /api/xbans/ban-ip / /unban-ip | Issue / lift an IP ban | xbans.banip / xbans.unbanip |
POST | /api/xbans/mute / /unmute | Issue / lift a mute | xbans.mute / xbans.unmute |
POST | /api/xbans/mute-ip / /unmute-ip | Issue / lift an IP mute | xbans.muteip / xbans.unmuteip |
POST | /api/xbans/warn / /unwarn | Issue / lift a warning | xbans.warn / xbans.unwarn |
POST | /api/xbans/kick | Kick an online player | xcore.dashboard.xbans.manage |
POST | /api/xbans/jail / /unjail | Jail / release a player | xbans.jail / xbans.unjail |
POST | /api/xbans/freeze | Toggle freeze on a player | xcore.dashboard.xbans.manage |
POST | /api/xbans/report/resolve / /report/delete | Resolve / delete a report | xbans.unreport |
POST | /api/xbans/watchlist/add / /watchlist/remove | Add / remove a watched player | xbans.watchlist |
POST | /api/xbans/appeals/decide | Accept or refuse an appeal | xbans.command.appeals |
POST | /api/xbans/note/add / /note/delete | Add / delete staff notes | xcore.dashboard.xbans.manage |
All responses are JSON. List endpoints support pagination via ?page=1&limit=50 query parameters, and list the newest entries first.
CORS & Rate Limiting
The API handles CORS automatically through XCore's web panel helpers. OPTIONS preflight requests are handled for cross-origin browser access.
Rate limiting is enforced per IP address:
- 120 requests per 60-second window, shared with the rest of the dashboard
- Exceeding the limit returns
429 Too Many Requests
Cross-Server Sync
When a POST endpoint modifies sanction data (e.g., unbanning a player from the web panel), XBans automatically handles cross-server synchronization. The SanctionCache calls notifySync() internally, so the change is reflected on all connected servers immediately.
Unlike some other modules, XBans' web module does not need to manually publish sync messages. The SanctionCache layer handles this transparently.