Skip to content
Download OpenAPI description
Overview
Languages
Servers
Mock server

https://api.docs.cpanel.net/_mock/specifications/whm.openapi/

A server running WHM.

https://{host}:{port}/json-api/

Restore Account

Account Restoration / Restore Account

Operations

Restore Queue Management

Account Restoration / Restore Queue Management

Operations

Restore Queue Reporting

Account Restoration / Restore Queue Reporting

Operations

Account Creation

Accounts Creation / Accounts

Operations

Account Enhancements

Accounts / Account Enhancements

Operations

Account Management

Accounts / Account Management

Operations

Bandwidth and Disk Quotas

Accounts / Bandwidth and Disk Quotas

Operations

Domain Information

Accounts / Domain Domain Information

Operations
Operations

Styles

The Styles and Themes module for WHM API 1.

Operations
Operations

API Execution

API Development Tools / API Execution

Operations

API Statistics

API Development Tools / API Statistics

Operations

API Token Management

API Development Tools / API Token Management

Operations

Applications

API Development Tools / Applications

Operations

Session

API Development Tools / Session

Operations

Authentication Providers

Authentication / Authentication Providers

Operations

External Authentication

Authentication / External Authentication

Operations

Login URL

Authentication / Login URL

Operations

SSH Keys and Connections

Authentication / SSH Keys and Connections

Operations

Two-Factor Authentication

Authentication / Two-Factor Authentication

Operations

Backup Destination

Backups / Backup Destination

Operations

Backup or Restore

Backups / Backup or Restore

Operations

Backup Settings

Backups / Backup Settings

Operations

Legacy Migration

Backups / Legacy Migration

Operations

Market Integration

Commerce Integration / Market Integration

Operations

Sitejet

The Sitejet module for WHM API.

Operations

Product Management

cPanel Market / Product Management

Operations

Provider Management

cPanel Market / Provider Management

Operations

Support Access

cPanel Support Tickets / Support Access

Operations

Ticket Management

cPanel Support Tickets / Ticket Management

Operations

Customizations

The Customizations module for WHM API 1.

Operations

Manage MySQL Server

Databases / Manage MySQL Server

Operations

MySQL Databases

Databases / MySQL Databases

Operations

PostgreSQL Databases

Databases / PostgreSQL Databases

Operations

Remote MySQL Databases

Databases / Remote MySQL Databases

Operations

DNS Cluster Settings

DNS / DNS Cluster Settings

Operations
Operations
Operations

Domain Management

DNS / Domain Management

Operations

Domain Management

DNS / Domain Management

Operations
Operations

Service Records

DNS / Service Records

Operations

Feature Access

Hosting Plans / Feature Access

Operations

Feature Lists

Hosting Plans / Feature Lists

Operations

Hosting Plan Extensions

Hosting Plans / Hosting Plan Extensions

Operations

Hosting Plans

Hosting Plans / Hosting Plans

Operations

InProductSurvey

In-product survey information.

Operations

API Authentication

Integrations / API Authentication

Operations

Scripts Hooks

Integrations / Scripts Hooks

Operations

IPv4 Address Settings

IP Address Management / IPv4 Address Settings

Operations

IPv6 Address Settings

IP Address Management / IPv6 Address Settings

Operations

Network Address Translation

IP Address Management / Network Address Translation

Operations

Management

Login Security (cPHulk) / Management

Operations

Reporting

Login Security (cPHulk) / Reporting

Operations

Settings

Login Security (cPHulk) / Settings

Operations

Return login security configuration settings

Request

This function returns cPHulk's current settings.

Security
BasicAuth
curl -i -X GET \
  -u <username>:<password> \
  https://api.docs.cpanel.net/_mock/specifications/whm.openapi/load_cphulk_config

Responses

HTTP Request was successful.

Bodyapplication/json
dataobject
metadataobject
Response
application/json
{ "data": { "cphulk_config": {} }, "metadata": { "command": "load_cphulk_config", "reason": "OK", "result": 1, "version": 1 } }

Save login security configuration settings

Request

This function modifies cPHulk's configuration settings.

Security
BasicAuth
Query
block_brute_force_with_firewallinteger

Whether to use the server firewall to block brute force attacks.

  • 1 — Use the firewall.
  • 0 — Do not use the firewall.
Default 0
Enum01
Example: block_brute_force_with_firewall=0
block_excessive_brute_force_with_firewallinteger

Whether to use the server firewall to block excessive brute force attacks.

  • 1 — Use the firewall.
  • 0 — Do not use the firewall.
Default 0
Enum01
Example: block_excessive_brute_force_with_firewall=0
brute_force_period_minsinteger>= 1

The number of minutes over which cPHulk measures all login attempts to a specific user's account.

Default 5
Example: brute_force_period_mins=5
command_to_run_on_brute_forcestring

The command to run when an IP address triggers brute force protection.

Note:

For a list of commands, read the Command variables section of our cPHulk Brute Force Protection documentation.

Default ""
Example: command_to_run_on_brute_force=
command_to_run_on_excessive_brute_forcestring

The command to run when the system blocks an IP address for a one day period.

Note:

For a list of commands, read the Command variables section of our cPHulk Brute Force Protection documentation.

Default ""
Example: command_to_run_on_excessive_brute_force=
ip_based_protectioninteger

Whether to enable IP address-based protection on all requests.

  • 1 — Enable IP-based protection.
  • 0 — Disable IP-based protection.

Note:

If you set this parameter to 0, you cannot use the following parameters:

  • block_brute_force_with_firewall
  • block_excessive_brute_force_with_firewall
  • ip_brute_force_period_mins
Default 1
Enum01
Example: ip_based_protection=1
ip_brute_force_period_minsinteger>= 1

The number of minutes in which cPHulk measures an attacker's login attempts.

Default 15
Example: ip_brute_force_period_mins=15
lookback_period_mininteger>= 0

The number of minutes over which cPHulk counts failed logins against a user.

Default 360
Example: lookback_period_min=360
mark_as_bruteinteger>= 0

The maximum number of failures from a specific IP address before cPHulk blocks that address for a two-week period.

Default 30
Example: mark_as_brute=30
max_failuresinteger>= 0

The maximum number of failures that cPHulk allows per account within the defined time range.

Default 30
Example: max_failures=30
max_failures_byipinteger>= 0

The maximum number of failures from a specific IP address before cPHulk locks out that address.

Default 5
Example: max_failures_byip=5
notify_on_bruteinteger

Whether cPHulk will send a notification when it detects a brute force attack.

  • 1 — Send the notification.
  • 0 — Do not send the notification.
Default 0
Enum01
Example: notify_on_brute=0
notify_on_root_logininteger

Whether cPHulk will send a notification when the root user successfully logs in from an IP address that is not on the whitelist.

  • 1 — Send the notification.
  • 0 — Do not send the notification.
Default 0
Enum01
Example: notify_on_root_login=0
notify_on_root_login_for_known_netblockinteger

Whether cPHulk sends a notification upon successful root login when the IP address is not on the whitelist, but from a known netblock.

  • 1 — Send the notification.
  • 0 — Do not send the notification.
Default 0
Enum01
Example: notify_on_root_login_for_known_netblock=0
skip_enabled_checkinteger

Whether to skip checking if cPHulk runs on the server.

  • 1 — Don't check cPHulk's status.
  • 0 — Check cPHulk's status.

Note:

If cPHulk is disabled, the function returns the following message: cPHulk is disabled on the server.

Default 0
Enum01
Example: skip_enabled_check=0
username_based_protectioninteger

Whether to enable username-based protection on all requests.

  • 1 — Enable.
  • 0 — Disable.
Default 0
Enum01
Example: username_based_protection=0
username_based_protection_for_rootinteger

Whether to allow username-based protection to lock out the root user.

  • 1 — Allow.
  • 0 — Do not allow.
Default 0
Enum01
Example: username_based_protection_for_root=0
username_based_protection_local_origininteger

Whether to enable username-based protection only on requests that originate from a local IP address.

  • 1 — Enable.
  • 0 — Disable.
Default 1
Enum01
Example: username_based_protection_local_origin=1
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/save_cphulk_config?block_brute_force_with_firewall=0&block_excessive_brute_force_with_firewall=0&brute_force_period_mins=5&ip_based_protection=1&ip_brute_force_period_mins=15&lookback_period_min=360&mark_as_brute=30&max_failures=30&max_failures_byip=5&notify_on_brute=0&notify_on_root_login=0&notify_on_root_login_for_known_netblock=0&skip_enabled_check=0&username_based_protection=0&username_based_protection_for_root=0&username_based_protection_local_origin=1'

Responses

HTTP Request was successful.

Bodyapplication/json
dataobject
metadataobject
Response
application/json
{ "data": { "cphulk_config": {}, "restart_ssh": 1, "warning": null }, "metadata": { "command": "save_cphulk_config", "reason": "OK", "result": 1, "version": 1 } }

Update login security configuration settings

Request

This function modifies a single cPHulk configuration settings as specified.

Security
BasicAuth
Query
keystringrequired

The configuration key for the setting to set/modify.

It should be one of the following:

  • block_brute_force_with_firewall - Whether to use cPanel & WHM's firewall to block brute force attacks.
  • block_excessive_brute_force_with_firewall - Whether to use cPanel & WHM's firewall to block excessive brute force attacks.
  • brute_force_period_mins - The number of minutes over which cPHulk measures all login attempts to a specific user's account.
  • brute_force_period_sec - The number of seconds over which cPHulk measures all login attempts to a specific user's account.
  • command_to_run_on_brute_force - The command to run when an IP address triggers brute force protection.
  • command_to_run_on_excessive_brute_force - The command to run when the system blocks an IP address blocked for a one day period.
  • country_blacklist - The countries to blacklist.
  • country_whitelist - The countries to whitelist.
  • ip_based_protection - Whether to enable IP address-based protection on all requests.
  • ip_brute_force_period_mins - The number of minutes in which cPHulk measures an attacker's login attempts.
  • ip_brute_force_period_sec - The number of seconds in which cPHulk measures an attacker's login attempts.
  • is_enabled - Whether to enable the cPHulk service.
  • lookback_period_min - The number of minutes over which cPHulk counts failed logins against a user.
  • lookback_time - The number of seconds over which cPHulk counts failed logins against a user.
  • mark_as_brute - The maximum number of failures from a specific IP address before cPHulk blocks that address for a two-week period.
  • max_failures - The maximum number of failures that cPHulk allows per account within the defined time range.
  • max_failures_byip - The maximum number of failures from a specific IP address before cPHulk locks out that address.
  • notify_on_brute - Whether cPHulk will send a notification when it detects a brute force attack.
  • notify_on_root_login - Whether cPHulk will send a notification when the root user successfully logs in from an IP address that is not on the whitelist.
  • notify_on_root_login_for_known_netblock - Whether cPHulk sends a notification upon successful root login when the IP address is not on the whitelist, but from a known netblock.
  • username_based_protection - Whether to enable username-based protection on all requests.
  • username_based_protection_for_root - Whether to allow username-based protection to lock out the root user.
  • username_based_protection_local_origin - Whether to enable username-based protection only on requests that originate from a local IP address.
Enum"block_brute_force_with_firewall""block_excessive_brute_force_with_firewall""brute_force_period_mins""brute_force_period_sec""command_to_run_on_brute_force""command_to_run_on_excessive_brute_force""country_blacklist""country_whitelist""ip_based_protection""ip_brute_force_period_mins"
Example: key=is_enabled
valuestring or integerrequired

The new value for the specified key. The allowable value depends on which key is being set.

For the following keys, the value must be 0 or 1:

  • block_brute_force_with_firewall
  • block_excessive_brute_force_with_firewall
  • ip_based_protection
  • is_enabled
  • notify_on_brute
  • notify_on_root_login
  • notify_on_root_login_for_known_netblock
  • username_based_protection
  • username_based_protection_for_root
  • username_based_protection_local_origin

