cPanel Account

/cpanel

GET

Returns a list of accounts.

Request parameters

N/A

Possible errors

N/A

JSON response

Sample

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

POST

Add a cPanel account.

Request parameters

username

string

The username of the cPanel account

domain

string

The primary domain of the account

provisioning_host

uuid

The uuid of the host that should provision the account

is_auto_renew_enabled

boolean

true if account should be renewed automatically

plan

uuid

The plan that is enabled for the account

Possible errors

JSON response

Sample

curl \
--request POST \
--user "{{api_username}}:{{api_key}}" \
--data '
    {
        "username": "user",
        "domain": "userdomain.com",
        "provisioning_host": "596a4dee-ea96-43d0-b409-2bbdbf064142",
        "plan": "705efd40-50ad-41ae-b994-7ac31d8ac598",
        "is_auto_renew_enabled": true
    }
' \
"{{api_base_url}}/cpanel" | python -m json.tool

/cpanel/{account_id}

GET

Get detailed information for this account.

Request parameters

N/A

JSON response

Possible errors

Sample

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

DELETE

Delete an account.

Request parameters

N/A

Possible errors

JSON response

N/A

Sample

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

/cpanel/{account_id}/renew

POST

Manually renew an account. current_expiration_date must be provided to prevent accidental renews.

Request parameters

current_expiration_date

string

ISO-8601 date format.

JSON response

Possible errors

Sample

curl \
--request POST \
--user "{{api_username}}:{{api_key}}" \
--data '
    {
        "current_expiration_date": "2016-04-22"
    }
' \
"{{api_base_url}}/cpanel/{account_id}/renew" | python -m json.tool

/cpanel/{account_id}/suspend

POST

Manually suspend an account.

JSON response

Possible errors

Request parameters

reason

string

The reason for suspending

disallow_unsuspend

boolean

(Optional. default:false) Set true to only allow unsuspension by the root user of the host

Sample

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

/cpanel/{account_id}/restore

POST

Restore an account that entered redemption period after deletion.

Request parameters

N/A

JSON response

Possible errors

Sample

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

/cpanel-sso/{account_id}

GET

Request a Single Sign On url for the specified account to directly access the web interface of WHM, cPanel or Webmail.

Request parameters

service

string

(Optional) The service for which the SSO url should be generated. Either cpaneld (for cPanel), whostmgrd (for WHM) or webmaild (for Webmail) Default is cpaneld if nothing is supplied

locale

string

(Optional) A valid locale abbreviation to set the locale for the session

app

string

(Optional) After logging in, the user will get redirected to this application. Possible applications are:

  • Backups_Home

  • Calendar_Configure

  • ContactInfo_Change

  • Cron_Home

  • Database_MySQL

  • Database_phpMyAdmin

  • Domains_AddonDomains

  • Domains_SubDomains

  • Email_AccountLevelFiltering

  • Email_Accounts

  • Email_Archive

  • Email_Authentication

  • Email_AutoResponders

  • Email_BoxTrapper

  • Email_DefaultAddress

  • Email_DeliveryReport

  • Email_Forwarders

  • Email_GreyListing

  • Email_MailingLists

  • Email_MX

  • Email_SpamFilter

  • Email_UserLevelFiltering

  • FileManager_Home

  • Locale_Change

  • Password_Change

  • Site_Software

  • Site_Software_*

  • Stats_AWStats

  • WHMCS_billing

JSON response

object: {'url': login_url}

Possible errors

Sample

curl \
--request GET \
--user "{{api_username}}:{{api_key}}" \
--data '
        {
            "service": "cpaneld",
            "locale": "en-us",
            "app": "awstats"
        }
    ' \
"{{api_base_url}}/cpanel-sso/{account_id}" | python -m json.tool