v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
Email
Email Forwarding

Create email account forwarder

This function creates an email forwarder.

Important:

When you disable the MailReceive role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

get/Email/add_forwarder

Query parameters

domainstring required
Example:example.com

The domain.

emailstring required
Example:forwardme@example.com

The email address to forward.

fwdoptstring required
Example:fwd

The method to use to handle the email address's mail.

failmsgsstring
Example:Nobody home.

The failure message for the message's sender.

Note:

Use this parameter if you used the fail method for the fwdopt parameter.

fwdemailstring
Example:fwdtome@example.com

The email address to which the system forwards messages.

Note:

You must use this parameter if you used the fwd method for the fwdopt parameter. You can pass multiple addresses to this parameter as a comma-separated list.

fwdsystemstring
Example:user

The system user to whom the system forwards messages.

Note:

You must use this parameter if you used the system method for the fwdopt parameter.

pipefwdstring
Example:mailscript.pl

The application to which the system pipes messages.

Note:

You must use this parameter if you used the pipe method for the fwdopt parameter.

Important:

This parameter requires the FileStorage role. For more information, read our How to Use Server Profiles documentation.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "add_forwarder",
  "module": "Email",
  "result": {
    "data": [
      {
        "domain": "example.com",
        "email": "user@example.com",
        "forward": "fwdtome@example.com"
      }
    ],
    "metadata": {
      "transformed": 1
    },
    "status": 1
  }
}