For the following keys, the value must be an integer which specifies a number of minutes or seconds:

  • brute_force_period_mins
  • brute_force_period_sec
  • ip_brute_force_period_mins
  • ip_brute_force_period_sec
  • lookback_period_min
  • lookback_time - This one is in seconds despite not having sec in the name

These keys require the value to be a string containing a command to be run: (For a list of commands, read the Command Variables section of our cPHulk Brute Force Protection documentation.)

  • command_to_run_on_brute_force
  • command_to_run_on_excessive_brute_force

These keys require the value to be a string containing a comma-separated list of country codes: (For a list of countries, run the WHM API 1 get_countries_with_known_ip_ranges function.)

  • country_blacklist
  • country_whitelist

The following keys require an integer representing a maximum number of failures

  • mark_as_brute
  • max_failures
  • max_failures_byip
Example: value=1
One of:
string
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/set_cphulk_config_key?key=is_enabled&value=1'

Responses

HTTP Request was successful.

Bodyapplication/json
dataobject
metadataobject
Response
application/json
{ "data": { "cphulk_config": {} }, "metadata": { "command": "set_cphulk_config_key", "reason": "OK", "result": 1, "version": 1 } }

cPanel Account Mail Management

Mail / cPanel Account Mail Management

Operations

Mail DNS Settings

Mail / Mail DNS Settings

Operations

Mail Server Settings

Mail / Mail Server Settings

Operations

Spam Management

Mail / Spam Management

Operations

Spam Protection (Greylisting)

Mail / Spam Protection (Greylisting)

Operations

NGINX Manager

The NGINX Manager module for WHM API 1.

Operations

Account Enhancement Limit

Resellers / Account Enhancement Limit

Operations

Account Limits

Resellers / Account Limits

Operations

Account Permissions

Resellers / Account Permissions

Operations

Account Settings

Resellers / Account Settings

Operations

Reseller Account Management

Resellers / Account Management

Operations
Operations

Configuration Clusters

Server Administration / Configuration Clusters

Operations

Configurations

Server Administration / Configurations

Operations

Connected Applications

Server Administration / Connected Applications

Operations

Connections

Server Administration / Connections

Operations

cPanel Analytics

The cPanel Analytics module for WHM API 1.

Operations

License Management

The Server Administration module for WHM API 1.

Operations

Notifications

Server Administration / Notifications

Operations

Plugin-Based Features

The plugin-based features module for WHM API 1.

Operations

Security

The Security module for WHM API 1.

Operations

Server Nodes

Server Administration / Server Nodes

Operations

Server Profiles

Server Administration / Server Profiles

Operations

Services

Server Administration / Services

Operations

System Information

The Server Administration module for WHM API 1.

Operations

Updates

Server Administration / Updates

Operations

Auto-Generated Certificates

SSL Certificates / Auto-Generated Certificates

Operations

cPanel Account Settings

SSL Certificates / cPanel Account Settings

Operations

SSL Server Settings

SSL Certificates / SSL Server Settings

Operations

Install or Uninstall Package

System Package Management / Install or Uninstall Package

Operations

List Package Information

System Package Management / List Package Information

Operations

Package Manager Settings

System Package Management / Package Manager Settings

Operations

cPanel Account Transfer

Transfers / cPanel Account Transfer

Operations

Transfer Configuration

Transfers / Transfer Configuration

Operations

Transfer Monitoring

Transfers / Transfer Monitoring

Operations

UserData

Scoped userdata storage functions.

Operations

EasyApache Settings

Web Server Configuration / EasyApache Settings

Operations
Operations

PHP-FPM

Web Server Configuration / PHP-FPM

Operations

Rule Settings

Web Server Security (ModSecurity) / Rule Settings

Operations

Rule Vendor Settings

Web Server Security (ModSecurity) / Rule Vendor Settings

Operations

Server Settings

Web Server Security (ModSecurity) / Server Settings

Operations