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/
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Bandwidth/get_enabled_protocols
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Bandwidth/get_enabled_protocols
- 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/Bandwidth/get_enabled_protocols{ "apiversion": 3, "func": "get_enabled_protocols", "module": "Bandwidth", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Bandwidth/get_retention_periods
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Bandwidth/get_retention_periods
- 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/Bandwidth/get_retention_periods{ "apiversion": 3, "func": "get_retention_periods", "module": "Bandwidth", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
This function queries an account's bandwidth data and returns a report.
Note:
This function also returns the bandwidth use of a distributed cPanel account.
How to group the data in the report, in pipe-separated format. This list must contain one or both of the following parameters:
A pipe-separated list that contains one or both of the following parameters:
domainprotocol
This parameter can also include only one of the following start time interval types:
yearyear_monthyear_month_dayyear_month_day_houryear_month_day_mour_minute
Note:
- This parameter accepts a maximum of three values.
- The function nests the return objects in the order that you declare the values in this parameter.
A pipe-separated list of domains for which to provided data.
Note:
- If you do not include this parameter, the function will return data for all domains on the cPanel account.
- The
UNKNOWN"pseudo-domain" refers to data recorded without a specific domain. All traffic except HTTP traffic is recorded without a specific domain.
Length of time between bandwidth data samples.
dailyhourly5min
Note:
The interval's retention period determines availability of the interval's data. Use the Bandwidth::get_retention_periods API to determine an interval's retention period.
A pipe-separated list of the protocols for which to provide data.
httpimapsmtppop3ftp
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Bandwidth/query
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Bandwidth/query
- 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/Bandwidth/query?end=1446664809&interval=daily&start=1445664609&timezone=America%2FChicago'grouping=domain
{ "data": { "UNKNOWN": 70447164, "example.com": 815258916235, "parkedexample.com": 18861122614, "subdomain.example.com": 11407, "subdomain2.example.com": 683533 }, "errors": null, "messages": null, "metadata": {}, "status": 1 }