cPanel Host

/cpanel-host

GET

Returns a list of hosts.

Request parameters

N/A

JSON response

array: cPanel Host

Possible errors

N/A

Sample

curl \
--request GET \
--user "{{api_username}}:{{api_key}}" \
"{{api_base_url}}/cpanel-host" | python -m json.tool

POST

Add a cPanel host.

Request parameters

provisioner

uuid

The id of the provisioner of the host

availability_zone

uuid

The id of the availability zone

hostname

string

The hostname of the cPanel Host

port

integer

(Optional. Default: 2087) The port number of the cPanel Host. Must be between 0-65535.

api_version

integer

(Optional. Default: 1) The version of the cPanel/WHM api to be used for host

username

string

(Optional) The username of the host’s account

password

string

(Optional) The password of the host’s account

security_token

string

(Optional) A token that can be used to authenticate the requests to the host. Is the alternative to a username and password (only usable for WHM version 64 and higher)

is_enabled_for_provisioning

bool

(Optional. Default: false) Whether the host is enabled for account provisioning

is_accepting_resellers

bool

(Optional. Default: false) Whether the host is accepting resellers

Possible errors

JSON response

array: cPanel Host

Sample

curl \
--request POST \
--user "{{api_username}}:{{api_key}}" \
--data '
    {
        "provisioner": "3a6ca5b2-ba2b-49df-aeb3-225adcc3e8df",
        "availability_zone": "c297f684-e04d-418e-88ca-a0520965779f",
        "provisioning_for_countries": ["US", "NL", "BE"],
        "is_enabled_for_provisioning": True,
        "is_accepting_resellers": True,
        "hostname": "example-host.domain.com",
        "port": 2087,
        "api_version": 1,
        "security_token": "cpsess##########",
        "username": "user",
        "password": "password"
    }
' \
"{{api_base_url}}/cpanel-host" | python -m json.tool

/cpanel-host/{id}

GET

Get detailed information for this host.

Request parameters

N/A

JSON response

array: cPanel Host

Possible errors

Sample

curl \
--request GET \
--user "{{api_username}}:{{api_key}}" \
"{{api_base_url}}/cpanel-host/{id}" | python -m json.tool

PUT

Update a specific host.

Request parameters

is_enabled_for_provisioning

bool

(Optional) Whether the host is enabled for provisioning accounts

is_accepting_resellers

bool

(Optional) Whether the host is accepting resellers

hostname

string

(Optional) The hostname of the cPanel Host

port

integer

(Optional) The port number of the cPanel Host

api_version

integer

(Optional) The version of the cPanel software on the host

security_token

string

(Optional) A token that can be used to authenticate the requests to the host (only usable for WHM version 64 or higher)

username

string

(Optional) The username of the host’s account

password

string

(Optional) The password of the host’s account

JSON response

array: cPanel Host

Possible errors

Sample

curl \
--request PUT \
--user "{{api_username}}:{{api_key}}" \
--data '
    {
        "is_enabled_for_provisioning": True,
        "is_accepting_resellers": True,
        "hostname": "example-host.domain.com",
        "port": 2087,
        "api_version": 64,
        "security_token": "cpsess##########"
    }
' \
"{{api_base_url}}/cpanel-host/{id}" | python -m json.tool