WHM API.
Download OpenAPI description
Overview
URL
WebPros International, LLC
License
Languages
Servers
Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
A server running WHM.
https://{host}:{port}/json-api/
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/editquota
- A server running WHM.
https://whm-server.tld:2087/json-api/editquota
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
editquota \
user='user' \
quota='500'Response
application/json
{ "metadata": { "command": "editquota", "reason": "Set quota for user.", "result": 1, "version": 1 } }
Query
Each cPanel & WHM server maintains a cache of users’ disk quota usage. This parameter controls the way this function will use that cache.
on- Use the quota cache. This is fast, but it may be inaccurate.off- Ignore the quota cache. This is slower, but it will be more accurate.
Default "on"
Enum"on""off"
Example: cache_mode=on
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/get_disk_usage
- A server running WHM.
https://whm-server.tld:2087/json-api/get_disk_usage
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
get_disk_usageResponse
application/json
{ "data": { "accounts": [ … ] }, "metadata": { "command": "get_disk_usage", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/limitbw
- A server running WHM.
https://whm-server.tld:2087/json-api/limitbw
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
limitbw \
user='username'Response
application/json
{ "data": { "bwlimits": [ … ] }, "metadata": { "command": "limitbw", "reason": "Bandwidth Limit for username has been set to unlimited megabytes", "result": 1, "version": 1 } }