Create and manage email forwarding for your domain

Set up email forwarding, where emails sent to an address on your domain are automatically forwarded to another specified address. The endpoint returns a unique rule ID that you can then use to delete or manage the forwarding later via DELETE /api/email-forwarding.

Domain Services Email

Context

Workflow links

Produces

Headers

Accept Example
Content-Type Example

Body

required
application/json
destination string required · Example: [email protected]
domain string required · Example: example.com
email string required · Example: [email protected]

Responses

200
data object required
data.destinationVerified boolean required · Example: false
data.message string required · Example: Email forwarding rule created. Verification email sent to destination address.

Human-readable message.

data.rule object required
data.rule.destination string required · Example: [email protected]
data.rule.email string required · Example: [email protected]
data.rule.enabled boolean required · Example: true
data.rule.id string required · Example: a11bd9c750744434b30d1c7ed940fa72
data.rule.name string required · Example: Forward [email protected]
data.rule.priority integer required · Example: 0
data.rule.tag string required · Example: a11bd9c750744434b30d1c7ed940fa72
data.verificationSent boolean required · Example: true
requestId string required · Example: 2121ae20-bd9d-41e9-aeeb-5dd1dd1a24ba

Unique request identifier (UUID).

success boolean required · Example: true

True for successful responses.

timestamp string required · Example: 2026-02-10T00:00:00.000Z

ISO 8601 timestamp (UTC).

400
code string required · Example: BAD_REQUEST

Machine-readable error code.

error string required · Example: Bad Request

HTTP status title (e.g. 'Bad Request').

message string required · Example: Email must be in format: [email protected]

Human-readable message.

requestId string required · Example: 2121ae20-bd9d-41e9-aeeb-5dd1dd1a24ba

Unique request identifier (UUID).

timestamp string required · Example: 2026-02-10T00:00:00.000Z

ISO 8601 timestamp (UTC).

409
code string required · Example: ERROR

Machine-readable error code.

error string required · Example: Conflict

HTTP status title (e.g. 'Bad Request').

message string required · Example: Cloudflare API error (409): Duplicated Zone rule

Human-readable message.

requestId string required · Example: 2121ae20-bd9d-41e9-aeeb-5dd1dd1a24ba

Unique request identifier (UUID).

timestamp string required · Example: 2026-02-10T00:00:00.000Z

ISO 8601 timestamp (UTC).

POST https://cloud.hostup.se/api/email-forwarding
For AI assistants
cURL
curl -X POST "https://cloud.hostup.se/api/email-forwarding" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "example.com",
    "email": "[email protected]",
    "destination": "[email protected]"
  }'
Response
{
  "success": true,
  "timestamp": "2026-02-10T00:00:00.000Z",
  "requestId": "2121ae20-bd9d-41e9-aeeb-5dd1dd1a24ba",
  "data": {
    "rule": {
      "id": "a11bd9c750744434b30d1c7ed940fa72",
      "email": "[email protected]",
      "destination": "[email protected]",
      "enabled": true,
      "tag": "a11bd9c750744434b30d1c7ed940fa72",
      "name": "Forward [email protected]",
      "priority": 0
    },
    "verificationSent": true,
    "destinationVerified": false,
    "message": "Email forwarding rule created. Verification email sent to destination address."
  }
}
Request Body Example 1
{
  "domain": "example.com",
  "email": "[email protected]",
  "destination": "[email protected]"
}