Unable to use UAPI Session:create_webmail_session_for_self


Jun 4, 2020
cPanel Access Level
Reseller Owner
I am trying to use the UAPI API for a small project of mine. Specifically, I am using the Session:create_webmail_session_for_self
this function has both GET and POST requests. Initially I send the GET request and then parse the data and then send a POST request. I get back the URL which looks like

"https://example.com:2096/cpsess6972.../index.html?login=1&post_login=89484517050776 "

but when I paste this link on my web-browser, it again asks for the password. what is it that i am doing wrong?


Quality Assurance Analyst
Staff member
Oct 2, 2010
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello shrinidhinhegde,

The API being used is for linked nodes (currently, for linking from a parent node to a child mail node). See more about Linked Server Nodes at Link Server Nodes | cPanel & WHM Documentation

If you are working with two linked server nodes, then the remote_address parameter would be required if you are using the backend to generate a URL to use from a browser. Please see the documentation for this information:

If you are not working with two cPanel & WHM servers that are linked, then the API to use would be the following one:

*Note:* After posting this, I was informed that the create_webmail_session_for_self UAPI can be used without having a linked server node. The question still remains if you are using the remote_address parameter when running your requests. If we could have the examples of exactly what you are running to get the output, that would be helpful. Thanks!
Last edited:


Staff member
Apr 10, 2013
You need to send this API call to cPanel (port 2083), not to Webmail.

It sounds like the easiest way to do what you want to do is just to use HTTP Basic Authentication to make your API call. That way you don’t have worry about logins or anything else.

There are PHP and Perl examples here: https://documentation.cpanel.net/di...cation+-+Username+and+Password+Authentication

So your POST will look like:


… with the payload being the form-encoded parameters for that API as described in the Developer Documentation.

Once you have that API response, then follow the /login directions—POSTing to Webmail this time—as given in the DD.
Last edited: