Get your free beta license ↗
API operation · mail group
POST

/domains/{name}/mail/forwarders

First published 3 Oct 20260.1.0Unchanged since publication

Create a forwarder

Who may call it
AdministratorResellerCustomer
Token scope, any of
mailall
Answers201 Created

Supply the source email address's local part in local and 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. If a mailbox exists at that email address, it keeps a copy of each forwarded message.

The API returns 400 if destinations is missing or has the wrong type or length. If a forwarder already exists for the email address, use PATCH /domains/{name}/mail/forwarders/{local} to replace its destinations. The 201 response contains the new 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

Run as root on the server

Parameters

namepath ·DomainNameRequired

Request body

JSON ·MailForwarderCreate· 2 fields
destinationsarray of MailAddressRequired
localLocalPartRequired
The part of an email address before the @ is stored in lowercase.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X POST "$API/domains/example.com/mail/forwarders" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "destinations": [
      "text"
    ],
    "local": "info"
  }'
Response · 201 Created
{
  "forwarder": {
    "address": "info@example.com",
    "created_at": "2026-09-09T10:15:00Z",
    "destinations": [
      "text"
    ],
    "domain": "example.com",
    "id": 1,
    "local_part": "text"
  }
}

Errors

17 errors, each a status and a sentence
400--address is required
400<what> must be text without control characters, 1 to <max> characters
400A forwarder needs one to twenty destination addresses
400Domain name required
400Domain name too long
400Invalid IPv4 address
400Invalid IPv6 address
400Invalid domain name
400Invalid mail address
400Invalid mail address: local part over 64 characters
400Invalid mail address: no local part
400Invalid mail address: the local part may hold letters, digits, dots, _ + and -
400Invalid port
400Invalid setting key
401Authentication required
404Setting '<key>' not found
409Forwarder <address> already exists
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/post-domains-name-mail-forwarders/