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/lookupnsips
- A server running WHM.
https://whm-server.tld:2087/json-api/lookupnsips
- 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/lookupnsips?host=ns1.example.com'Response
application/json
{ "data": { "ipv4": "192.0.2.0", "ipv6": "2001:0db8:0:0:1:0:0:1" }, "metadata": { "command": "lookupnsips", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/set_up_dns_resolver_workarounds
- A server running WHM.
https://whm-server.tld:2087/json-api/set_up_dns_resolver_workarounds
- 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/set_up_dns_resolver_workaroundsResponse
application/json
{ "data": { "flags": { … } }, "metadata": { "command": "set_up_dns_resolver_workarounds", "reason": "OK", "result": 1, "version": 1 } }
Request
This function configures the server's resolver nameservers.
Warning:
- The nameservers that the server uses as resolvers must function correctly. If they do not, the server will experience performance and stability issues.
- Never set a resolver nameserver to
127.0.0.1on a cPanel & WHM server.
Security
BasicAuth
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/setresolvers
- A server running WHM.
https://whm-server.tld:2087/json-api/setresolvers
- 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/setresolvers?nameserver1=192.168.0.20&nameserver2=192.168.0.21&nameserver3=2001%3A4860%3A4860%3A%3A8888'Response
application/json
{ "metadata": { "command": "setresolvers", "output": { … }, "reason": "Your resolvers have been setup!", "result": 1, "version": 1 } }