---
title: "Create Webmail session for current user"
method: GET
path: "/Session/create_webmail_session_for_self"
tags: ["Session", "Webmail Sessions"]
---

# Create Webmail session for current user

`GET /Session/create_webmail_session_for_self`

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](https://go.cpanel.net/webmailinterface).
To do this, send an HTTP POST to `https://$URL_AUTHTY:2096$token/login` with a message body of `session=$session` where:

* `$URL_AUTHTY` represents the value from the `hostname` return.
  * If the `hostname` return value is `null`, enter the hostname of the server that answered the API function.
  * `$token` represents the value from the token return.
* `$session` represents 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```

## Query parameters

- `locale` string
- `remote_address` string, ipv4

## Response `200`

HTTP Request was successful.

- object
  - `apiversion` integer — The version of the API.
  - `func` string — The name of the method called.
  - `module` string — The name of the module called.
  - `result` object
    - `data` object
      - `hostname` string, domain, nullable — The Webmail server's hostname. **Note:** The function returns a `null` value when the Webmail server is **not** remote.
      - `session` string — The session value to submit via POST to begin using the new session.
      - `token` string — A new security token.
    - `errors` string[], nullable — List of errors if the API failed.
    - `messages` string[], nullable — List of messages generated by the API.
    - `metadata` object
      - `transformed` 1 — Post-processing may have transformed the data.
    - `status` 0 | 1 — - 1 - Success - 0 - Failed: Check the errors field for more details.
    - `warnings` string[], nullable — List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.

---

[API](https://skmtc.net/cpanel/apis/cpanel-uapi.md) · [All operations](https://skmtc.net/cpanel/apis/cpanel-uapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/cpanel-uapi/revisions/632e2f8e6d04/schema)
