This document lists the UAPI functions that replace previously-deprecated cPanel API 1 functions. As we developed additional UAPI functions, we created equivalents to some cPanel API 1 functions. These new modules and functions replace any cPanel API 1 functions without a current equivalent.
We are actively removing the cPanel API 1 functions. We strongly recommend that anyone using a cPanel API 1 function use a UAPI function instead.
To retrieve a list of cPanel API 1 functions that custom integrations call your system, call the following WHM API 1 functions:
The following examples display code from a cPanel API 1 function and its UAPI equivalent. Click the tab below that corresponds to your chosen development language.
The examples below compare the cPanel API 1 SetLang::setlang function and the UAPI Locale::set_locale function.
cPanel API 1 function
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
// Set the "en" locale for the account.
$new_language = $cpanel->api1(
'SetLang', 'setlang',
array('en')
);UAPI Function
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
// Set the "en" locale for the account.
$set_locale = $cpanel->uapi(
'Locale', 'set_locale',
array(
'locale' => 'en',
)
);cPanel API 1 function
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
# Set the "en" locale for the account.
my $new_language = $cpliveapi->api1(
'SetLang', 'setlang',
['en']
);UAPI function
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
# Set the "en" locale for the account.
my $set_locale = $cpliveapi->uapi(
'Locale', 'set_locale',
{
'locale' => 'en',
}
);For more information, read our Guide to the LiveAPI System.
For more information about how to replace a cPanel API 1 function with a UAPI function, read our Replace a cPanel API 1 Function With a UAPI Function documentation.
The following tables list the UAPI functions that we added. The tables also list their cPanel API 1 equivalent functions.
For a complete list of UAPI functions and cPanel API 1 functions, read our Guide to UAPI and Guide to cPanel API 1 documentation.
| cPanel API 1 Functions | UAPI Functions |
|---|---|
BoxTrapper::changestatus | BoxTrapper::set_status |
BoxTrapper::fetchcfgfile | |
BoxTrapper::listmsgs | BoxTrapper::list_email_templates |
BoxTrapper::get_log | |
BoxTrapper::resetmsg | BoxTrapper::reset_email_template |
BoxTrapper::savecfgfile | BoxTrapper::set_allowlist |
BoxTrapper::saveconf | |
BoxTrapper::get_configuration This function returns all of an account's BoxTrapper configuration settings. | |
BoxTrapper::showmessage | BoxTrapper::get_message |
BoxTrapper::list_queued_messages This function inherently has filtering capabilities. | |
BoxTrapper::get_status |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
ClamScanner::bars |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
DenyIp::adddenyip | BlockIp::add_ip |
DenyIp::deldenyip | BlockIp::remove_ip |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
Fileman::restoredb | Backup::restore_databases |
Fileman::restorefiles | Backup::restore_files |
Fileman::restoreaf |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
ImageManager::convert | ImageManager::convert_file |
ImageManager::thumbnail | ImageManager::create_thumbnails |
ImageManager::get_dimensions This function returns all of an image's dimensions. | |
ImageManager::scale | ImageManager::resize_image |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
LogManager::listdownloads | LogManager::list_archives |
LogManager::savesettings | LogManager::set_settings |
LogManager::showsettings | LogManager::get_settings |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
Mysql::list_databases | |
Mysql::routines | Mysql::list_routines |
Mysql::list_users | |
Mysql::updateprivs | Mysql::update_privileges |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
Net::dnslookup | DNS::lookup |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
Park::disableredirect | Mime::delete_redirect |
Park::getredirecturl | Mime::get_redirect |
Park::setredirecturl | Mime::add_redirect |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
PHP::loaddocroots | DomainInfo::domains_data |
PHP::loadvars |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
Postgres::deluser | Postgresql::delete_user |
Postgresql::list_databases | |
Postgres::listusersopt | Postgresql::list_users |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
ServerInfo::servicestatus | ServerInformation::get_information |
We removed the SetLang cPanel API 1 module.
| cPanel API 1 Functions | UAPI Functions |
|---|---|
SetLang::setlang | Locale::set_locale |
SetLang::listlangsopt | Locale::list_locales |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
| |
Stats::errlog | Stats::get_site_errors |
Stats::showbandwidth | Stats::get_bandwidth |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
StatManager::updateUserConfig | StatsManager::save_configuration |
StatManager::doForm | StatsManager::get_configuration |
| cPanel API 1 Functions | UAPI Functions |
|---|---|
SubDomain::disablesubrd | Mime::delete_redirect |
SubDomain::setsuburl | Mime::add_redirect |
SubDomain::subdomainurl | Mime::get_redirect |