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 converts an image to a new file format.
Important:
When you disable the WebServer role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/ImageManager/convert_file
- A server running cPanel.
https://cpanel-server.tld:2083/execute/ImageManager/convert_file
- 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/ImageManager/convert_file?image_file=images%2Fmyimage.jpg&type=png'{ "apiversion": 3, "func": "convert_file", "module": "ImageManager", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
Request
This function creates thumbnails from images. The function saves the new thumbnail images in a thumbnails subdirectory inside the original directory. The system prepends thumbnail filenames with tn_ (for example, tn_picture.jpg).
Important:
When you disable the WebServer role, the system disables this function.
The path to the directory where the image resides. When you pass this parameter, the function creates a thumbnail directory directly below the image directory.
NOTE:
This parameter can use an absolute directory path or a path relative to the user's home directory.
The percentage by which to reduce the thumbnails' height.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/ImageManager/create_thumbnails
- A server running cPanel.
https://cpanel-server.tld:2083/execute/ImageManager/create_thumbnails
- 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/ImageManager/create_thumbnails?dir=images&height_percentage=25&width_percentage=25'{ "apiversion": 3, "func": "create_thumbnails", "module": "ImageManager", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
This function returns the dimensions of the image file that you specify.
Important:
When you disable the WebServer role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/ImageManager/get_dimensions
- A server running cPanel.
https://cpanel-server.tld:2083/execute/ImageManager/get_dimensions
- 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/ImageManager/get_dimensions?image_file=image%2Fmyimage.jpg'{ "apiversion": 3, "func": "get_dimensions", "module": "ImageManager", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }