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 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 } }
Request
This function resizes a specified image.
Important:
When you disable the WebServer role, the system disables this function.
The name of the file to scale.
Note:
Use the absolute filepath or a filepath relative to the user's home directory.
The path to the directory in which to save a copy the original image file.
Note:
- If you don't pass this parameter, the function doesn't save a copy of the original image.
- Use the absolute filepath or a filepath relative to the user's home directory.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/ImageManager/resize_image
- A server running cPanel.
https://cpanel-server.tld:2083/execute/ImageManager/resize_image
- 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/resize_image?height=300&image_file=%2Fimages%2Fimage.jpg&width=200&save_original_as=images%2Foriginal.jpg'{ "apiversion": 3, "func": "resize_image", "module": "ImageManager", "result": { "data": "/home/cptest1/images/myimage.jpg", "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }