# POST /domains/{name}/mail/accounts/{local}/webmail

First published 18 Oct 2026 (release 0.2.10) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the mail group.

Issue a webmail sign-in ticket for a mailbox

- Who may call it: administrator, reseller, customer
- Token scope, any of: mail, all
- Answers: 201 Created

The 201 response contains the mailbox's email address in address, the webmail URL in url, the ticket in ticket and its expiration time in expires_at. UrbeStack returns the cleartext ticket only when issuing it. Have the browser POST to url with the email address in _urbestack_user and the ticket in _urbestack_ticket. Roundcube signs in as the mailbox, with its settings and address book, and uses the ticket for IMAP on each request and for sending mail.

The ticket works only from the server that issued it and expires after 12 hours. It is revoked earlier at webmail logout, when mailbox sign-in is disabled, when the mailbox is deleted or when end_sessions is set to true. Issuing a new ticket replaces the previous one and ends the previous webmail session on its next request.

Issuance requires an installed mail system, webmail enabled through mail.webmail, an active owner account and mailbox sign-in enabled. The API returns 404 if the mailbox does not exist on the domain. UrbeStack logs each issuance in the audit log as webmail-open.

Administrators, the domain's owner and the owner's reseller can call this operation with a token that has the mail scope.

## As a command

- [urbestack-webmail-open](https://urbestack.com/docs/commands/urbestack-webmail-open.md): Issues a webmail sign-in ticket for the mailbox specified by --address.

## Parameters

- `name` (path, DomainName, required)
- `local` (path, LocalPart, required)

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X POST "$API/domains/example.com/mail/accounts/info/webmail" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 201 Created:

```
{
  "address": "info@example.com",
  "expires_at": "2026-09-16T10:15:00Z",
  "ticket": "text",
  "url": "text"
}
```

## Errors

- 400: --address is required
- 400: --ticket-stdin is required with --release
- 400: <what> must be text without control characters, 1 to <max> characters
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid IPv4 address
- 400: Invalid IPv6 address
- 400: Invalid domain name
- 400: Invalid mail address
- 400: Invalid mail address: local part over 64 characters
- 400: Invalid mail address: no local part
- 400: Invalid mail address: the local part may hold letters, digits, dots, _ + and -
- 400: Invalid port
- 400: Invalid setting key
- 401: Authentication required
- 403: The account <user> is suspended
- 403: The sign-in of <address> is off
- 404: No such mail account: <address>
- 404: Setting '<key>' not found
- 409: The mail system is not installed
- 409: Webmail is switched off on this server (mail.webmail)
