Permissions
Base: /api/permissions
Users, groups and OP in permissions.json
Handler: PermissionsHandler
Endpoints
GET
/api/permissions
Get permissions
Returns all users with their groups and all groups with their permission nodes.
Response Example
{
"users": [
{
"uuid": "1234...",
"groups": [
"OP"
]
}
],
"groups": {
"OP": [
"*"
]
}
}
cURL
curl -X GET 'http://localhost:5550/api/permissions' \
-H 'X-Admin-Token: YOUR_TOKEN'
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"}'
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'
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"]}'
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'
Internal Behavior
Writes permissions.json.