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

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

UrbeStack release 0.2.35 API operation in the mail group.

Add an entry to the domain's allow, block or nogreylist list

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

For allow and block, entry can be an email address such as someone@example.net, a domain such as example.net, or a wildcard domain such as *.example.net. Wildcards match subdomains at any depth. Both lists match envelope and header senders. For mail to the recipient domain, block rejects matching senders during SMTP and allow exempts matching senders from spam scoring. Block takes precedence.

Allowing a major provider's entire domain also exempts forged senders from that domain from spam scoring. UrbeStack already trusts those providers when DKIM or DMARC verification succeeds.

For nogreylist, entry must be a plain or wildcard domain. Matching mail skips greylisting when SPF passes for the envelope sender or a DKIM signature from the sender domain verifies. Spam scoring still applies.

Each domain list holds up to 2000 entries. The request fails if the entry is already on the selected list or the list is full. An invalid kind returns 400. The 201 response contains the created entry in entry, with id, kind, entry, created_at and domain.

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

## As a command

- [urbestack-mail-list-add](https://urbestack.com/docs/commands/urbestack-mail-list-add.md): Adds entries to a domain's mail sender list or, with --server, to a server-wide list.

## Parameters

- `name` (path, DomainName, required)

## Request body

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

- `entry` (string, up to 320 characters, required): An email address, a domain, or *.domain to match every subdomain of that domain. With nogreylist, a sender domain with or without the wildcard matches only mail verified for that domain by SPF or DKIM, and the server-wide list also accepts a sending server IP address or network.
- `kind` (string, one of allow, block, nogreylist, required): Use allow to bypass greylisting and spam scoring, block to refuse mail from the sender, or nogreylist to bypass greylisting while retaining spam scoring.

## 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/lists" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "entry": "text",
    "kind": "allow"
  }'
```

Response, 201 Created:

```
{
  "entry": {
    "created_at": "2026-09-09T10:15:00Z",
    "domain": "example.com",
    "entry": "text",
    "id": 1,
    "kind": "profile"
  }
}
```

## Errors

- 400: <what> must be text without control characters, 1 to <max> characters
- 400: At most <LIST_LINES_MAX> lines at once; this one has 
- 400: Domain name required
- 400: Domain name too long
- 400: Give --allow ENTRY, --block ENTRY or --nogreylist ENTRY, one of them
- 400: Give --domain DOMAIN or --server
- 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
- 400: List type must be allow, block, or nogreylist.
- 400: That list holds at most <max> entries
- 400: With --stdin, specify --kind allow, block, or nogreylist, and omit the entry argument.
- 401: Authentication required
- 404: Setting '<key>' not found
- 409: <entry> is already on that <kind> list
