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

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

UrbeStack release 0.2.35 API operation in the mail group.

Replace a forwarder's destinations

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

Supply the complete replacement list as an array of 1 to 20 destination email addresses in destinations. Duplicate entries count toward the limit and are stored once. Each destination must differ from the forwarder's own email address.

The forwarder must already exist. The API returns 400 if destinations is missing or has the wrong type or length. The 200 response contains the updated forwarder in forwarder.

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-forwarder-set](https://urbestack.com/docs/commands/urbestack-mail-forwarder-set.md): Replaces the entire destination list of an existing forwarder.

## Parameters

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

## Request body

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

- `destinations` (array of MailAddress, required)

## 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/forwarders/info" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "destinations": [
      "text"
    ]
  }'
```

Response, 200 OK:

```
{
  "forwarder": {
    "address": "info@example.com",
    "created_at": "2026-09-09T10:15:00Z",
    "destinations": [
      "text"
    ],
    "domain": "example.com",
    "id": 1,
    "local_part": "text"
  }
}
```

## Errors

- 400: --address is required
- 400: <what> must be text without control characters, 1 to <max> characters
- 400: A forwarder needs one to twenty destination addresses
- 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
- 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
- 401: Authentication required
- 404: No such forwarder: <address>
- 404: Setting '<key>' not found
