Skip to content

cPanel UAPI (11.134.0.5)

UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.

Download OpenAPI description
Overview
Languages
Servers
Mock server

https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/

A server running cPanel.

https://{host}:{port}/execute/

API Token Management

API Development Tools / API Token Management

Operations
Operations

SSE Task Management

API Development Tools / SSE Task Management

Operations

URL Parsing

API Development Tools / URL Parsing

Operations

External Authentication

Authentication / External Authentication

Operations

Two-Factor Settings

Authentication / Two-Factor Settings

Operations

Block IP

Block Ip Addresses / Block IP

Operations

Market Integration

Commerce Integration / Market Integration

Operations

SSL Certificates

Commerce Integration / SSL Certificates

Operations

Contact Information

cPanel Account / Contact Information

Operations

Account Enhancements

The Account Enhancement module for UAPI.

Operations

Account Information

cPanel Account / Account Information

Operations

Account Management

cPanel Account / Account Management

Operations

Contact Information

cPanel Account / Contact Information

Operations

cPanel Features

cPanel Account / cPanel Features

Operations

Disk Quotas

cPanel Account / Disk Quotas

Operations

Personalization

The Personalization module for UAPI.

Operations

Resource Usage and Statistics

cPanel Account / Resource Usage and Statistics

Operations

Subaccount Management

cPanel Account / Subaccount Management

Operations

Team Roles

The Team Roles module for UAPI.

Operations

Team Users

The Team User module for UAPI.

Operations
Operations

File Restoration

cPanel Account Backups / File Restoration

Operations

Plugins

The Plugins module for UAPI.

Operations

Application Information

cPanel Theme Management / Application Information

Operations

Brand Management

cPanel Theme Management / Brand Management

Operations

Browser Cache Management

cPanel Theme Management / Browser Cache Management

Operations

Language

cPanel Theme Management / Language

Operations

Theme Settings

cPanel Theme Management / Theme Settings

Operations

Directory Indexes

Directory Management / Directory Indexes

Operations

Directory Privacy

Directory Management / Directory Privacy

Operations

Directory Protection

Directory Management / Directory Protection

Operations
Operations

DNS Information

DNS / DNS Information

Operations
Operations
Operations

Email DNS Settings

DNS / Email DNS Settings

Operations
Operations
Operations

Domain Information

Domain Management / Domain Information

Operations

Domain Redirection

Domain Management / Domain Redirection

Operations

SubDomain

The SubDomain module for UAPI.

Operations

Virtual Host Information

Domain Management / Virtual Host Information

Operations

Email Accounts

Email / Email Accounts

Operations

Email Filtering

Email / Email Filtering

Operations

Update email address's email filter order

Request

This function modifies the filter order for an email address. For more information about Exim filters, read Exim's documentation.

Important:

When you disable the Receive Mail role, the system disables this function.

Security
BasicAuth
Query
filter*stringrequired

A mail filter name.

For each mail filter to reorder, supply a filter* parameter, where * is a number that represents the filter's order.

For example, to set coffee as the first email filter and cheesecloth as the second, set coffee as the filter1 parameter's value, and cheesecloth as the value for the filter2 parameter.

Example: filter*=coffee
mailboxstringrequired

The email address.

Example: mailbox=user@example.com
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Email/reorder_filters?filter*=coffee&mailbox=user%40example.com'

Responses

HTTP Request was successful.

Bodyapplication/json
apiversioninteger

The version of the API.

Example: 3
funcstring

The name of the method called.

Example: "reorder_filters"
modulestring

The name of the module called.

Example: "Email"
resultobject
Response
application/json
{ "apiversion": 3, "func": "reorder_filters", "module": "Email", "result": { "data": null, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }

Request

This function creates a new email filter. For more information about Exim filters, read Exim's documentation.

Important:

When you disable the Receive Mail role, the system disables this function.

Create multiple rules

You may create up to 4,096 separate sets of conditions in one filter. To do this, append numbers to the parameter names.

To create a filter with two sets of actions and conditions, use the following parameters:

  • Assign the information for the first filter rule to the action1, dest1, match1, opt1, part1, and val1 parameters.
  • Assign the information for the second filter rule to the action2, dest2, match2, opt2, part2, and val2 parameters.

To create a filter that uses one set of actions but two sets of conditions, use the following parameters:

  • Assign the actions to the action1 and dest1 parameters.
  • Assign the first set of conditions to the match1, opt1, part1, and val1 parameters.
  • Assign the second set of conditions to the match2, opt2, part2, and val2 parameters.
Security
BasicAuth
Query
action*stringrequired

The filter's action.

  • deliver - Deliver the message to the dest* address.
  • fail - Force a delivery failure.
  • finish - Stop processing the message.
  • save - Save the message to the dest* file.
  • pipe - Pipe the message to the dest* application.

Important:

  • You must increment each action. For example, pass the first action as action1 and the second action as action2.
  • This value requires the FileStorage role. For more information, read our How to Use Server Profiles documentation.
Examples:
action*=action1=deliver action2=save
action*=deliver
string
filternamestringrequired

The filter name.

Example: filtername=coffee
match*stringrequired

The filter's match type.

  • If the val* parameter is a string, use a string operator.
  • If the val* parameter is an integer, use a numeric operator.

String operators:

  • is
  • matches
  • contains
  • does not contain
  • begins
  • does not begin
  • ends
  • does not end
  • does not match

Numeric operators:

  • is above
  • is not above
  • is below
  • is not below

Important:

You must increment each match type. For example, pass the first match type as match1 and the second match type as match2.

Examples:
match*=match1=contains match2=matches
match*=contains
string
part*stringrequired

The email section to query.

  • $h_x-Spam-Bar: - Match against the message's spam score value, measured in plus(+) characters.
  • $h_x-Spam-Score: - Match against the message's spam score value.
  • $h_X-Spam-Status: - Match against whether the system detected the message as spam.
  • $h_List-Id: - Match against the message's List-ID header value.
  • $header_from: - Match against the From: section.
  • $header_subject: - Match against the Subject: section.
  • $header_to: - Match against the To: section.
  • $reply_address: - Match against the Reply To: section.
  • $message_body: - Match against the message's body.
  • $message_headers: - Match against the message's headers.
  • foranyaddress $h_to:, $h_cc: - Match against all message recipients.
  • not delivered - Match if the message is not queued for delivery.
  • error_message - Match if the incoming message is bounced.

Important:

You must increment each section. For example, pass the first section as part1 and the second section as part2.

Note:

Generally, the recipient does not receive the BCC field in an email's header. For this reason you cannot use the BCC field in a filter.

Examples:
part*=part1=$header_from part2=$message_body
part*=$header_from
string
val*string or integerrequired

The value to match.

Important:

You must increment each value. For example, pass the first value as val1 and the second value as val2.

Examples:
val*=val1=coconut val2=12
val*=coconut
Any of:
string
accountstring(email)

The email address, for user-level filters. If you do not use this parameter, the function creates an account-level filter.

Example: account=user@example.com
dest*string

The destination for filtered mail.

Important:

  • This parameter is required if the action value is deliver, save, or pipe.
  • You must increment each destination. For example, pass the first destination as dest1 and the second destination as dest2.
Default ""
Examples:
dest*=dest1=user@example.com dest2=user2@example.com
dest*=user@example.com
Any of:

A valid email address.

string(email)

A valid email address.

Default ""
oldfilternamestring

The name of an existing filter, to rename it. If you do not use this parameter, the function creates a new filter.

Example: oldfiltername=pool
opt*string

The connection between multiple conditions.

Important:

You must increment each connection. For example, pass the first connection as opt1 and the second connection as opt2.

Default "and"
Examples:
opt*=opt1=and opt2=and
opt*=and
string
Default "and"
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Email/store_filter?action*=deliver&filtername=coffee&match*=matches&part*=%24h_x-Spam-Bar&val*=string&account=user%40example.com&oldfiltername=pool&opt*=and'

Responses

HTTP Request was successful.

Bodyapplication/json
apiversioninteger

The version of the API.

Example: 3
funcstring

The name of the method called.

Example: "store_filter"
modulestring

The name of the module called.

Example: "Email"
resultobject
Response
application/json
{ "apiversion": 3, "func": "store_filter", "module": "Email", "result": { "data": {}, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }

Run test for main domain email filters

Request

This function tests mail filters. The function only tests filters for the cPanel account's main domain, and only tests against the message's body. For more information about Exim filters, read Exim's documentation.

Note:

If the domain or account does not contain a filter file, this function will fail.

Important:

When you disable the Receive Mail role, the system disables this function.

Security
BasicAuth
Query
msgstringrequired

The string to test. The function uses this string as the body of an email message, to check whether filters would match the string.

Example: msg=Test
accountstring(email)

The email address, to test legacy cPanel filters in the filters directory. If you do not use this parameter, the function tests the main domain's filters in the /etc/vfilters directory.

Example: account=user@example.com
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Email/trace_filter?msg=Test&account=user%40example.com'

Responses

HTTP Request was successful.

Bodyapplication/json
apiversioninteger

The version of the API.

Example: 3
funcstring

The name of the method called.

Example: "trace_filter"
modulestring

The name of the module called.

Example: "Email"
resultobject
Response
application/json
{ "apiversion": 3, "func": "trace_filter", "module": "Email", "result": { "data": {}, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }

Email Forwarding

Email / Email Forwarding

Operations

Email Server Information

Email / Email Server Information.

Operations

Email Suspensions

Email / Email Suspensions

Operations

Mail Server Information

Email / Mail Server Information

Operations

Mailbox Management

Email / Mailbox Management

Operations

Mailing Lists

Email / Mailing Lists

Operations

Signing and Encryption (GnuPG Keys)

Email / Signing and Encryption (GnuPG Keys)

Operations

Spam Filtering (Greylisting)

Email / Spam Filtering (Greylisting)

Operations

Spam Management

Email / Spam Management

Operations

Spam Prevention (BoxTrapper)

Email / Spam Prevention (BoxTrapper)

Operations

Webmail Applications

Email / Webmail Applications

Operations

Webmail Sessions

Email / Webmail Sessions

Operations
Operations

FTP Server Settings

Files / FTP Server Settings

Operations
Operations
Operations

WebDisk Settings

Files / WebDisk Settings

Operations

Deployment Settings

GIT Management / Deployment Settings

Operations

Repository Management

GIT Management / Repository Management

Operations

InProductSurvey

The InProductSurvey module for cPanel UAPI.

Operations

Database Information

MySQL and MariaDB / Database Information

Operations

Database Management

MySQL and MariaDB / Database Management

Operations

Remote Databases

MySQL and MariaDB / Remote Databases

Operations

User Management

MySQL and MariaDB / User Management

Operations

Pushbullet

The Pushbullet module for UAPI.

Operations

Antivirus Protection (ClamAV)

Optional Applications / Antivirus Protection (ClamAV)

Operations

Calendar and Contacts (DAV)

Optional Applications / Calendar and Contacts (DAV)

Operations

Calendar and Contacts Server

Optional Applications / Calendar and Contacts Server

Operations

cPanel Addons (cPAddons)

Optional Applications / cPanel Addons (cPAddons)

Operations

WordPress Manager Backups

Optional Applications / WordPress Manager Backups

Operations

WordPress Manager Settings

Optional Applications / WordPress Manager Settings

Operations

PostgreSQL Database Management

PostgreSQL / Database Management

Operations

PostgreSQL User Management

PostgreSQL / User Management

Operations

Bandwidth

The Bandwidth module for UAPI.

Operations

Known SSH Hosts Management

Security / Known SSH Hosts Management

Operations

Login Information

Security / Login Information

Operations

cPanel Server Information

Server Information / cPanel Server Information

Operations

Notifications

The Notifications module for UAPI.

Operations

Password Strength

Server Information / Password Strength

Operations
Operations

ServiceProxy

The ServiceProxy module for UAPI.

Operations

SiteQuality

The SiteQuality module for UAPI.

Operations

Auto-generated SSL Certificates

SSL Certificates / Auto-generated SSL Certificates

Operations

cPanel Account SSL Management

SSL Certificates / cPanel Account SSL Management

Operations

SNI Email Settings

SSL Certificates / SNI Email Settings

Operations

SSL Certificate Management

SSL Certificates / SSL Certificate Management

Operations

Verify Domain Ownership

SSL Certificates / Verify Domain Ownership

Operations

Domain Statistics

Statistics / Domain Statistics

Operations

Weblog Settings

Statistics / Weblog Settings

Operations

UserData

The UserData module for cPanel UAPI.

Operations
Operations
Operations

Application Manager

Web Server Management / Application Manager

Operations

ModSecurity

The ModSecurity module for UAPI.

Operations

NginxCaching

The NginxCaching module for UAPI.

Operations

PHP Settings

Web Server Management / PHP Settings

Operations

Handler Management

Website Configuration / Handler Management

Operations
Operations

Mime Type Management

Website Configuration / Mime Type Management

Operations

Site Information

Website Configuration / Site Information

Operations

Site Installation

Website Configuration / Site Installation

Operations

Site Publisher Management

Website Configuration / Site Publisher Management

Operations

Sitejet

The Sitejet module for UAPI.

Operations