WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
The cPHulk list's name.
black- Add a new record or records to the blacklist.white- Add a new record or records to the whitelist.
The list of records to add to the whitelist or blacklist.
Whether to skip checking if cPHulk runs on the server.
1- Do not check if cPHulk is running.0- Check if cPHulk is running.
Note:
If cPHulk is disabled and you check its status, the function returns the following message: cPHulk is disabled on the server.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/batch_create_cphulk_records
- A server running WHM.
https://whm-server.tld:2087/json-api/batch_create_cphulk_records
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/batch_create_cphulk_records \
-H 'Content-Type: application/json' \
-d '{
"api.version": 1,
"list_name": "white",
"records": [
{
"comment": "Automated update tools.",
"ip": "192.168.0.1"
},
{
"comment": "System administrators and support systems.",
"ip": "192.168.1.0/30"
},
{
"comment": "Owner of example.com.",
"ip": "122.1.56.7-122.1.56.8"
},
{
"comment": "Special access group 1",
"ip": "2001:db9::"
},
{
"comment": "Special access group 1",
"ip": "2001:db9::1-2001:db9::5"
},
{
"comment": "Special access group 2",
"ip": "2001:db8::/32"
}
]
}'{ "data": { "comment": "George Wendt flying through the air.", "ip_blocks_removed": 1, "ips_added": [ … ], "ips_failed": { … }, "iptable_bans_removed": 0, "list_name": "white", "original_ips_added": [ … ], "requester_ip": "10.1.4.228", "requester_ip_is_whitelisted": 0 }, "metadata": { "command": "batch_create_cphulk_records", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/cphulk_status
- A server running WHM.
https://whm-server.tld:2087/json-api/cphulk_status
- 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/cphulk_status{ "data": { "is_enabled": 1, "service": "cPHulk" }, "metadata": { "command": "cphulk_status", "reason": "OK", "result": 1, "version": 1 } }
The record's IP address, if there is only one IP address to add.
Note:
To add multiple IP addresses, increment the parameter name. For example, ip-1, ip-2, and ip-3.
Add multiple IP addresses.
Add a single IP address.
- string
- string
- string
- string
- string
- string
The cPHulk list's name.
black- Add a new record or records to the blacklist.white- Add a new record or records to the whitelist.
Whether to skip checking if cPHulk runs on the server.
1- Do not check if cPHulk is running.0- Check if cPHulk is running.
Note:
If cPHulk is disabled and you check its status, the function returns the following message: cPHulk is disabled on the server.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/create_cphulk_record
- A server running WHM.
https://whm-server.tld:2087/json-api/create_cphulk_record
- 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/create_cphulk_record?ip=192.168.0.1&list_name=white&comment=George+Wendt+flying+through+the+air.&skip_enabled_check=1'{ "data": { "comment": "George Wendt flying through the air.", "ip_blocks_removed": 1, "ips_added": [ … ], "ips_failed": { … }, "iptable_bans_removed": 0, "list_name": "white", "requester_ip": "10.1.4.228", "requester_ip_is_whitelisted": 0 }, "metadata": { "command": "create_cphulk_record", "reason": "OK", "result": 1, "version": 1 } }