Add login security record to list

This function adds a new record or records to cPHulk's whitelist or blacklist.

Authorizations:
query Parameters
ip
required
string <ipv4>

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.

Examples:
Add multiple IP addresses.
ip=ip-1=192.168.0.1&ip-2=192.168.0.2&ip-3=192.168.0.3
Add a single IP address.
ip=192.168.0.1
list_name
required
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.
Enum: "black" "white"
Example: list_name=white
comment
string <= 255

A comment to include.

Example: comment=George Wendt flying through the air.
skip_enabled_check
integer
Default: 0

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.

Enum: 0 1
Example: skip_enabled_check=1

Responses

Response Schema: application/json
object
object

Request samples

whmapi1 --output=jsonpretty \
  create_cphulk_record \
  list_name='white' \
  ip='192.168.0.1'

Response samples

Content type
application/json
{
  • "data": {
    • "comment": "George Wendt flying through the air.",
    • "ip_blocks_removed": 1,
    • "ips_added": [
      • "192.168.0.1"
      ],
    • "ips_failed": {
      • "192.168.0.1": "Invalid IP address or range: \"192.68.0.1\""
      },
    • "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
    }
}