A RESTful API for managing a Minecraft server. Supports Minecraft 1.21.1 with the Fabric mod loader. Currently very limited in functionality.
All endpoints require a valid Authorization
header with the format:
Authorization: Bearer <token>
The token must be at least 12 characters long and can be set in ./config/restadmin.json
.
{
"port": 7070,
"host": "0.0.0.0",
"token": "your_token_here"
}
- GET
/players
- Description: Retrieves the list of connected players.
- Response: JSON array of Player objects.
- GET
/whitelist
- Description: Retrieves the list of whitelisted players.
- Response: JSON array of player names.
- GET
/whitelist/{username_or_uuid}
- Description: Checks if a player (by username or UUID) is on the whitelist.
- Response: Player object.
- POST
/whitelist/{username_or_uuid}
- Description: Adds a player (by username or UUID) to the whitelist.
- Response: Player object.
- DELETE
/whitelist/{username_or_uuid}
- Description: Removes a player (by username or UUID) from the whitelist.
- Response: Player object.
type Player = {
name: string;
id: string;
};