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/
Request
This function returns the public IP address for a specified public or private IP address. You can use this function to determine the system's main public IP address, especially for systems that use a 1:1 NAT configuration.
- cPanel & WHM uses the main public IP address to perform many different functions. For example, the system uses this IP address to verify the server's license status with WebPros International, LLC.
- System administrators can configure the main public IP address in WHM's Basic WebHost Manager Setup interface (Home >> Server Configuration >> Basic WebHost Manager Setup).
Security
BasicAuth
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/get_public_ip
- A server running WHM.
https://whm-server.tld:2087/json-api/get_public_ip
- 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_public_ip?ip=192.0.2.0'Response
application/json
{ "data": { "public_ip": "192.0.2.0" }, "metadata": { "command": "get_public_ip", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/nat_checkip
- A server running WHM.
https://whm-server.tld:2087/json-api/nat_checkip
- 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/nat_checkip?ip=192.168.4.10'Response
application/json
{ "data": { "checked_ip": "192.168.4.10" }, "metadata": { "command": "nat_checkip", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/nat_set_public_ip
- A server running WHM.
https://whm-server.tld:2087/json-api/nat_set_public_ip
- 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/nat_set_public_ip?local_ip=192.168.4.10&public_ip=10.5.3.33'Response
application/json
{ "metadata": { "command": "nat_set_public_ip", "reason": "OK", "result": 1, "version": 1 } }