Documentation Index
Fetch the complete documentation index at: https://mintlify.com/iFamishedX/HungerLib/llms.txt
Use this file to discover all available pages before exploring further.
FileManagerAPI is the low-level wrapper around Pterodactyl’s file management endpoints. It is attached to every Panel instance as panel.files and is also called internally by the convenience methods on GenericServer. Every method accepts a server_id as its first argument and returns a raw requests.Response object — parse response.json() for the payload or check response.status_code for success.
You will typically reach these methods through a GenericServer instance rather than calling them directly, but they are fully public and safe to use on their own when you need granular control over the Pterodactyl file API.
list
Returns the contents of a directory on the server’s filesystem.
Endpoint: GET /api/client/servers/{server_id}/files/list?directory={directory}
The short identifier of the target server (e.g.
"abc123").The directory path to list, relative to the server root. Defaults to the root directory
"/".requests.Response — JSON body contains a data array of file/directory objects, each with name, mode, size, is_file, is_symlink, mimetype, and modified_at.
download
Generates a short-lived signed download URL for a single file.
Endpoint: GET /api/client/servers/{server_id}/files/download?file={file_path}
The short identifier of the target server.
The full path to the file relative to the server root (e.g.
"/server.properties").requests.Response — JSON body contains attributes.url, a pre-signed URL you can GET to download the file contents.
upload
Uploads a file to the server using a multipart form upload. The underlying Panel._raw_upload() method handles the Content-Type: multipart/form-data encoding.
Endpoint: POST /api/client/servers/{server_id}/files/upload
The short identifier of the target server.
The destination directory on the server where the file will be written (e.g.
"/plugins").A dictionary in the format expected by
requests multipart uploads — typically {"files": (filename, file_object, content_type)}.requests.Response — A 204 No Content response on success.
delete
Permanently deletes one or more files or directories from the server.
Endpoint: POST /api/client/servers/{server_id}/files/delete
The short identifier of the target server.
The base directory from which the
files paths are resolved (e.g. "/").A list of file or directory names to delete, relative to
root (e.g. ["old-world", "crash.txt"]).requests.Response — A 204 No Content response on success.
rename
Renames one or more files or directories on the server.
Endpoint: POST /api/client/servers/{server_id}/files/rename
The short identifier of the target server.
The base directory containing the files to rename.
A list of rename operations. Each dict must contain
"from" (the current name) and "to" (the new name), both relative to root.requests.Response — A 204 No Content response on success.
copy
Creates a copy of a file within the server filesystem.
Endpoint: POST /api/client/servers/{server_id}/files/copy
The short identifier of the target server.
The base directory containing the file to copy.
A list of file paths (relative to
root) to copy. Pterodactyl appends a suffix to avoid naming conflicts.requests.Response — A 204 No Content response on success.
move
Moves one or more files to a new location on the server.
Endpoint: POST /api/client/servers/{server_id}/files/move
The short identifier of the target server.
The base directory from which source paths are resolved.
A list of move operations, each with
"from" and "to" keys specifying source and destination paths relative to root.requests.Response — A 204 No Content response on success.
create_folder
Creates a new directory on the server filesystem.
Endpoint: POST /api/client/servers/{server_id}/files/create-folder
The short identifier of the target server.
The parent directory in which to create the new folder (sent as the
root key in the JSON body).The name of the new folder to create.
requests.Response — A 204 No Content response on success.
compress
Compresses one or more files into an archive on the server.
Endpoint: POST /api/client/servers/{server_id}/files/compress
The short identifier of the target server.
The directory containing the files to compress.
A list of file or directory names (relative to
root) to include in the archive.requests.Response — JSON body describes the newly created archive file, including its name and size.
decompress
Extracts an archive file in-place on the server.
Endpoint: POST /api/client/servers/{server_id}/files/decompress
The short identifier of the target server.
The full path to the archive file to extract (sent as the
file key in the JSON body), e.g. "/archive-2024-01-01.tar.gz".requests.Response — A 204 No Content response on success; files are extracted into the same directory as the archive.