Permissions
Base: /api/permissions
The permissions endpoints read and change the permissions.json of the server: users with their groups, groups with their permissions and the operator rights. With them you build a role panel, grant rights after a purchase or a Discord role, or create a group for an event. Users are addressed by their UUID, not by name. Every change is also noted in the event log, which you can fetch through the chat section.
Handler: PermissionsHandler
Endpoints
GET
/api/permissions
Get permissions
Returns users (UUID and the groups of the user) and groups (group name and the permissions of the group).
Response Example
{
"users": [
{
"uuid": "1234...",
"groups": [
"OP"
]
}
],
"groups": {
"OP": [
"*"
]
}
}
cURL
curl -X GET 'http://localhost:5550/api/permissions' \
-H 'X-Admin-Token: YOUR_TOKEN'
users assigns each UUID its groups, groups assigns each group name its permissions as a list. Operator rights are not a list of their own but membership in the group hytale:Admin (the groups OP and Admin count as well).
Internal Behavior
Reads permissions.json.
GET
/api/permissions/groups
List groups
Returns only the groups.
Response Example
{
"OP": [
"*"
],
"Builder": [
"build.*"
]
}
cURL
curl -X GET 'http://localhost:5550/api/permissions/groups' \
-H 'X-Admin-Token: YOUR_TOKEN'
Internal Behavior
Reads the groups of permissions.json.
POST
/api/permissions/op
Grant OP by UUID
Gives a player operator rights by UUID.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
uuid
|
string | Yes | Player UUID |
Response Example
{
"success": true,
"uuid": "1234...",
"action": "op"
}
cURL
curl -X POST 'http://localhost:5550/api/permissions/op' \
-H 'X-Admin-Token: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"uuid": "3f1c2b7e-8d4a-4c1e-9b2f-6a5d0e7c9b11"}'
The field uuid is required, otherwise you get 400 with "Missing required field: uuid". The player ends up in the group hytale:Admin, which corresponds to operator rights. The change is then noted in the event log playerPermissionChange.
Internal Behavior
Writes permissions.json and logs a permission event.
DELETE
/api/permissions/op/{uuid}
Revoke OP by UUID
Removes operator rights.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
uuid
|
string | Yes | Player UUID |
Response Example
{
"success": true,
"uuid": "1234...",
"action": "deop"
}
cURL
curl -X DELETE 'http://localhost:5550/api/permissions/op/3f1c2b7e-8d4a-4c1e-9b2f-6a5d0e7c9b11' \
-H 'X-Admin-Token: YOUR_TOKEN'
Removes the player from the groups OP, hytale:Admin and Admin if they belong to them. Other groups remain unchanged.
Internal Behavior
Writes permissions.json and logs a permission event.
POST
/api/permissions/user/group
Add user to group
Puts a player into a group.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
uuid
|
string | Yes | Player UUID |
group
|
string | Yes | Group name |
Response Example
{
"success": true,
"uuid": "1234...",
"group": "Builder"
}
cURL
curl -X POST 'http://localhost:5550/api/permissions/user/group' \
-H 'X-Admin-Token: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"uuid": "3f1c2b7e-8d4a-4c1e-9b2f-6a5d0e7c9b11", "group": "Moderator"}'
Internal Behavior
Writes permissions.json.
DELETE
/api/permissions/user/group
Remove user from group
Takes a player out of a group.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
uuid
|
string | Yes | Player UUID |
group
|
string | Yes | Group name |
Response Example
{
"success": true,
"uuid": "1234...",
"group": "Builder"
}
cURL
curl -X DELETE 'http://localhost:5550/api/permissions/user/group' \
-H 'X-Admin-Token: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"uuid": "3f1c2b7e-8d4a-4c1e-9b2f-6a5d0e7c9b11", "group": "Moderator"}'
Internal Behavior
Writes permissions.json.
POST
/api/permissions/groups
Create group
Creates a permission group.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name
|
string | Yes | Group name |
permissions
|
array | No | Permission nodes |
Response Example
{
"success": true,
"group": "Builder"
}
cURL
curl -X POST 'http://localhost:5550/api/permissions/groups' \
-H 'X-Admin-Token: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"name": "Moderator", "permissions": ["hytale.command.kick"]}'
name is required, permissions is a list of permissions as text. If the group already exists, it is replaced and receives exactly the permissions you sent. The event is then noted in the log groupPermissionChange.
Internal Behavior
Writes permissions.json.
DELETE
/api/permissions/groups/{name}
Delete group
Deletes a permission group.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name
|
string | Yes | Group name |
Response Example
{
"success": true,
"group": "Builder"
}
cURL
curl -X DELETE 'http://localhost:5550/api/permissions/groups/Moderator' \
-H 'X-Admin-Token: YOUR_TOKEN'
When deleting, the group is also removed from all users. Users who are in no group afterwards disappear from users. The endpoint reports success: true even if the group did not exist.
Internal Behavior
Writes permissions.json.