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 creates an email forwarder.
Important:
When you disable the MailReceive role, the system disables this function. For more information, read our How to Use Server Profiles documentation.
The failure message for the message's sender.
Note:
Use this parameter if you used the fail method for the fwdopt parameter.
The email address to which the system forwards messages.
Note:
You must use this parameter if you used the fwd method for the fwdopt parameter. You can pass multiple addresses to this parameter as a comma-separated list.
The system user to whom the system forwards messages.
Note:
You must use this parameter if you used the system method for the fwdopt parameter.
The application to which the system pipes messages.
Note:
You must use this parameter if you used the pipe method for the fwdopt parameter.
Important:
This parameter requires the FileStorage role. For more information, read our How to Use Server Profiles documentation.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Email/add_forwarder
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Email/add_forwarder
- 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/add_forwarder?domain=example.com&email=forwardme%40example.com&fwdopt=fwd&failmsgs=Nobody+home.&fwdemail=fwdtome%40example.com&fwdsystem=user&pipefwd=mailscript.pl'{ "apiversion": 3, "func": "add_forwarder", "module": "Email", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
This function returns the number of forwarders for every email address on a cPanel account.
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/count_forwarders
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Email/count_forwarders
- 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/count_forwarders{ "apiversion": 3, "func": "count_forwarders", "module": "Email", "result": { "data": 1, "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
This function deletes a domain-level forwarder.
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/delete_domain_forwarder
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Email/delete_domain_forwarder
- 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/delete_domain_forwarder?domain=example.com'{ "apiversion": 3, "func": "delete_domain_forwarder", "module": "Email", "result": { "data": null, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }