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/has_mycnf_for_cpuser
- A server running WHM.
https://whm-server.tld:2087/json-api/has_mycnf_for_cpuser
- 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/has_mycnf_for_cpuser?user=user'Response
application/json
{ "data": { "has_mycnf_for_cpuser": 1 }, "metadata": { "command": "has_mycnf_for_cpuser", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/list_users
- A server running WHM.
https://whm-server.tld:2087/json-api/list_users
- 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/list_usersResponse
application/json
{ "data": { "users": [ … ] }, "metadata": { "command": "list_users", "reason": "OK", "result": 1, "version": 1 } }
Query
A Perl Compatible Regular Expression (PCRE) that filters the results.
Note:
- The system matches the PCRE against the
searchtypeparameter's specified type. - If you do not specify a value for both the
searchtypeandsearchparameters, the function returns all of the server's accounts.
Example: search=username
The function's search method.
exact- The matched value and thesearchvalue must be identical.regex- The matched value must contain thesearchvalue.
Enum"exact""regex"
Example: searchmethod=exact
The account information to query. If you do not specify a value for both the searchtype and search parameters, the function returns all of the server's accounts.
domain- Match domains against thesearchregular expression.owner- Match the WHM user who owns the account against thesearchregular expression.user- Match usernames against thesearchregular expression.ip- Match IP addresses against thesearchregular expression.package- Match hosting plans (packages) against thesearchregular expression.
Enum"domain""owner""user""ip""package"
Example: searchtype=domain
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/listaccts
- A server running WHM.
https://whm-server.tld:2087/json-api/listaccts
- 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/listaccts?search=username&searchmethod=exact&searchtype=domain&want=domain%2Cdiskused'Response
application/json
{ "data": { "acct": [ … ] }, "metadata": { "command": "listaccts", "reason": "OK", "result": 1, "version": 1 } }