UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/
https://{host}:{port}/execute/
Request
This function returns a sorted list of files and directories.
Important:
When you disable the FileStorage role, the system disables this function. For more information, read our How to Use Server Profiles documentation.
Whether to return directories that contain subdirectories.
1— Return subdirectories.0— Do not retain subdirectories.
Whether to return the file's MIME type.
1— Include MIME type.0— Do not include MIME type.
Note:
If you set this value to 0 but also include the mime_types or raw_mime_types parameters, the function overrides your specified value and sets this parameter to 1.
Whether to parse the file owner's read and write permissions.
1— Parse file permissions.0— Do not parse file permissions.
Whether to return only entries that begin with the filepath- prefix.
1— Return only files that begin with thefilepath-prefix.0— Return all files.
If you do not use this parameter, the function returns all filenames.
The MIME types to return.
- If you use this parameter, the function returns the specified MIME types and sets the
include_mimeparameter's value to1. - If you do not use this parameter, the function returns all MIME types.
A comma-separated list of files to return.
If you do not use this parameter, the function returns all files.
The raw MIME types to return.
- If you use this parameter, the function returns the specified MIME types and sets the
include_mimeparameter's value to1. - If you do not use this parameter, the function returns all MIME types.
Whether to include hidden files in the output.
1— Include hidden files.0— Do not include hidden files.
A pipe-separated list of file types to return.
file— A file.dir— A directory.char— A character special device.block— A block special device.fifo— A named pipe (FIFO).link— A symbolic link.socket— A Unix domain socket.
If you do not use this parameter, the function returns all file types.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Fileman/list_files
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Fileman/list_files
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Fileman/list_files?dir=public_html&check_for_leaf_directories=1&include_mime=1&include_permissions=0&limit_to_list=0&mime_types=text-plain&only_these_files=cpbackup-exclude.conf&raw_mime_types=text%2Fplain&show_hidden=1'{ "apiversion": 3, "func": "list_files", "module": "Fileman", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
Request
This function saves a file in a directory and encodes it in a character set.
Important:
When you disable the File Storage role, the system disables this function.
The new file's contents. If you do not use this parameter, the function creates a blank file.
The directory that contains the selected file.
Note:
This parameter defaults to the currently-authenticated user's /home directory.
Whether the function will return an error or save in the default character set if it cannot save in the specified character set.
1— Save in the default character set.0— Return an error.
The character set encoding of the content parameter's value.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Fileman/save_file_content
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Fileman/save_file_content
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Fileman/save_file_content?file=example.html&content=hi&dir=%2Fhome%2Fusername%2Fpublic_html&fallback=0&from_charset=UTF-8&to_charset=ASCII'{ "apiversion": 3, "func": "save_file_content", "module": "Fileman", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
Request
This function converts a buffer from one encoding language to another.
Important:
When you disable the File Storage role, the system disables this function.
Whether to discard any characters that do not transcode correctly.
1- Discard invalid characters.0- Transcode invalid characters in the default character set encoding.
Whether to transcode invalid characters to valid characters in the new character set encoding.
1- Transcode invalid characters in the new character set encoding.0- Return an error message.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Fileman/transcode
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Fileman/transcode
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Fileman/transcode?content=hi&discard_illegal=1&from_charset=UTF-8&to_charset=ASCII&transliterate=0'{ "apiversion": 3, "func": "transcode", "module": "Fileman", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }