# PATCH /domains/{name}/mail/accounts/{local}

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

UrbeStack release 0.2.35 API operation in the mail group.

Update a mailbox or end its sessions

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

Supply at least one setting to change or set end_sessions to true. The API returns 400 if the request contains no change and 404 if the mailbox does not exist on the domain. Set password to change the mailbox password. Set end_sessions to true to close all open IMAP and POP3 sessions immediately and revoke webmail sign-in tickets. You can do this on its own or when changing the password.

Set quota_mb to a whole number from 0 to 1048576 megabytes. Use 0 for unlimited storage. Only administrators can set hourly_limit. It takes a whole number from 0 to 1000000 messages per hour. Use 0 for no mailbox-level sending limit, or send an empty string or null to restore the domain's default.

Set login to false to block IMAP and POP3 sign-in and authenticated sending while incoming mail continues to arrive. Set outgoing to false to block sending while users can still read mail. used_by_person defaults to true and indicates that a person uses the mailbox in their own mail client. Set it to false for a mailbox used only by bots. This setting determines the defaults for new bot keys.

Supply an autoresponder object to set it, or send null to remove it. subject must contain 1 to 200 characters without ASCII control characters. body must contain 1 to 10000 characters without NUL characters. Supply start, end or both in YYYY-MM-DD format. When both are set, end must be on or after start. interval_days takes a whole number from 1 to 30 and defaults to 1. The autoresponder replies from the mailbox's email address at most once per sender per interval and skips mailing lists and bounces.

The 200 response contains the updated mailbox in account. Administrators, the domain's owner and the owner's reseller can call this operation with a token that has the mail scope.

## As commands

- [urbestack-mail-account-set](https://urbestack.com/docs/commands/urbestack-mail-account-set.md): Updates a mail account.
- [urbestack-mail-autoresponder-set](https://urbestack.com/docs/commands/urbestack-mail-autoresponder-set.md): Sets or removes a mailbox's autoresponder.

## Parameters

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

## Request body

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

- `autoresponder` (MailAutoresponder or null): Autoresponder settings. Set to null to remove the autoresponder.
  - `body` (string, up to 10000 characters, required)
  - `subject` (string, up to 200 characters, required)
  - `end` (string, matching ^\d{4}-\d{2}-\d{2}$ or null)
  - `interval_days` (integer, 1 to 30)
  - `start` (string, matching ^\d{4}-\d{2}-\d{2}$ or null)
- `end_sessions` (boolean): Whether to immediately end every open IMAP and POP3 session for the mailbox. Set to true when changing the password to disconnect anyone already signed in.
- `hourly_limit` (integer, 0 to 1000000 or null): Hourly sending limit for the mailbox, or null for the domain default. Only administrators can set this field, and requests from customers or resellers return 403.
- `login` (boolean): Whether the mailbox accepts sign-ins. Set to false to suspend sign-ins while continuing to receive mail.
- `outgoing` (boolean): Whether the account can send mail. Set to false to reject its outgoing mail.
- `password` (string, up to 128 characters)
- `quota_mb` (integer, 0 to 1048576)
- `used_by_person` (boolean): Whether a person also uses the mailbox through their own mail client. BotMail uses this setting to determine the initial configuration of new bot keys.

## 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 PATCH "$API/domains/example.com/mail/accounts/info" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "autoresponder": {
      "body": "text",
      "end": "text",
      "interval_days": 1,
      "start": "text",
      "subject": "text"
    },
    "end_sessions": true,
    "hourly_limit": 1,
    "login": true,
    "outgoing": true,
    "password": "Sup3r-Secret-Passphrase",
    "quota_mb": 1,
    "used_by_person": true
  }'
```

Response, 200 OK:

```
{
  "account": {
    "address": "info@example.com",
    "autoresponder": {
      "body": "text",
      "end": "text",
      "interval_days": 1,
      "start": "text",
      "subject": "text"
    },
    "created_at": "2026-09-09T10:15:00Z",
    "domain": "example.com",
    "home": "text",
    "hourly_limit": 1,
    "id": 1,
    "local_part": "text",
    "login_suspended": 1,
    "outgoing_suspended": 1,
    "quota_mb": 1,
    "updated_at": "text",
    "usage": {
      "messages": 1,
      "storage_kb": 1,
      "storage_limit_kb": 1
    }
  }
}
```

## Errors

- 400: --address is required
- 400: --subject and --body-file are required
- 400: <what> must be a whole number from 0 to <max>
- 400: <what> must be text without control characters, 1 to <max> characters
- 400: An autoresponder needs a body of up to 10000 characters
- 400: An autoresponder needs a subject of up to 200 characters
- 400: Cannot read <file>: $!
- 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: 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
- 400: The <what> date is YYYY-MM-DD
- 400: The body file is an absolute path, or - for standard input
- 400: The end date is before the start date
- 400: The interval is a number of days from 1 to 30
- 401: Authentication required
- 404: No such mail account: <address>
- 404: Setting '<key>' not found
