The file management endpoints allow you to interact with the server’s filesystem, including listing directories, reading/writing files, and performing file operations.
List Directory Contents
List files and folders in a directory.
curl -X GET "https://panel.example.com/api/client/servers/{server}/files/list?directory=/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
Directory path to list (default: /)
Response
{
"object": "list",
"data": [
{
"object": "file_object",
"attributes": {
"name": "server.jar",
"mode": "0644",
"mode_bits": "-rw-r--r--",
"size": 41943040,
"is_file": true,
"is_symlink": false,
"mimetype": "application/java-archive",
"created_at": "2024-01-15T10:30:00+00:00",
"modified_at": "2024-01-15T10:30:00+00:00"
}
},
{
"object": "file_object",
"attributes": {
"name": "logs",
"mode": "0755",
"mode_bits": "drwxr-xr-x",
"size": 4096,
"is_file": false,
"is_symlink": false,
"mimetype": "inode/directory",
"created_at": "2024-01-15T10:25:00+00:00",
"modified_at": "2024-01-15T12:45:00+00:00"
}
}
]
}
Human-readable file permissions
Whether this is a file (false for directories)
Read File Contents
Get the contents of a file.
curl -X GET "https://panel.example.com/api/client/servers/{server}/files/contents?file=/server.properties" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
Response
Returns the raw file contents as text/plain. Maximum file size is configurable (default 5MB).
Write File Contents
Write or update file contents.
curl -X POST "https://panel.example.com/api/client/servers/{server}/files/write?file=/server.properties" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: text/plain" \
--data-binary @server.properties
Path to the file to write
The file contents (sent as request body)
Response
Returns 204 No Content on success.
Download File
Generate a one-time download URL for a file.
curl -X GET "https://panel.example.com/api/client/servers/{server}/files/download?file=/backups/world.zip" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
Path to the file to download
Response
{
"object": "signed_url",
"attributes": {
"url": "https://node01.example.com/download/file?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
Signed URL for downloading the file (valid for 15 minutes)
Upload File
Get a one-time upload URL.
curl -X GET "https://panel.example.com/api/client/servers/{server}/files/upload" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
Response
{
"object": "signed_url",
"attributes": {
"url": "https://node01.example.com/upload/file?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
Use the returned URL to upload files via POST multipart/form-data.
Create Directory
Create a new directory.
curl -X POST "https://panel.example.com/api/client/servers/{server}/files/create-folder" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "plugins",
"root": "/"
}'
Name of the directory to create
Response
Returns 204 No Content on success.
Rename Files
Rename or move files and directories.
curl -X PUT "https://panel.example.com/api/client/servers/{server}/files/rename" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"root": "/",
"files": [
{
"from": "old_name.txt",
"to": "new_name.txt"
},
{
"from": "folder1/file.txt",
"to": "folder2/file.txt"
}
]
}'
Base directory for the operations
Array of rename operations with from and to paths
Response
Returns 204 No Content on success.
Copy File
Copy a file to a new location.
curl -X POST "https://panel.example.com/api/client/servers/{server}/files/copy" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"location": "/path/to/file.txt"
}'
Response
Returns 204 No Content on success. Creates a copy with ” copy” appended to the filename.
Delete Files
Delete one or more files or directories.
curl -X POST "https://panel.example.com/api/client/servers/{server}/files/delete" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"root": "/",
"files": [
"old_file.txt",
"unused_folder"
]
}'
Base directory for the operations
Array of file/directory names to delete
Response
Returns 204 No Content on success.
Compress Files
Create a compressed archive from files and directories.
curl -X POST "https://panel.example.com/api/client/servers/{server}/files/compress" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"root": "/",
"files": [
"world",
"plugins",
"server.properties"
]
}'
Base directory for the operations
Array of files/directories to include in the archive
Response
{
"object": "file_object",
"attributes": {
"name": "archive-2024-01-15-123456.tar.gz",
"mode": "0644",
"mode_bits": "-rw-r--r--",
"size": 104857600,
"is_file": true,
"is_symlink": false,
"mimetype": "application/gzip",
"created_at": "2024-01-15T12:34:56+00:00",
"modified_at": "2024-01-15T12:34:56+00:00"
}
}
Decompress Archive
Extract a compressed archive.
curl -X POST "https://panel.example.com/api/client/servers/{server}/files/decompress" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"root": "/",
"file": "backup.tar.gz"
}'
Directory containing the archive
Archive filename to extract
Response
Returns 204 No Content on success.
Change Permissions
Update file or directory permissions.
curl -X POST "https://panel.example.com/api/client/servers/{server}/files/chmod" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"root": "/",
"files": [
{
"file": "start.sh",
"mode": "0755"
}
]
}'
Base directory for the operations
Array of objects with file (path) and mode (octal permissions)
Response
Returns 204 No Content on success.
Pull Remote File
Download a file from a remote URL to the server.
curl -X POST "https://panel.example.com/api/client/servers/{server}/files/pull" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/plugin.jar",
"directory": "/plugins",
"filename": "CustomPlugin.jar",
"use_header": false,
"foreground": false
}'
URL of the file to download
Target directory on the server
Custom filename (optional, uses URL filename if not provided)
Use Content-Disposition header for filename (default: false)
Download in foreground (default: false for background)
Response
Returns 204 No Content on success. The download happens asynchronously in the background.