Skip to main content

Endpoint

Authentication

Requires Bearer token authentication via the Authorization header.

Path Parameters

string
required
The UUID of the server

Request Body

string
required
The root directory for compression operations (all paths are relative to this)
string[]
required
Array of file/directory paths to include in the archive (relative to root)

Response

Returns a JSON object with the created archive information.
object
Information about the created archive file

Example Request

Example Response

Behavior

  • Creates a gzip-compressed tar archive (.tar.gz)
  • Archive is created in the specified root directory
  • Filename format: archive-YYYY-MM-DD-HHMMSS.tar.gz
  • Both files and directories can be compressed
  • Directories are archived recursively
  • Preserves file permissions and timestamps
  • Symlinks are followed and their targets are archived
  • Path traversal is prevented
The compression operation runs asynchronously. The response is returned immediately with the expected archive information, but the actual compression may take some time for large datasets.

Error Responses

Missing or invalid Bearer token
Server does not exist or source files not found
Failed to create archive (disk full, permission error, etc.)

Use Cases

  • Create backups of world files
  • Archive old logs
  • Package plugins for transfer
  • Create downloadable server snapshots
  • Prepare files for export

Source Reference

Implementation: router/router_server_files.go (postServerCompressFiles function)