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
Create a temporary session for a cPanel user to connect to Webmail.
Note:
The cPanel user must own the Webmail account.
After you successfully call this API, you will need to log in to Webmail. To do this, send an HTTP POST to https://$URL_AUTHTY:2096$token/login with a message body of session=$session where:
$URL_AUTHTYrepresents the value from thehostnamereturn.- If the
hostnamereturn value isnull, enter the hostname of the server that answered the API function. $tokenrepresents the value from the token return.
- If the
$sessionrepresents the value of the session return.
For example, an HTTP POST may resemble the following:
https://hostname.example.com:2096/cpsess2462418786/login
With a message body of:
session=username:D7NiAZv1nf4bXeg9:CREATE_WEBMAIL_SESSION_FOR_MAIL_USER,728fb86a7df1cf20690c65f349ac3137
The locale that the new session will use.
Note:
- You must only enter lowercase characters.
- This parameter defaults to the cPanel user's locale.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Session/create_webmail_session_for_mail_user
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Session/create_webmail_session_for_mail_user
- 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/Session/create_webmail_session_for_mail_user?domain=example.com&login=username&locale=en&remote_address=192.168.0.1'{ "apiversion": 3, "func": "create_webmail_session_for_mail_user", "module": "Session", "result": { "data": { … }, "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
This function creates a temporary session with a password for the calling cPanel user to connect to Webmail.
Note:
- The cPanel user must own the Webmail account.
- This function works like the UAPI Session::create_webmail_session_for_mail_user function with one exception. This function requires a correct password to create the Webmail session. If you use an incorrect password or attempt to connect to a suspended account, the login will fail.
After you successfully call this API, you will need to log in to Webmail. To do this, send an HTTP POST to https://$URL_AUTHTY:2096$token/login with a message body of session=$session where:
$URL_AUTHTYrepresents the value from thehostnamereturn.- If the
hostnamereturn value isnull, enter the hostname of the server that answered the API function. $tokenrepresents the value from the token return.
- If the
$sessionrepresents the value of the session return.
For example, an HTTP POST may resemble the following:
https://hostname.example.com:2096/cpsess2462418786/login
With a message body of:
session=username:D7NiAZv1nf4bXeg9:CREATE_WEBMAIL_SESSION_FOR_MAIL_USER,728fb86a7df1cf20690c65f349ac3137
The locale that the new session will use.
Note:
- You must only enter lowercase characters.
- This parameter defaults to the cPanel user's locale.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Session/create_webmail_session_for_mail_user_check_password
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Session/create_webmail_session_for_mail_user_check_password
- 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/Session/create_webmail_session_for_mail_user_check_password?domain=example.com&login=username&password=luggage12345&locale=en&remote_address=192.168.0.1'{ "apiversion": 3, "func": "create_webmail_session_for_mail_user_check_password", "module": "Session", "result": { "data": { … }, "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
Create a temporary session to connect to Webmail for the authenticated cPanel user.
After you successfully call this API, you will need to log in to Webmail. To do this, send an HTTP POST to https://$URL_AUTHTY:2096$token/login with a message body of session=$session where:
$URL_AUTHTYrepresents the value from thehostnamereturn.- If the
hostnamereturn value isnull, enter the hostname of the server that answered the API function. $tokenrepresents the value from the token return.
- If the
$sessionrepresents the value of the session return.
For example, an HTTP POST may resemble the following:
https://hostname.example.com:2096/cpsess2462418786/login
With a message body of:
session=username:D7NiAZv1nf4bXeg9:CREATE_WEBMAIL_SESSION_FOR_MAIL_USER,728fb86a7df1cf20690c65f349ac3137
The locale that the new session will use.
Use UAPI Locale::list_locales to see a list of valid locales.
Note:
- You must only enter lowercase characters.
- This parameter defaults to the cPanel user's locale.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Session/create_webmail_session_for_self
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Session/create_webmail_session_for_self
- 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/Session/create_webmail_session_for_self?locale=en&remote_address=192.168.0.1'{ "apiversion": 3, "func": "create_webmail_session_for_self", "module": "Session", "result": { "data": { … }, "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }