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
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
uapi --output=jsonpretty \
--user=username \
Stats \
get_bandwidth{ "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
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
uapi --output=jsonpretty \
--user=username \
Stats \
get_site_errors \
domain='example.com'{ "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
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
uapi --output=jsonpretty \
--user=username \
Stats \
list_sites \
engine='webalizer'{ "apiversion": 3, "func": "list_sites", "module": "Stats", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }