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
- 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/whm.openapi/editquota?quota=500&user=user'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
- 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/whm.openapi/get_disk_usage?cache_mode=on'Response
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
- 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/whm.openapi/limitbw?user=username&bwlimit=0'Response
application/json
{ "data": { "bwlimits": [ … ] }, "metadata": { "command": "limitbw", "reason": "Bandwidth Limit for username has been set to unlimited megabytes", "result": 1, "version": 1 } }