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

Request

This function imports an SSH key.

Security
BasicAuth
Query
keystringrequired

The key's contents.

Example: key=-----BEGIN RSA PRIVATE KEY----- hPH+o4NgZrky7iGBb5iUg8R4aQzLPexpYfet25bLESvHOtutsBkbN7UWAaoM0pgM hytunlM8UU4BArJWlJyY6AD59aluZowBbuowKeU+f+TRaeJNJvkxTCOAipzp6LyG nrSVJ5hxSN/RPfntho1MEsdWYewVI4eLayuiZJyD+VONCYJh/vPLaZ9AVUJuMerl s/ZJ24AwCW8cILG+C3TWJRCjl4Ji+sJ9A5P29p/ad18cyJc1F+wmAzMULWitCaB7 mmE0i1nkiZRygQzzKjqdBYWCjujxfoE2+nPufAJg8ZdIEI1xSVBe5jKnj8DRX67w NAnNjXANMRePo39/RbDOSEXsD62h1qH93SnPsAhYT1JE6xHKV85AVIVOe8ktTA8t jMBBioCudBFngqPHknUrIJZ2QfUm0fkKBZaoKW4yr3JjGk+5y6kg02gSDIA7/jGc 8rs3iK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bXoOns1B l58ghMGtHG7D0VlHs6SIqFmHr5kUgSQ4jJ2KZkVU8CrPBZ2HRtHQJJyjZWW2AbrE -----END RSA PRIVATE KEY-----
namestringrequired

The key's name.

Example: name=TestKey
extract_privateinteger

Whether to extract and save only the private key.

  • 1 — Private key only.
  • 0 — All data.

Note:

This parameter defaults to 1 for PPK (PuTTY Key Generator) files and 0 for all other imports.

Enum01
Example: extract_private=0
extract_publicinteger

Whether to extract and save only the public key.

  • 1 — Public key only.
  • 0 — All data.

Note:

This parameter defaults to 1 for PPK (PuTTY Key Generator) files and 0 for all other imports.

Enum01
Example: extract_public=0
passphrasestring or null

The key's passphrase.

Note:

This parameter is required whenever you import a PPK file.

Default null
Example: passphrase=123456luggage
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/importsshkey?key=-----BEGIN+RSA+PRIVATE+KEY-----+hPH%2Bo4NgZrky7iGBb5iUg8R4aQzLPexpYfet25bLESvHOtutsBkbN7UWAaoM0pgM+hytunlM8UU4BArJWlJyY6AD59aluZowBbuowKeU%2Bf%2BTRaeJNJvkxTCOAipzp6LyG+nrSVJ5hxSN%2FRPfntho1MEsdWYewVI4eLayuiZJyD%2BVONCYJh%2FvPLaZ9AVUJuMerl+s%2FZJ24AwCW8cILG%2BC3TWJRCjl4Ji%2BsJ9A5P29p%2Fad18cyJc1F%2BwmAzMULWitCaB7+mmE0i1nkiZRygQzzKjqdBYWCjujxfoE2%2BnPufAJg8ZdIEI1xSVBe5jKnj8DRX67w+NAnNjXANMRePo39%2FRbDOSEXsD62h1qH93SnPsAhYT1JE6xHKV85AVIVOe8ktTA8t+jMBBioCudBFngqPHknUrIJZ2QfUm0fkKBZaoKW4yr3JjGk%2B5y6kg02gSDIA7%2FjGc+8rs3iKN%2BQJ%2Fug2x%2Fv7Xe0OozVqpl5QTltEMGJzJ1jFh9WnqgsgLTiJWlE7x5VSv8+fV8A5WTafOhBHnKuOpmpjAel1GD5DT1jNx3L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SIqFmHr5kUgSQ4jJ2KZkVU8CrPBZ2HRtHQJJyjZWW2AbrE+-----END+RSA+PRIVATE+KEY-----&name=TestKey&extract_private=0&extract_public=0&passphrase=123456luggage'

Responses

HTTP Request was successful.

Bodyapplication/json
metadataobject
Response
application/json
{ "metadata": { "command": "importsshkey", "reason": "OK", "result": 1, "version": 1 } }

Request

This function lists the server's SSH keys.

Warning:

Only the root account can use this function, and it only affects the root keys. To perform this function on a regular user account, call the cPanel API 2 SSH::listkeys function through the WHM API.

Security
BasicAuth
Query
filesstring

A filename, to limit the results to keys that have that filename.

Example: files=TestKey
privateinteger

Whether to display only private keys.

  • 1 — Display only private keys.
  • 0 — Display all keys.
Default 1
Enum01
Example: private=0
private_textsinteger

Whether to include private key text.

  • 1 — Include private key text.
  • 0 — Do not include private key text.
Default 1
Enum01
Example: private_texts=0
publicinteger

Whether to display only public keys.

  • 1 — Display only public keys.
  • 0 — Display all keys.
Enum01
Example: public=0
public_textsinteger

Whether to include public key text.

  • 1 — Include public key text.
  • 0 — Do not include public key text.
Default 0
Enum01
Example: public_texts=0
sync_authorizedinteger

Whether to synchronize the keys that can access the server.

  • 1 — Synchronize the keys.
  • 0 — Do not synchronize the keys.
Default 0
Enum01
Example: sync_authorized=0
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/listsshkeys?files=TestKey&private=0&private_texts=0&public=0&public_texts=0&sync_authorized=0'

Responses

HTTP Request was successful.

Bodyapplication/json
dataobject
metadataobject
Response
application/json
{ "data": { "keys": [] }, "metadata": { "command": "listsshkeys", "reason": "OK", "result": 1, "version": 1 } }

Return cPanel account access hashDeprecated

Request

This function regenerates or retrieves a user's access hash. For more information about access hashes, read our Remote Access Key documentation.

Warning:

We deprecated this function. We strongly suggest that you use the WHM API 1 api_token_create function.

Security
BasicAuth
Query
generateintegerrequired

Whether to regenerate the access hash.

  • 1 — Regenerate the access hash.
  • 0 — Do not regenerate the access hash.
Enum01
Example: generate=0
userstring(username)required

The user's name.

Example: user=root
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/accesshash?generate=0&user=root'

Responses

HTTP Request was successful.

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

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

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