Bans
Base: /api/bans
The ban section manages banned players. You read the ban list, ban players and lift bans again, even when the player is offline. Typical uses are a moderation panel, a Discord command for your team or an automatic ban from a script. Banned players can no longer connect, and a player who is online when the ban is issued is disconnected at once. A ban issued through the API has no expiry date.
Handler: BansHandler
GET
/api/bans
List bans
Returns all bans as a list. Every entry comes from the bans.json of the server and contains the fields as Hytale writes them, for example Target (UUID of the banned player), By, Timestamp and Reason.
Response Example
[
{
"player": "Steve",
"reason": "griefing",
"bannedAt": "2026-01-01T00:00:00Z"
}
]
cURL
curl -X GET 'http://localhost:5550/api/bans' \
-H 'X-Admin-Token: YOUR_TOKEN'
Bans are issued by UUID, so the list shows UUIDs and not player names. If you need names, match the UUIDs against the list of known players (GET /api/players/known). Methods other than GET, POST and DELETE give 405.
Internal Behavior
Reads the ban list of the server (bans.json).
POST
/api/bans
Ban player
Bans a player, online or offline. Unknown names are resolved through the Hytale profile service.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
player
|
string | Yes | Player name or UUID |
reason
|
string | No | Ban reason |
Response Example
{
"success": true,
"player": "Steve",
"reason": "griefing",
"kicked": true
}
cURL
curl -X POST 'http://localhost:5550/api/bans' \
-H 'X-Admin-Token: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"player": "Griefer123", "reason": "Griefing"}'
player is required and may be a name or a UUID, otherwise you get 400 with {"error": "Missing required field: player"}. For a name, the mod only finds the UUID for players who are online right now. For other names it runs the ban command of the server, which only works for names of 3 to 16 characters made of letters, digits and underscore. If both fail, it answers 200 with success: false and the error "Could not ban player". The reason is cleaned of control characters and cut to 120 characters. On success, kicked: true shows that the player was online and has been disconnected.
Internal Behavior
Uses Hytale's access control module, falls back to the native ban command; online players are kicked.
DELETE
/api/bans/{player}
Unban player
Removes a ban.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
player
|
string | Yes | Player name or UUID (URL encoded) |
Response Example
{
"success": true,
"player": "Steve"
}
cURL
curl -X DELETE 'http://localhost:5550/api/bans/Griefer123' \
-H 'X-Admin-Token: YOUR_TOKEN'
Name or UUID belong URL-encoded in the address. If the name is missing, you get 400 with "Player name required". If the player is not banned or Hytale does not confirm the removal, the endpoint answers 200 with success: false. So check success in the body.
Internal Behavior
Uses the access control module or the native unban command; success only if Hytale confirms.