Developer Resources
If you’re a developer, the cPanel and WHM software makes a number of tools available to you, including APIs that let you incorporate cPanel and WHM functions into your own applications.
WHM/cPanel APIs
The XML and JSON APIs allow you to automate WHM and cPanel functions.
Example: You can create a script that uses the
adddns API to automatically set up a
support.example.com subdomain for each of your customers. This option is much quicker and more convenient than accessing the
Add a DNS Zone feature in the WHM interface and adding the zones manually for each customer.
XML API
The
XML API allows you to submit commands to the cPanel and WHM system and receive an XML document in response. By including these commands in your custom scripts, you can perform functions remotely, without having to access the cPanel or WHM user interface.
JSON API (available in version 11.25+ only)
The
JSON API allows you to submit requests to the cPanel and WHM system and receive a JSON response, which works more quickly than XML from within JavaScript applications. By including these commands in your custom scripts, you can perform functions remotely, without having to access the cPanel or WHM user interface.
cPanel API versions 1 and 2
Versions 1 and 2 of the cPanel API are useful for developers creating custom themes or interfaces through which users can interact with cPanel. You can use the XML and JSON APIs to call cPanel API1 and API2 functions; this means that all cPanel API1 and API2 calls currently use a
/xml-api/cpanel or
/json-api/cpanel URL to pass the request. Click
here for details on calling these functions.
cPanel API version 1 (API1) — (Documentation currently under development.) If you wish to integrate a cPanel function into your custom application, and there is not yet an upgraded API for that function, you will use the cPanel API1 function call.
cPanel API version 2 (API2) — This upgraded version of the cPanel API allows you to integrate cPanel functions into your custom application.
Installing cPanel Plugins
cPanel Plugins are links that you add to a user’s cPanel interface. They allow you to integrate your own applications, or third-party ones, with cPanel.
Hooking into cPanel Functionality
There are numerous ways to hook into cPanel’s functionality, including function hooks, script hooks, and the CustomEventHandler module.
About the TailWatch service
TailWatch is a process that handles the tasks previously handled by three separate processes:
eximstats,
antirelayd, and
cpbandwd.
Creating cPAddon scripts
The cPAddons system allows a script to be packaged up so that it can be installed on a user's website, upgraded, uninstalled and otherwise managed from cPanel and WebHost Manager. This documentation describes how to package a script as a cPAddon and how to maintain that script.
cPanel modules and WHM scripts
These documents explain the modules and scripts used by cPanel and WHM.
- cPanel modules — Modules are software components that can be used to perform a variety of tasks on your server.
- WHM scripts — When cPanel and WHM is installed, a number of predefined scripts become available in your server’s
/scripts directory.
- The swapip utility — Though it does not reside in the
/scripts directory, this tool allows you to update the IP address in a DNS zone record.
Using remote access keys
When using remote access keys with cPanel/WHM, you may access either a Perl module or a PHP module, depending on your needs.