API

EmailForward

A forwarding address in the deprecated Email API, per domain: list, create, update or delete one.

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /email/forwards/{domain} create Created
GET /email/forwards/{domain} list OK
DELETE /email/forwards/{domain}/{source} remove Accepted
PUT /email/forwards/{domain}/{source} update Accepted

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

email_forwards, err := client.EmailForward(nil).List(map[string]any{"domain": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(email_forwards)
created, err := client.EmailForward(nil).Create(map[string]any{"domain": "example", "destinations": []any{}, "source": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)
updated, err := client.EmailForward(nil).Update(map[string]any{"domain": "example", "source": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(updated)
removed, err := client.EmailForward(nil).Remove(map[string]any{"domain": "example", "source": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(removed)

Lua

Construct client as shown in the Lua setup, then call the operations:

local email_forwards, err = client:EmailForward():list({ domain = "example" })
local created, err = client:EmailForward():create({ domain = "example", destinations = {}, source = "example" })
local updated, err = client:EmailForward():update({ domain = "example", source = "example" })
local removed, err = client:EmailForward():remove({ domain = "example", source = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$email_forwards = $client->EmailForward()->list(["domain" => "example"]);
$created = $client->EmailForward()->create(["domain" => "example", "destinations" => [], "source" => "example"]);
$updated = $client->EmailForward()->update(["domain" => "example", "source" => "example"]);
$client->EmailForward()->remove(["domain" => "example", "source" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

email_forwards = client.EmailForward().list({"domain": "example"})
created = client.EmailForward().create({ "domain": "example", "destinations": [], "source": "example" })
updated = client.EmailForward().update({"domain": "example", "source": "example"})
client.EmailForward().remove({"domain": "example", "source": "example"})

Ruby

Construct client as shown in the Ruby setup, then call the operations:

email_forwards = client.EmailForward.list({ "domain" => "example" })
created = client.EmailForward.create({ "domain" => "example", "destinations" => [], "source" => "example" })
updated = client.EmailForward.update({ "domain" => "example", "source" => "example" })
client.EmailForward.remove({ "domain" => "example", "source" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const email_forwards = await client.EmailForward().list({ domain: "example" })
const created = await client.EmailForward().create({ domain: "example", destinations: [], source: "example" })
const updated = await client.EmailForward().update({ domain: "example", source: "example" })
await client.EmailForward().remove({ domain: "example", source: "example" })

Fields

Field Type Required Description
destinations array Yes Destinations
href string Yes Href
id string No Id
message string Yes Message
source string Yes Source

create

POST /email/forwards/{domain}

Operation ID: postEmailForwardsDomain.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
domain path string Yes

Request body

application/json

Property Type Required Description
destinations array of string Yes
source string Yes

Responses

201: Created

application/json

Property Type Required Description
message string Yes
401: Unauthorized

application/json

Property Type Required Description
cause string Yes
code integer Yes
message string Yes
object string Yes
403: Forbidden

application/json

Property Type Required Description
cause string Yes
code integer Yes
message string Yes
object string Yes

list

GET /email/forwards/{domain}

Operation ID: getEmailForwardsDomain.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
domain path string Yes
destination query string No
page query integer No
per_page query integer No
sort_by query enum: source, -source, destination, -destination No
source query string No

Responses

200: OK

application/json

Property Type Required Description
[].destinations array of string Yes
[].href string Yes
[].source string Yes
401: Unauthorized

application/json

Property Type Required Description
cause string Yes
code integer Yes
message string Yes
object string Yes
403: Forbidden

application/json

Property Type Required Description
cause string Yes
code integer Yes
message string Yes
object string Yes

remove

DELETE /email/forwards/{domain}/{source}

Operation ID: deleteEmailForwardsDomainSource.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
domain path string Yes
source path string Yes

Responses

202: Accepted

application/json

Property Type Required Description
message string Yes
401: Unauthorized

application/json

Property Type Required Description
cause string Yes
code integer Yes
message string Yes
object string Yes
403: Forbidden

application/json

Property Type Required Description
cause string Yes
code integer Yes
message string Yes
object string Yes

update

PUT /email/forwards/{domain}/{source}

Operation ID: putEmailForwardsDomainSource.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
domain path string Yes
source path string Yes

Request body

application/json

Property Type Required Description
destinations array of string Yes

Responses

202: Accepted

application/json

Property Type Required Description
message string Yes
401: Unauthorized

application/json

Property Type Required Description
cause string Yes
code integer Yes
message string Yes
object string Yes
403: Forbidden

application/json

Property Type Required Description
cause string Yes
code integer Yes
message string Yes
object string Yes