Add IP address to cPanel account's block list

This function blocks IP addresses from accessing the domains on a cPanel account.

Important

When you disable the Web Server role, the system disables this function.

Authorizations:
query Parameters
ip
required
string

The IP address or IP address range that you wish to block.

Examples:
ip=192.168.0.1/16
ip=2001:db8::/32
ip=example.com
ip=192.168.0.1-58
ip=192.168.0.1-192.168.0.58
ip=2001:db8::1-2001:db8::3
ip=192.0.2.0
ip=2001:db8::1
ip=10.

Responses

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object

Request samples

uapi --output=jsonpretty \
  --user=username \
  BlockIP \
  add_ip \
  ip='192.168.0.1/16'

Response samples

Content type
application/json
{
  • "apiversion": 3,
  • "func": "add_ip",
  • "module": "BlockIP",
  • "result": {
    • "data": [
      • "1.1.1.1"
      ],
    • "errors": null,
    • "messages": null,
    • "metadata": {
      • "transformed": 1
      },
    • "status": 1,
    • "warnings": null
    }
}