Add login security record to list with comment

This function adds one or more records to cPHulk's whitelist or blacklist. The function includes the option to add unique comments for each IP address that you add.

SecurityBasicAuth
Request
Request Body schema: application/json
api.version
required
integer

The WHM API version number.

Value: 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"
required
Array of objects

The list of records to add to the whitelist or blacklist.

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
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
post/batch_create_cphulk_records
Request samples
application/json
{
  • "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"
      }
    ]
}
Response samples
application/json
{
  • "data": {
    • "comment": "George Wendt flying through the air.",
    • "ip_blocks_removed": 1,
    • "ips_added": [
      • "192.168.0.1",
      • "192.168.1.0-192.168.1.3",
      • "122.1.56.7-122.1.56.8"
      ],
    • "ips_failed": {
      • "192.168.0.1": "Invalid IP address or range: \"192.68.0.1\""
      },
    • "iptable_bans_removed": 0,
    • "list_name": "white",
    • "original_ips_added": [
      • "192.168.0.1",
      • "192.168.1.0/30",
      • "122.1.56.7-122.1.56.8"
      ],
    • "requester_ip": "10.1.4.228",
    • "requester_ip_is_whitelisted": 0
    },
  • "metadata": {
    • "command": "batch_create_cphulk_records",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}