# Webmail Sessions Email / Webmail Sessions ## Create user session with existing session - [GET /Session/create_temp_user](https://api.docs.cpanel.net/specifications/cpanel.openapi/webmail-sessions/create_temp_user.md): This function creates a temporary user session. * Because this function requires a valid cPanel session ID, you call it via a cPanel or Webmail session URL. If you call this function via the command line or Template Toolkit, it will create a temporary user session. You use the WHM API 1 function to create a temporary user session. * Third-party plugins that require access to temporary MySQL users call this function via the URL. It will create the temporary users before they are available. You can find these users in the environment variable. * If you update your system, update your scripts to call the function. This will create a temporary user session for you. ## Create Webmail session - [GET /Session/create_webmail_session_for_mail_user](https://api.docs.cpanel.net/specifications/cpanel.openapi/webmail-sessions/create_webmail_session_for_mail_user.md): Create a temporary session for a cPanel user to connect to Webmail. The cPanel user must own the Webmail account. ### How to use this API After you successfully call this API, you will need to log in to Webmail. To do this, send an HTTP POST to with a message body of where: * represents the value from the return. * If the return value is , enter the hostname of the server that answered the API function. * represents the value from the token return. * represents the value of the session return. For example, an HTTP POST may resemble the following: With a message body of: ## Create Webmail session with credentials - [GET /Session/create_webmail_session_for_mail_user_check_password](https://api.docs.cpanel.net/specifications/cpanel.openapi/webmail-sessions/create_webmail_session_for_mail_user_check_password.md): This function creates a temporary session with a password for the calling cPanel user to connect to Webmail. * 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. ### How to use this API After you successfully call this API, you will need to log in to Webmail. To do this, send an HTTP POST to with a message body of where: * represents the value from the return. * If the return value is , enter the hostname of the server that answered the API function. * represents the value from the token return. * represents the value of the session return. For example, an HTTP POST may resemble the following: With a message body of: ## Create Webmail session for current user - [GET /Session/create_webmail_session_for_self](https://api.docs.cpanel.net/specifications/cpanel.openapi/webmail-sessions/create_webmail_session_for_self.md): Create a temporary session to connect to Webmail for the authenticated cPanel user. ### How to use this API After you successfully call this API, you will need to log in to Webmail. To do this, send an HTTP POST to with a message body of where: * represents the value from the return. * If the return value is , enter the hostname of the server that answered the API function. * represents the value from the token return. * represents the value of the session return. For example, an HTTP POST may resemble the following: With a message body of: