UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/
https://{host}:{port}/execute/
Request
This function retrieves a .yaml.gz file that contains system-level filter information.
Important:
When you disable the Receive Mail role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Email/list_system_filter_info
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Email/list_system_filter_info
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Email/list_system_filter_info{ "apiversion": 3, "func": "list_system_filter_info", "module": "Email", "result": { "data": { … }, "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
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.
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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Email/reorder_filters
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Email/reorder_filters
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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'{ "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.
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, andval1parameters. - Assign the information for the second filter rule to the
action2,dest2,match2,opt2,part2, andval2parameters.
To create a filter that uses one set of actions but two sets of conditions, use the following parameters:
- Assign the actions to the
action1anddest1parameters. - Assign the first set of conditions to the
match1,opt1,part1, andval1parameters. - Assign the second set of conditions to the
match2,opt2,part2, andval2parameters.
The filter's action.
deliver- Deliver the message to thedest*address.fail- Force a delivery failure.finish- Stop processing the message.save- Save the message to thedest*file.pipe- Pipe the message to thedest*application.
Important:
- You must increment each action. For example, pass the first action as
action1and the second action asaction2. - This value requires the
FileStoragerole. For more information, read our How to Use Server Profiles documentation.
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:
ismatchescontainsdoes not containbeginsdoes not beginendsdoes not enddoes not match
Numeric operators:
is aboveis not aboveis belowis 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.
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'sList-IDheader value.$header_from:- Match against theFrom:section.$header_subject:- Match against theSubject:section.$header_to:- Match against theTo:section.$reply_address:- Match against theReply 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.
The value to match.
Important:
You must increment each value. For example, pass the first value as val1 and the second value as val2.
The email address, for user-level filters. If you do not use this parameter, the function creates an account-level filter.
The destination for filtered mail.
Important:
- This parameter is required if the action value is
deliver,save, orpipe. - You must increment each destination. For example, pass the first destination as
dest1and the second destination asdest2.
A valid email address.
A valid email address.
The name of an existing filter, to rename it. If you do not use this parameter, the function creates a new filter.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Email/store_filter
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Email/store_filter
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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'{ "apiversion": 3, "func": "store_filter", "module": "Email", "result": { "data": { … }, "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }