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 retrieves a list of bandwidth records for the domains on a cPanel account.
Note:
This function also returns the bandwidth use of a distributed cPanel account.
Warning:
This function requires the Bandwidth Stats feature. To enable this feature, use WHM's Feature Manager interface (WHM >> Home >> Packages >> Feature Manager).
The timezone in which to report the data, in Olson tz format.
Note:
This parameter defaults to the server's timezone.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Stats/get_bandwidth
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Stats/get_bandwidth
- 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/Stats/get_bandwidth?timezone=America%2FChicago'{ "apiversion": 3, "func": "get_bandwidth", "module": "Stats", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
The domain for which to return error log entries.
The Apache log file to query. This parameter defaults to error.
error- The/var/log/apache2/error_logfile.suexec- The/var/log/apache2/suexec_logfile.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Stats/get_site_errors
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Stats/get_site_errors
- 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/Stats/get_site_errors?domain=example.com&log=suexec&maxlines=250'{ "apiversion": 3, "func": "get_site_errors", "module": "Stats", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Stats/list_sites
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Stats/list_sites
- 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/Stats/list_sites?engine=webalizer&traffic=http'{ "apiversion": 3, "func": "list_sites", "module": "Stats", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }