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 generates an SSH key pair.

Security
BasicAuth
Query
abort_on_existing_keyinteger

Whether to abort the function if the user already has a key with the same name.

  • 1 — Abort.
  • 0 — Continue.
Default 1
Enum01
Example: abort_on_existing_key=1
algorithmstring

The key's encryption algorithm. The parameter defaults to the system's default algorithm.

Enum"rsa2""dsa"
Example: algorithm=dsa
bitsinteger

The key's bits:

  • 1024 — The DSA algorithm's default value.
  • 2048
  • 4096 — The RSA algorithm's default value.
Enum102420484096
Example: bits=2048
commentstring

A comment.

Default ""
Example: comment=NoComment
namestring

The key's filename.

This parameter defaults to id_rsa if the algorithm is RSA, and id_dsa if the algorithm is DSA.

Default "id_rsa"
Example: name=KeyFile
passphrasestring

The key's secure passphrase.

Default ""
Example: passphrase=123456luggage
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/generatesshkeypair?abort_on_existing_key=1&algorithm=dsa&bits=2048&comment=NoComment&name=KeyFile&passphrase=123456luggage'

Responses

HTTP Request was successful.

Bodyapplication/json
dataobject
metadataobject
Response
application/json
{ "data": { "fingerprint": null, "name": "KeyFile" }, "metadata": { "command": "generatesshkeypair", "reason": "OK", "result": 1, "version": 1 } }

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 8rs3iKN+QJ/ug2x/v7Xe0OozVqpl5QTltEMGJzJ1jFh9WnqgsgLTiJWlE7x5VSv8 fV8A5WTafOhBHnKuOpmpjAel1GD5DT1jNx3LhWXMHOayawC0WY04lT5kkLLWhuN2 pNqY6UBk6Z3m1ifPINq85RdnHriJiD3H/+6P+cUyGSOznni8yqU764LId4nNClWd Xc+VvM1Udw0Sm7xF7err9CKHYUg3HfFYQPBQOfI0ib9wqOi7zWq2vhH21B5OgcTg Bsw/HJUQ/IVnTbsqgZSn0sckaRguv/ifmwbISO1aQ4Yxcohe/4miOw05r6ihbYGW LO5kP0I8SBMCibkGFh5AxVnNgoGAW0l33hOPPSIVUTkE+8d3zYXLzupTFXCvmohl jq0it7uIGOxSglf7XH3eXlNKaZjK7pBJgS5HeXM80JI8FCfifqnkaik8XTE66Ll0 s1ySaGevGkPpX5Rhbgsm4IqddAeFvlmKIND8Zvh/wfT++bbD7bbFwFlrWCU3chce 8KaNVUP+whCAlaS7oGcs38ygaRFXIE3vug4Ra8Xiy/qfyp4YR67sMg46avHyoVky uFbVv2n7HphZb7g3WS3ns3/gCQQv9TYcdBoRnKW2yEqbzOQb9Fdt7EjgMohT/bdS pM6nRWFNdmWoihLzLbSi3bnc9iDwXZA8KyE3mpVi4QFfijR4dfrVWxEz5Ln2l9HC SZA6VPGzEOwOVVND98/HTu3oViJUV1gyDIWlyggSUDTyhfo/Z+c3tTHa+cv0f7xY oL63hWLgZQD2m/g6rKpsN3NhC77tCyCNZavdKy7usvZyCsoH/mPR2129LcwAwbJ3 u2Ec7qLncztSePHOmfmCTTED00a0YzFhKIQoJf7GrgLCMapYN/YPu0vgTDMPSi11 RH0rdyzd6MuPVDZwLnWO+SltjX85yz1ba/Q199HZwQOw6ZyejDaPSWJHOndD3k+r Q0T38gci9k4D87EwmfpK7zOaCoaiGiRQ6+DdYOv6hlzQ6Fdb2FOtlGQZharQ9WTC jOJBEj2oGUruc6P3fqhfUVllWi4cck0GgWZwcsmG1dDr8W6K9lrGA1dPbXoOns1B 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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rWCU3chce+8KaNVUP%2BwhCAlaS7oGcs38ygaRFXIE3vug4Ra8Xiy%2Fqfyp4YR67sMg46avHyoVky+uFbVv2n7HphZb7g3WS3ns3%2FgCQQv9TYcdBoRnKW2yEqbzOQb9Fdt7EjgMohT%2FbdS+pM6nRWFNdmWoihLzLbSi3bnc9iDwXZA8KyE3mpVi4QFfijR4dfrVWxEz5Ln2l9HC+SZA6VPGzEOwOVVND98%2FHTu3oViJUV1gyDIWlyggSUDTyhfo%2FZ%2Bc3tTHa%2Bcv0f7xY+oL63hWLgZQD2m%2Fg6rKpsN3NhC77tCyCNZavdKy7usvZyCsoH%2FmPR2129LcwAwbJ3+u2Ec7qLncztSePHOmfmCTTED00a0YzFhKIQoJf7GrgLCMapYN%2FYPu0vgTDMPSi11+RH0rdyzd6MuPVDZwLnWO%2BSltjX85yz1ba%2FQ199HZwQOw6ZyejDaPSWJHOndD3k%2Br+Q0T38gci9k4D87EwmfpK7zOaCoaiGiRQ6%2BDdYOv6hlzQ6Fdb2FOtlGQZharQ9WTC+jOJBEj2oGUruc6P3fqhfUVllWi4cck0GgWZwcsmG1dDr8W6K9lrGA1dPbXoOns1B+l58ghMGtHG7D0VlHs6SIqFmHr5kUgSQ4jJ2KZkVU8CrPBZ2HRtHQJJyjZWW2AbrE+-----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 } }

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