Skip to main content

Endpoint

POST /api/servers/:server/files/decompress

Authentication

Requires Bearer token authentication via the Authorization header.

Path Parameters

server
string
required
The UUID of the server

Request Body

root
string
required
The directory where the archive is located (files will be extracted relative to this)
file
string
required
The archive file to decompress (relative to root)

Response

Returns 204 No Content on success.

Example Request

curl -X POST "https://wings.example.com/api/servers/d3aac109-f0fc-4674-b5bc-199bb50e6b88/files/decompress" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "root": "/",
    "file": "backup.tar.gz"
  }'

Supported Archive Formats

Wings supports automatic format detection and extraction of:
  • .tar.gz, .tgz - Gzip-compressed tar archives
  • .tar - Uncompressed tar archives
  • .zip - ZIP archives
  • .rar - RAR archives
  • .7z - 7-Zip archives
  • .tar.bz2, .tbz2 - Bzip2-compressed tar archives
  • .tar.xz, .txz - XZ-compressed tar archives
  • .tar.lz - Lzip-compressed tar archives

Behavior

  • Archive format is automatically detected by file extension
  • Files are extracted to the same directory as the archive
  • Existing files with the same name are overwritten
  • Directory structure within the archive is preserved
  • File permissions and timestamps are preserved
  • Archive file is automatically deleted after successful extraction
  • Path traversal is prevented (archives cannot extract outside server directory)
The archive file is automatically deleted after extraction. If you need to keep the original archive, create a copy before decompressing.

Error Responses

Unsupported archive format
Missing or invalid Bearer token
Server or archive file does not exist
Failed to extract archive (corrupted archive, disk full, permission error, etc.)

Use Cases

  • Restore world backups
  • Install plugin packs
  • Extract uploaded archives
  • Restore server snapshots
  • Deploy pre-packaged configurations

Source Reference

Implementation: router/router_server_files.go (postServerDecompressFiles function)

Build docs developers (and LLMs) love