# POST /mail/self/password

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the mail group.

Change a mailbox's password using its current credentials

- Who may call it: anyone (no token needed)
- Answers: 200 OK

Supply the mailbox's email address in address, its current mail login password in password, and the new password in new_password. The operation requires no API token. UrbeStack verifies the current password against the same stored hash Dovecot uses. Roundcube calls this operation from its password form.

A malformed or unknown email address, a malformed or incorrect current password, or a refusal under the login policy returns 401 with the same error message. UrbeStack reports login policy refusals and failed password checks, including checks for unknown email addresses, to the rules that ban IP addresses. A malformed email address or current password only triggers a log warning. After successful authentication, the operation returns 403 if mailbox logins are suspended or the mailbox's owner account is inactive.

A successful change immediately closes all open IMAP and POP3 sessions and revokes the mailbox's webmail sign-in tickets. The response returns the normalized email address in address and sets changed and sessions_ended to true. Roundcube signs in again with the new password on its next request.

## As a command

- [urbestack-mail-account-set](https://urbestack.com/docs/commands/urbestack-mail-account-set.md): Updates a mail account.

## Request body

JSON, the type [MailPasswordChange](https://urbestack.com/docs/api/types/MailPasswordChange.md).

- `address` (string, up to 320 characters, required): Mailbox email address in local@domain form.
- `new_password` (string, up to 128 characters, required): New mailbox password of 8 to 128 printable characters.
- `password` (string, up to 128 characters, required): Current mailbox password.

## 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/mail/self/password" \
  -H "Content-Type: application/json" \
  -d '{
    "address": "info@example.com",
    "new_password": "text",
    "password": "Sup3r-Secret-Passphrase"
  }'
```

Response, 200 OK:

```
{
  "address": "info@example.com",
  "changed": true
}
```

## Errors

- 400: --address is required
- 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 boolean
- 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 password: 8 to 128 printable characters
- 400: Invalid port
- 400: Invalid setting key
- 400: Nothing to change
- 401: Invalid credentials
- 403: Logins are suspended for this account
- 404: No such mail account: <address>
- 404: Setting '<key>' not found
