Interfacing With cPanel and WHM as a Developer
Gaining access to cPanel/WHM functionality from an outside script or application
When developing a custom billing application, customer portal, or other external application, you can use cPanel's XML API to gain access to functionality on any cPanel/WHM server, local or remote. The XML API allows you to directly call WHM functionality, or to call cPanel's API1 and API2 APIs using the
XML API call.
Learn more about the XML API
The XML API functionality deprecates the previous cPanel::Accounting Perl and PHP modules
Hooks and reactions to changes in WHM / cPanel
The documentation mentioned below is deprecated; for updated information, please see Hooking into cPanel Functionality
While it is nice to be able to gain access to cPanel/WHM functionality, many times it is important to be able to react to changes that a user has made inside of cPanel/WHM. For example, you may need to perform a certain action each time an account or user is created by WHM. To do this, you can tie into the cPanel/WHM hook system. There are 2 types of hooks available for cPanel and WHM: script hooks and function hooks.
Script hooks allow you to react to actions performed by cPanel and WHM's scripts. For example,
is used to update cPanel/WHM. If you need to perform an action before or after an update, you can tie into the
Learn more about the cPanel/WHM Script Hooks
Function hooks allow you to tie into actions performed within the cPanel and WHM interfaces by API1 and API2 functions. For example, whenever a user changes his password, you can capture the user's new password and send it to a billing application.
Learn more about the cPanel Function Hooks
Topic revision: r6 - 23 Nov 2009 - 13:40:08 - MelanieSeibert