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

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

UrbeStack release 0.2.35 API operation in the mail group.

Create a mailbox on the domain

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

Supply the email address's local part in local and the mailbox password in password. The email address must be unused by any other mailbox, and the customer's package must allow another mailbox. UrbeStack creates the mailbox's Maildir in the customer's home.

Set quota_mb to a whole number from 0 to 1048576 megabytes. It defaults to 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. Omit hourly_limit or send an empty string or null to use the domain's default. Invalid quota_mb or hourly_limit values return 400.

The 201 response contains the new 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 a command

- [urbestack-mail-account-add](https://urbestack.com/docs/commands/urbestack-mail-account-add.md): Creates a mail account on a hosted domain and creates its Maildir in the customer's home.

## Parameters

- `name` (path, DomainName, required)

## Request body

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

- `local` (LocalPart, required): The part of an email address before the @ is stored in lowercase.
- `password` (string, up to 128 characters, required)
- `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.
- `quota_mb` (integer, 0 to 1048576): Mailbox quota in megabytes, or 0 for no limit.

## 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" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "hourly_limit": 1,
    "local": "info",
    "password": "Sup3r-Secret-Passphrase",
    "quota_mb": 1
  }'
```

Response, 201 Created:

```
{
  "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: <what> must be a whole number from 0 to <max>
- 400: <what> must be text without control characters, 1 to <max> characters
- 400: A password is required: --password-stdin or --password-hash
- 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: 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
- 401: Authentication required
- 404: Setting '<key>' not found
- 409: Mail account <local>\@<domain_name> already exists
- 409: The package <p.name> allows <limit> 
