Create user session with existing session

This function creates a temporary user session.

Important:

  • Because this function requires a valid cPanel session ID, you must call it via a cPanel or Webmail session URL. If you call this function via the command line or Template Toolkit, it will not create a temporary user session. You must use the WHM API 1 create_user_session function to create a temporary user session.
  • Third-party plugins that require access to temporary MySQL users must call this function via the URL. It will create the temporary users before they are available. You can find these users in the $ENV{'REMOTE_DBOWNER'} environment variable.
  • If you cannot update your system, update your scripts to call the Cgi::phpmyadminlink function. This will create a temporary user session for you.
SecurityBasicAuth
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/Session/create_temp_user
Request samples
https://hostname.example.com:2083/cpsess##########/execute/Session/create_temp_user
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "create_temp_user",
  • "module": "Session",
  • "result": {
    • "data": {
      • "created": 1,
      • "session_temp_user": "cpses_reviY3ZSQK"
      },
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}