Get your free beta license ↗
API operation · mail group
POST

/mail/self/password

First published 3 Oct 20260.1.0Unchanged since publication

Change a mailbox's password using its current credentials

Who may call it
Anyone (no token needed)
Token
none
Answers200 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

Run as root on the server

Request body

JSON ·MailPasswordChange· 3 fields
addressstring, up to 320 charactersRequired
Mailbox email address in local@domain form.
new_passwordstring, up to 128 charactersRequired
New mailbox password of 8 to 128 printable characters.
passwordstring, up to 128 charactersRequired
Current mailbox password.

Example

See the API overview for how to set $API and $TOKEN.
Request
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

20 errors, each a status and a sentence
400--address is required
400<what> must be text without control characters, 1 to <max> characters
400Domain name required
400Domain name too long
400Invalid IPv4 address
400Invalid IPv6 address
400Invalid boolean
400Invalid domain name
400Invalid mail address
400Invalid mail address: local part over 64 characters
400Invalid mail address: no local part
400Invalid mail address: the local part may hold letters, digits, dots, _ + and -
400Invalid password: 8 to 128 printable characters
400Invalid port
400Invalid setting key
400Nothing to change
401Invalid credentials
403Logins are suspended for this account
404No such mail account: <address>
404Setting '<key>' not found
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/post-mail-self-password/