latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

cPHulk
Management

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.

post/batch_create_cphulk_records

Request body

api.version1 required

The WHM API version number.

list_name'black' | 'white' required

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.
skip_enabled_check0 | 1

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.

Example request

{
  "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

HTTP Request was successful.

Example response

{
  "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\""
    },
    "list_name": "white",
    "original_ips_added": [
      "192.168.0.1",
      "192.168.1.0/30",
      "122.1.56.7-122.1.56.8"
    ]
  },
  "metadata": {
    "command": "batch_create_cphulk_records",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}