Eranio
Color theme

Backups

Base: /api/backup

The backup section controls the built-in backups of the Hytale server. You list existing backup files, read the backup settings of the server, check the status, start a new backup and delete old files. With it you build, for example, a "Back up now" button for your panel, a warning when the last backup is too old, or a job that backs up before an update. The backup uses the function of the game itself, so chunks are saved before packing.

Handler: BackupHandler
GET /api/backup

List backups

Returns backups (filename, size in bytes, created and modified as millisecond timestamps, newest first) as well as backup_dir, configured, total, max_count and archive_max_count. Only files ending in .zip in the backup folder count.

Response Example

{
  "backups": [
    {
      "filename": "backup_2026-01-01_01-00-00.zip",
      "size": 10485760,
      "created": 1737000000000,
      "modified": 1737000000000
    }
  ],
  "backup_dir": "/srv/backup",
  "configured": true,
  "total": 1,
  "max_count": 5,
  "archive_max_count": 5
}

cURL

curl -X GET 'http://localhost:5550/api/backup' \
  -H 'X-Admin-Token: YOUR_TOKEN'
If the backup folder does not exist yet, you get 200 with an empty list and configured: false. The folder comes from the backup configuration of the server, and if none is given there, the folder backup next to the server applies. max_count and archive_max_count are the retention limits of the server. If they cannot be read, 5 is shown for each.

Internal Behavior

Lists the .zip files in the backup folder of the server config (fallback ./backup).
GET /api/backup/config

Backup settings

Returns the backup configuration of the server: enabled, configured, frequency_minutes (interval of the automatic backups in minutes), directory, max_count and archive_max_count.

Response Example

{
  "enabled": true,
  "configured": true,
  "frequency_minutes": 60,
  "directory": "/srv/backup",
  "max_count": 5,
  "archive_max_count": 5
}

cURL

curl -X GET 'http://localhost:5550/api/backup/config' \
  -H 'X-Admin-Token: YOUR_TOKEN'
If the configuration cannot be read, the endpoint answers 200 with a field error instead of an error code. Read error before you use the other fields. The values can only be read here.

Internal Behavior

Reads the native BackupConfig.
GET /api/backup/status

Backup status

Returns is_backing_up, last_backup_timestamp (milliseconds, 0 if no backup has run yet) and last_backup_error (null if there is no error).

Response Example

{
  "is_backing_up": false,
  "last_backup_timestamp": 1737000000000,
  "last_backup_error": null
}

cURL

curl -X GET 'http://localhost:5550/api/backup/status' \
  -H 'X-Admin-Token: YOUR_TOKEN'
The status only applies to backups that were started through this API. Automatic backups of the server do not show up here. The state is held in memory and is lost on a restart. Use the endpoint when the create call has answered with async: true after 120 seconds, to wait for completion.

Internal Behavior

Reads the state kept by the handler.
POST /api/backup/create

Create backup

Starts a backup of the universe with the own backup function of Hytale and, as soon as it is finished, answers with success: true, filename of the newest ZIP file and timestamp.

Response Example

{
  "success": true,
  "filename": "backup_2026-01-01_01-00-00.zip",
  "timestamp": 1737000000000
}

cURL

curl -X POST 'http://localhost:5550/api/backup/create' \
  -H 'X-Admin-Token: YOUR_TOKEN'
If a backup is already running, you get 200 with success: false and the error "Backup already in progress". If the backup takes longer than 120 seconds, you get success: true with async: true and a note that it keeps running, and you check completion through the status. Errors such as a folder that cannot be created or a universe that is not available also come with status 200 and success: false. So always check success in the body and not only the HTTP status. The call blocks until the backup is finished, so set the timeout of your client to more than 120 seconds. Old backups are rotated by the server itself according to max_count and archive_max_count.

Internal Behavior

Calls Universe.runBackup (saves chunks, zips the universe, rotates old backups); waits up to 120 seconds.
DELETE /api/backup

Delete backup

Deletes a backup file from the backup folder. You send the file name in the JSON body of the DELETE call (filename), not in the address. The response contains success and, on success, deleted.

Request Body

Field Type Required Description
filename string Yes Zip file name, no path

Response Example

{
  "success": true,
  "deleted": "backup_2026-01-01_01-00-00.zip"
}

cURL

curl -X DELETE 'http://localhost:5550/api/backup' \
  -H 'X-Admin-Token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"filename": "2026-10-13_12-00-00.zip"}'
The file name must not contain a path. Names with .. or / or \ are rejected with success: false and the error "Invalid filename". If filename is missing, the message is "Missing filename", and if the file does not exist, "Backup file not found". All three cases answer with status 200. Deleting is final, there is no recycle bin.

Internal Behavior

Rejects names with .., / or \; deletes the file in the backup folder.