[Development Guides Home](/guides)

# Guide to Replacing cPanel API 1 Functions with UAPI Equivalents

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](https://docs.cpanel.net/knowledge-base/cpanel-product/cpanel-deprecation-plan) the cPanel API 1 functions. We **strongly** recommend that anyone using a cPanel API 1 function use a UAPI function instead.

## Replace cPanel API 1 functions with UAPI equivalents

To retrieve a list of cPanel API 1 functions that custom integrations call your system, call the following WHM API 1 functions:

* [`get_api_calls`](/openapi/whm/operation/get_api_calls/)
* [`get_api_pages`](/openapi/whm/operation/get_api_pages/)


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.

div
Note:

The examples below compare the cPanel API 1 `SetLang::setlang` function and the UAPI  [Locale::set_locale](/openapi/cpanel/operation/set_locale/) function.

#### LiveAPI PHP Class

**cPanel API 1 function**


```php
$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**


```php
$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',
    )
);
```

#### LiveAPI Perl Module

**cPanel API 1 function**


```perl
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**


```perl
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',
    }
);
```

div
Note:

For more information, read our [Guide to the LiveAPI System](/guides/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](/guides/quickstart-development-guide/tutorial-replace-a-cpanel-api-1-function-with-a-uapi-function) documentation.

## UAPI functions and legacy equivalents

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, read our [Guide to UAPI](/cpanel/introduction/) documentation.

#### BoxTrapper

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `BoxTrapper::changestatus` | [`BoxTrapper::set_status`](/openapi/cpanel/operation/set_status/) |
| `BoxTrapper::fetchcfgfile` | [`BoxTrapper::get_forwarders`](/openapi/cpanel/operation/get_forwarders/)[`BoxTrapper::get_email_template`](/openapi/cpanel/operation/get_email_template/)[`BoxTrapper::set_blocklist`](/specifications/cpanel.openapi/spam-prevention-(boxtrapper)/boxtrapper::set_blocklist/)[`BoxTrapper::get_blocklist`](/specifications/cpanel.openapi/spam-prevention-(boxtrapper)/boxtrapper::get_blocklist/)[`BoxTrapper::get_allowlist`](/specifications/cpanel.openapi/spam-prevention-(boxtrapper)/boxtrapper::get_allowlist/) |
| `BoxTrapper::listmsgs` | [`BoxTrapper::list_email_templates`](/openapi/cpanel/operation/list_email_templates/) |
| `BoxTrapper::logcontrols``BoxTrapper::showlog` | [`BoxTrapper::get_log`](/openapi/cpanel/operation/get_log/) |
| `BoxTrapper::messageaction``BoxTrapper::multimessageaction` | [`BoxTrapper::blacklist_messages`](/openapi/cpanel/operation/blacklist_messages/)[`BoxTrapper::delete_messages`](/openapi/cpanel/operation/delete_messages/)[`BoxTrapper::deliver_messages`](/openapi/cpanel/operation/deliver_messages/)[`BoxTrapper::ignore_messages`](/openapi/cpanel/operation/ignore_messages/)[`BoxTrapper::whitelist_messages`](/openapi/cpanel/operation/whitelist_messages/)[`BoxTrapper::process_messages`](/openapi/cpanel/operation/process_messages/) |
| `BoxTrapper::resetmsg` | [`BoxTrapper::reset_email_template`](/openapi/cpanel/operation/reset_email_template/) |
| `BoxTrapper::savecfgfile` | [`BoxTrapper::set_allowlist`](/specifications/cpanel.openapi/spam-prevention-(boxtrapper)/boxtrapper::set_allowlist) |
| `BoxTrapper::saveconf` | [`BoxTrapper::save_configuration`](/openapi/cpanel/operation/save_configuration/)[`BoxTrapper::save_email_template`](/openapi/cpanel/operation/save_email_template/)[`BoxTrapper::set_forwarders`](/openapi/cpanel/operation/set_forwarders/) |
| `BoxTrapper::showautowhitelist``BoxTrapper::showemails``BoxTrapper::showfromname``BoxTrapper::showqueuetime` | [`BoxTrapper::get_configuration`](/openapi/cpanel/operation/get_configuration/)  This function returns all of an account's BoxTrapper configuration settings. |
| `BoxTrapper::showmessage` | [`BoxTrapper::get_message`](/openapi/cpanel/operation/get_message/) |
| `BoxTrapper::showqueue``BoxTrapper::showqueuesearch` | [`BoxTrapper::list_queued_messages`](/openapi/cpanel/operation/list_queued_messages/)  This function inherently has [filtering capabilities](/cpanel/filters/). |
| `BoxTrapper::status``BoxTrapper::statusbutton` | [`BoxTrapper::get_status`](/openapi/cpanel/operation/get_status/) |


#### ClamScanner

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `ClamScanner::bars` | [`ClamScanner::get_scan_status`](/specifications/cpanel.openapi/antivirus-protection-(clamav)/clamscanner::get_scan_status)[`ClamScanner::get_scan_paths`](/specifications/cpanel.openapi/antivirus-protection-(clamav)/clamscanner::get_scan_paths)[`ClamScanner::start_scan`](/specifications/cpanel.openapi/antivirus-protection-(clamav)/clamscanner::start_scan)[`ClamScanner::list_infected_files`](/specifications/cpanel.openapi/antivirus-protection-(clamav)/clamscanner::list_infected_files)[`ClamScanner::disinfect_files`](/openapi/cpanel/operation/disinfect_files/)[`ClamScanner::check_disinfection_status`](/specifications/cpanel.openapi/antivirus-protection-(clamav)/clamscanner::check_disinfection_status) |


#### DenyIp

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `DenyIp::adddenyip` | [`BlockIp::add_ip`](/openapi/cpanel/operation/blockip-add-ip/) |
| `DenyIp::deldenyip` | [`BlockIp::remove_ip`](/openapi/cpanel/operation/blockip-remove-ip/) |


#### Fileman

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `Fileman::restoredb` | [`Backup::restore_databases`](/openapi/cpanel/operation/restore_databases/) |
| `Fileman::restorefiles` | [`Backup::restore_files`](/openapi/cpanel/operation/restore_files/) |
| `Fileman::restoreaf` | [`Backup::restore_email_filters`](/openapi/cpanel/operation/restore_email_filters/)[`Backup::restore_email_forwarders`](/openapi/cpanel/operation/restore_email_forwarders/) |


#### Gpg

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `Gpg::deletekey` | [`GPG::delete_keypair`](/openapi/cpanel/operation/delete_keypair/) |
| `Gpg::exportkey` | [`GPG::export_public_key`](/openapi/cpanel/operation/export_public_key/) |
| `Gpg::exportsecretkey` | [`GPG::export_secret_key`](/openapi/cpanel/operation/export_secret_key/) |
| `Gpg::genkey` | [`GPG::generate_key`](/openapi/cpanel/operation/generate_key/) |
| `Gpg::importkeys` | [`GPG::import_key`](/openapi/cpanel/operation/import_key/) |


#### Htaccess

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `Htaccess::del_user` | [`DirectoryPrivacy::delete_user`](/openapi/cpanel/operation/delete_user/) |
| `Htaccess::htdirls` | [`DirectoryPrivacy::list_directories`](/specifications/cpanel.openapi/directory-privacy/directoryprivacy-list_directories)[`DirectoryIndexes::list_directories`](/specifications/cpanel.openapi/directory-indexes/directoryindexes-list_directories)[`DirectoryProtection::list_directories`](/specifications/cpanel.openapi/directory-protection/directoryprotection-list_directories) |
| `Htaccess::number_of_users``Htaccess::showusers` | [`DirectoryPrivacy::list_users`](/specifications/cpanel.openapi/directory-privacy/directoryprivacy::list_users) |
| `Htaccess::resname` | [`DirectoryIndexes::get_indexing`](/openapi/cpanel/operation/get_indexing/) |
| `Htaccess::setindex` | [`DirectoryIndexes::set_indexing`](/openapi/cpanel/operation/set_indexing/) |
| `Htaccess::set_pass` | [`DirectoryPrivacy::add_user`](/openapi/cpanel/operation/add_user/) |
| `Htaccess::set_protect` | [`DirectoryPrivacy::configure_directory_protection`](/openapi/cpanel/operation/configure_directory_protection/) |


#### ImageManager

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `ImageManager::convert` | [`ImageManager::convert_file` ](/openapi/cpanel/operation/convert_file/) |
| `ImageManager::thumbnail` | [`ImageManager::create_thumbnails`](/openapi/cpanel/operation/create_thumbnails/) |
| `ImageManager::dimensions``ImageManager::hdimension``ImageManager::wdimension` | [`ImageManager::get_dimensions`](/openapi/cpanel/operation/get_dimensions/)  This function returns all of an image's dimensions. |
| `ImageManager::scale` | [`ImageManager::resize_image`](/openapi/cpanel/operation/resize_image/) |


#### LogManager

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `LogManager::listdownloads` | [`LogManager::list_archives`](/specifications/cpanel.openapi/logs/logmanager_list_archives) |
| `LogManager::savesettings` | [`LogManager::set_settings`](/specifications/cpanel.openapi/logs/logmanager_set_settings) |
| `LogManager::showsettings` | [`LogManager::get_settings`](/specifications/cpanel.openapi/logs/logmanager_get_settings) |


#### MySQL®

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `Mysql::listdbs``Mysql::listdbsopt``Mysql::number_of_dbs` | [`Mysql::list_databases`](/openapi/cpanel/operation/list_databases/) |
| `Mysql::routines` | [`Mysql::list_routines`](/openapi/cpanel/operation/list_routines/) |
| `Mysql::listusers``Mysql::listusersopt``Mysql::number_of_users` | [`Mysql::list_users`](/specifications/cpanel.openapi/user-management/mysql-list_users) |
| `Mysql::updateprivs` | `Mysql::update_privileges` |


#### Net

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `Net::dnslookup` | [`DNS::lookup`](/openapi/cpanel/operation/dns-lookup/) |


#### Park

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `Park::disableredirect` | [`Mime::delete_redirect`](/openapi/cpanel/operation/delete_redirect/) |
| `Park::getredirecturl` | [`Mime::get_redirect`](/openapi/cpanel/operation/get_redirect/) |
| `Park::setredirecturl` | [`Mime::add_redirect`](/openapi/cpanel/operation/add_redirect/) |


#### PHP

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `PHP::loaddocroots` | [`DomainInfo::domains_data`](/openapi/cpanel/operation/domains_data/) |
| `PHP::loadvars` | [`Variables::get_server_information`](/specifications/cpanel.openapi/cpanel-server-information/variables-get_server_information)[`Variables::get_session_information`](/openapi/cpanel/operation/get_session_information/)[`Variables::get_user_information`](/specifications/cpanel.openapi/account-information/variables-get_user_information) |


#### PostgreSQL®

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `Postgres::deluser` | [`Postgresql::delete_user`](/specifications/cpanel.openapi/postgresql-user-management/postgresql::delete_user) |
| `Postgres::listdbs``Postgres::listdbsopt` | [`Postgresql::list_databases`](/specifications/cpanel.openapi/postgresql-database-management/postgresql-list_databases) |
| `Postgres::listusersopt` | [`Postgresql::list_users`](/specifications/cpanel.openapi/postgresql-user-management/postgresql::list_users) |


#### ServerInformation

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `ServerInfo::servicestatus` | [`ServerInformation::get_information`](/openapi/cpanel/operation/get_information/) |


#### SetLang

div
Note:

We removed the SetLang cPanel API 1 module.

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `SetLang::setlang` | [`Locale::set_locale`](/openapi/cpanel/operation/set_locale/) |
| `SetLang::listlangsopt` | [`Locale::list_locales`](/openapi/cpanel/operation/list_locales/) |


#### Stats

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `Stats::analoglist``Stats::webalizer``Stats::webalizerftp` | [`Stats::list_sites`](/openapi/cpanel/operation/list_sites/)[`Stats::list_stats_by_domain`](/openapi/cpanel/operation/list_stats_by_domain/) |
| `Stats::errlog` | [`Stats::get_site_errors`](/openapi/cpanel/operation/get_site_errors/) |
| `Stats::showbandwidth` | [`Stats::get_bandwidth`](/openapi/cpanel/operation/get_bandwidth/) |


#### StatsManager

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `StatManager::updateUserConfig` | [`StatsManager::save_configuration`](/openapi/cpanel/operation/stats_manager_save_configuration/) |
| `StatManager::doForm` | [`StatsManager::get_configuration`](/openapi/cpanel/operation/stats_manager_get_configuration/) |


#### SubDomain

| cPanel API 1 Functions | UAPI Functions |
|  --- | --- |
| `SubDomain::disablesubrd` | [`Mime::delete_redirect`](/openapi/cpanel/operation/delete_redirect/) |
| `SubDomain::setsuburl` | [`Mime::add_redirect`](/openapi/cpanel/operation/add_redirect/) |
| `SubDomain::subdomainurl` | [`Mime::get_redirect`](/openapi/cpanel/operation/get_redirect/) |