Server config
Base: /api/serverconfig
Here you read and change the config.json of the Hytale server itself, not the settings of the mod. It holds, for example, server name, MOTD, password, player limit and view distance as well as the modules of the server. Typical uses are a panel that changes the server name or the player limit, or a script that backs up the configuration. Keep in mind that in most cases changes only take effect after the server has been restarted.
/api/serverconfig
Get server config
Returns the entire content of config.json as a JSON object, including nested sections.
Response Example
{
"MaxPlayers": 20,
"ServerName": "My Server",
"SkipModValidationForVersion": "abc123"
}
cURL
curl -X GET 'http://localhost:5550/api/serverconfig' \
-H 'X-Admin-Token: YOUR_TOKEN'
Internal Behavior
/api/serverconfig
Change server config
Changes one or more keys of config.json. You send a JSON object whose keys are the top-level keys of the file. Texts, numbers and booleans are taken over directly, objects and lists replace the previous value of the key. The response contains success: true and updated_keys. Most changes need a restart.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
<key>
|
any | No | Any config.json keys with new values |
Response Example
{
"success": true,
"updated_keys": [
"MaxPlayers",
"ServerName"
]
}
cURL
curl -X POST 'http://localhost:5550/api/serverconfig' \
-H 'X-Admin-Token: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"MaxPlayers": 50, "MOTD": "Welcome"}'
Internal Behavior
/api/serverconfig/reload
Reload server config
Reads config.json from disk into the memory of the mod again and answers with success: true and action: reload. Use it when you edited the file by hand and want the query to show the new content. The running Hytale server is not reconfigured by it.
Response Example
{
"success": true,
"action": "reload"
}
cURL
curl -X POST 'http://localhost:5550/api/serverconfig/reload' \
-H 'X-Admin-Token: YOUR_TOKEN'