Skip to content
Web Dashboard API

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

MethodEndpointDescriptionPermission
GET/api/xbans/statsSanction counts (active bans, mutes, warns, reports, jails, totals)—
GET/api/xbans/bansList all active bansxbans.sanctions
GET/api/xbans/ip-bansList all active IP bansxbans.sanctions
GET/api/xbans/mutesList all active mutesxbans.sanctions
GET/api/xbans/ip-mutesList all active IP mutesxbans.sanctions
GET/api/xbans/warnsList all active warningsxbans.sanctions
GET/api/xbans/reportsList all reportsxbans.sanctions
GET/api/xbans/jaillistList all jailed playersxbans.sanctions
GET/api/xbans/jailsList configured jail locations—
GET/api/xbans/watchlistList watchlisted playersxbans.watchlist
GET/api/xbans/appealsThe appeals queuexbans.command.appeals
GET/api/xbans/playersList all known playersxbans.players and xcore.dashboard.players
GET/api/xbans/player/:nameGet a player's sanction profilexbans.profil and xcore.dashboard.players
GET/api/xbans/player/:name/historyA player's sanction historyxbans.history and xcore.dashboard.players
GET/api/xbans/player/:name/altsThe accounts sharing an address with the playerxbans.command.alts and xcore.dashboard.players
GET/api/xbans/player/:name/notesThe staff notes on the playerxbans.note and xcore.dashboard.players
GET/api/xbans/auditAudit log (paginated, searchable, filterable)xbans.admin
GET/api/xbans/classifierThe classifier's training samples, newest firstxbans.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.

MethodEndpointDescriptionPermission
POST/api/xbans/ban / /unbanIssue / lift a banxbans.ban / xbans.unban
POST/api/xbans/ban-ip / /unban-ipIssue / lift an IP banxbans.banip / xbans.unbanip
POST/api/xbans/mute / /unmuteIssue / lift a mutexbans.mute / xbans.unmute
POST/api/xbans/mute-ip / /unmute-ipIssue / lift an IP mutexbans.muteip / xbans.unmuteip
POST/api/xbans/warn / /unwarnIssue / lift a warningxbans.warn / xbans.unwarn
POST/api/xbans/kickKick an online playerxcore.dashboard.xbans.manage
POST/api/xbans/jail / /unjailJail / release a playerxbans.jail / xbans.unjail
POST/api/xbans/freezeToggle freeze on a playerxcore.dashboard.xbans.manage
POST/api/xbans/report/resolve / /report/deleteResolve / delete a reportxbans.unreport
POST/api/xbans/watchlist/add / /watchlist/removeAdd / remove a watched playerxbans.watchlist
POST/api/xbans/appeals/decideAccept or refuse an appealxbans.command.appeals
POST/api/xbans/note/add / /note/deleteAdd / delete staff notesxcore.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.