# POST /domains/{name}/aliases

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

UrbeStack release 0.2.35 API operation in the domains group.

Add an alias to a domain

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

Apache serves the domain name and the alias from the same document root. UrbeStack updates DNS and mail configuration and returns the updated aliases list. The alias must be unique among domains and aliases on this server.

Only administrators can add reserved aliases, the server's own names, names above or below the server's own names, or names in the server's own DNS zones. The same restriction applies to aliases above or below another account's domain or alias, names whose zones this server holds for DNS clients, and names that overlap another server's zone in the DNS distribution network. When mail.unpointed_domains is set to refuse, the alias must already point to this server unless the caller is an administrator.

An unknown domain returns 404. Access to an existing domain is limited to administrators, the domain owner and the owner's reseller. Other callers receive 403.

## As a command

- [urbestack-domain-alias-add](https://urbestack.com/docs/commands/urbestack-domain-alias-add.md): Adds an alias to an existing domain so Apache serves both names from the same document root.

## Parameters

- `name` (path, DomainName, required)

## Request body

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

- `name` (DomainName, required): A domain name is case-insensitive and stored in lowercase.

## 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/aliases" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "example.com"
  }'
```

Response, 201 Created:

```
{
  "aliases": [
    {
      "created_at": "2026-09-09T10:15:00Z",
      "id": 1,
      "name": "alice"
    }
  ]
}
```

## Errors

- 400: Domain name required
- 400: Domain name too long
- 400: Invalid IPv4 address
- 400: Invalid IPv6 address
- 400: Invalid domain name
- 400: Invalid port
- 400: Invalid setting key
- 401: Authentication required
- 403: Insufficient privileges
- 404: Domain '<name>' not found
- 404: Setting '<key>' not found
- 409: '<alias>' is already a domain here
- 409: '<alias>' is already an alias
