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 address.
Important:
- When you disable the Receive Mail role, the system disables this function.
- We recommend that you use the UAPI
UserManager::create_userfunction to create an email address instead of this function. This function is incompatible with the Reset Password feature. - You must URI-encode values when using the CLI.
The email account username or address.
- A valid email account username. For example,
userto createuser@example.com. - A valid email address.
Note:
You cannot enter cpanel as an account name when you create an email account.
The email account's domain. For example, example.com to create user@example.com.
The account's password hash.
Notes:
- You can use this parameter instead of the
passwordparameter. However, you cannot use bothpasswordandpassword_hashparameters in the same request. - You can find your server's hash type in the
/etc/sysconfig/authconfigfile.
The maximum amount of disk space that the new email account may use.
- A positive integer that represents the maximum amount of disk space, in megabytes (MB).
0orunlimited— The account possesses unlimited disk space.
Note:
- The positive integer value cannot exceed the maximum email quota.
- The
0orunlimitedvalue is only available to users without a maximum email account quota.
Whether to send client configuration instructions to the account.
1— Send the instructions.0— Do not send the instructions.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Email/add_pop
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Email/add_pop
- 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_pop?email=user&password=123456luggage&domain=example.com&password_hash=%246%241sOyHP5ZDYp3pGUz%24R0TSgfPRHfDjT5PP5RJGv39FhiGTNNPvM7IFpCBjXijMmlMZk9yI8T3LqGuntc9fdKb5eX.lGL7wBS9e4DAWn%2F"a=500&send_welcome_email=0&skip_update_db=1'{ "apiversion": 3, "func": "add_pop", "module": "Email", "result": { "data": "user+example.com", "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
Request
This function lists the mail directory's subdirectories (boxes) and files.
Important:
When you disable the Receive Mail role, the system disables this function.
Notes:
If you do not use any input parameters, the function returns a list of items in the cPanel account's main mail directory.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Email/browse_mailbox
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Email/browse_mailbox
- 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/browse_mailbox?account=user%40example.com&dir=maildir&showdotfiles=0'{ "apiversion": 3, "func": "browse_mailbox", "module": "Email", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
This function returns the number of autoresponders 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_auto_responders
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Email/count_auto_responders
- 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_auto_responders{ "apiversion": 3, "func": "count_auto_responders", "module": "Email", "result": { "data": 1, "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }