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/
Query Examples: ip=192.168.0.1&ip=192.168.0.2&ip=192.168.0.3 ip=192.168.0.1
The record's IP address.
Note:
To unblock multiple IP addresses, increment the parameter name (for example, to unblock three IP addresses, use the ip-1, ip-2, and ip-3 parameters).
Multiple IPv4 addresses.
ip=2001:db8::1&ip=2002:db8::1&ip=2003:db8::1
A single IPv4 address.
ip=2001:db8::1
Any of:
string(ipv4)
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/flush_cphulk_login_history_for_ips
- A server running WHM.
https://whm-server.tld:2087/json-api/flush_cphulk_login_history_for_ips
- 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/flush_cphulk_login_history_for_ips?ip=192.168.0.1'Response
application/json
{ "data": { "iptable_bans_removed": 1, "records_removed": 1 }, "metadata": { "command": "flush_cphulk_login_history_for_ips", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/read_cphulk_records
- A server running WHM.
https://whm-server.tld:2087/json-api/read_cphulk_records
- 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/read_cphulk_records?list_name=white&skip_enabled_check=1'Response
application/json
{ "data": { "ips_in_list": { … }, "list_name": "white", "requester_ip": "10.1.4.228", "requester_ip_is_whitelisted": 1, "restart_ssh": 1, "warning_ip": "The IP address is not on the white list.", "warning_ssh": "The system disabled the UseDNS setting for sshd in order to add IP addresses to the whitelist. You must restart sshd to implement the change." }, "metadata": { "command": "read_cphulk_records", "reason": "OK", "result": 1, "version": 1 } }