# Forwarding

Send a mailbox’s new email on to another address.

An SDK signs every request with your key: [Authentication](https://mailset.app/docs/authentication.md). To sign one yourself, see [Calling the API without an SDK](https://mailset.app/docs/authentication/http.md).

## The Forward object

Where a mailbox’s email is forwarded, and how that stands.

### Attributes

- `mailbox` (string)
- `destination` (nullable string)
- `state` (enum): One of `none`, `pending`, `active`, `failing`, `held`, `blocked`.
- `note` (nullable string): What this state means for this mailbox, in words.
- `failures` (number): Forwards that failed since one last went through.
- `policy` (enum): `never` wins if anyone in the mailbox, or any org admin or owner, chose it. One of `passkey`, `never`.
- `manageable` (boolean): Admins and owners add and change it. Everyone in the mailbox can read it.
- `route` (boolean): The destination is one of the org’s own inbound routes (a product’s hook).
- `sent` (boolean): What the mailbox sends goes there too. Only a route takes it.

```json
{
  "mailbox": "text",
  "destination": "text",
  "state": "none",
  "note": "text",
  "failures": 1,
  "policy": "passkey",
  "manageable": true,
  "route": true,
  "sent": true
}
```

Answered by [forwarding.list](https://mailset.app/docs/api/forwarding#forwarding.list), [forwarding.set](https://mailset.app/docs/api/forwarding#forwarding.set), [forwarding.resend](https://mailset.app/docs/api/forwarding#forwarding.resend).

## forwarding.list

Show where each of your mailboxes forwards.

`POST /v1/forwarding.list`

Any signed-in person, with an API token.

### Parameters

It takes no input: send an empty object.

### Returns

`data` is a list of [Forward objects](https://mailset.app/docs/api/forwarding#forward).

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.forwarding.list();
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.forwarding.list()
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	answer, err := client.Forwarding.List(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.forwarding.list
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->forwarding->list();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.Forward;
import java.util.List;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

List<Forward> answer = mailset.forwarding().list();
System.out.println(answer);
```

Rust:

```rust
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.forwarding().list().await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/forwarding.list \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset forwarding list
```

### Response

```json
{
  "ok": true,
  "data": [
    {
      "mailbox": "text",
      "destination": "text",
      "state": "none",
      "note": "text",
      "failures": 1,
      "policy": "passkey",
      "manageable": true,
      "route": true,
      "sent": true
    }
  ]
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/forwarding#forwarding-list)

## forwarding.set

Forward a mailbox’s new mail to an outside address, once that address confirms (one of your inbound routes needs no confirming).

`POST /v1/forwarding.set`

An admin or owner of the org. It can stop for a passkey approval.

### Parameters

- `mailbox` (string, required): The mailbox’s address.
- `to` (string, required): Where its new mail goes: an outside address, or one of your inbound routes.
- `sent` (boolean, optional): Also what the mailbox sends. Only for one of your inbound routes. Left out: as it is.

Beside `input`:

- `org` (string, optional): The org this is about. Needed when the caller is in more than one.
- `approval` (string, optional): An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve.

### Returns

`data` is the [Forward object](https://mailset.app/docs/api/forwarding#forward).

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.forwarding.set({
	to: "ana@example.org",
	mailbox: "ana@example.com",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.forwarding.set(
    {
        "to": "ana@example.org",
        "mailbox": "ana@example.com",
    }
)
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.ForwardingSetParams{
		To:      "ana@example.org",
		Mailbox: "ana@example.com",
	}
	answer, err := client.Forwarding.Set(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.forwarding.set(
  to: 'ana@example.org',
  mailbox: 'ana@example.com'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->forwarding->set([
    'to' => 'ana@example.org',
    'mailbox' => 'ana@example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.Forward;
import app.mailset.model.ForwardingSetParams;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = ForwardingSetParams.builder()
        .to("ana@example.org")
        .mailbox("ana@example.com")
        .build();
Forward answer = mailset.forwarding().set(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::ForwardingSetParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .forwarding()
    .set(ForwardingSetParams {
        mailbox: "ana@example.com".into(),
        to: "ana@example.org".into(),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/forwarding.set \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"to":"ana@example.org","mailbox":"ana@example.com"},"org":"org_3f9a1c0e7b2d"}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset forwarding set ana@example.com --to ana@example.org
```

### Response

```json
{
  "ok": true,
  "data": {
    "mailbox": "text",
    "destination": "text",
    "state": "none",
    "note": "text",
    "failures": 1,
    "policy": "passkey",
    "manageable": true,
    "route": true,
    "sent": true
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/forwarding#forwarding-set)

## forwarding.remove

Stop forwarding a mailbox.

`POST /v1/forwarding.remove`

An admin or owner of the org.

### Parameters

- `mailbox` (string, required): The mailbox’s address.

Beside `input`:

- `org` (string, optional): The org this is about. Needed when the caller is in more than one.

### Returns

`data` is an object with:

- `removed` (boolean)

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.forwarding.remove({
	mailbox: "ana@example.com",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.forwarding.remove(
    {"mailbox": "ana@example.com"}
)
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.ForwardingRemoveParams{
		Mailbox: "ana@example.com",
	}
	answer, err := client.Forwarding.Remove(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.forwarding.remove(
  mailbox: 'ana@example.com'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->forwarding->remove([
    'mailbox' => 'ana@example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.ForwardingRemoveParams;
import app.mailset.model.ForwardingRemoveResult;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = ForwardingRemoveParams.builder()
        .mailbox("ana@example.com")
        .build();
ForwardingRemoveResult answer =
        mailset.forwarding().remove(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::ForwardingRemoveParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .forwarding()
    .remove(ForwardingRemoveParams {
        mailbox: "ana@example.com".into(),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/forwarding.remove \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"mailbox":"ana@example.com"},"org":"org_3f9a1c0e7b2d"}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset forwarding remove ana@example.com
```

### Response

```json
{
  "ok": true,
  "data": {
    "removed": true
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/forwarding#forwarding-remove)

## forwarding.resend

Send the confirmation link to the destination again.

`POST /v1/forwarding.resend`

An admin or owner of the org.

### Parameters

- `mailbox` (string, required): The mailbox’s address.

Beside `input`:

- `org` (string, optional): The org this is about. Needed when the caller is in more than one.

### Returns

`data` is the [Forward object](https://mailset.app/docs/api/forwarding#forward).

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.forwarding.resend({
	mailbox: "ana@example.com",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.forwarding.resend(
    {"mailbox": "ana@example.com"}
)
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.ForwardingResendParams{
		Mailbox: "ana@example.com",
	}
	answer, err := client.Forwarding.Resend(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.forwarding.resend(
  mailbox: 'ana@example.com'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->forwarding->resend([
    'mailbox' => 'ana@example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.Forward;
import app.mailset.model.ForwardingResendParams;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = ForwardingResendParams.builder()
        .mailbox("ana@example.com")
        .build();
Forward answer = mailset.forwarding().resend(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::ForwardingResendParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .forwarding()
    .resend(ForwardingResendParams {
        mailbox: "ana@example.com".into(),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/forwarding.resend \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"mailbox":"ana@example.com"},"org":"org_3f9a1c0e7b2d"}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset forwarding resend ana@example.com
```

### Response

```json
{
  "ok": true,
  "data": {
    "mailbox": "text",
    "destination": "text",
    "state": "none",
    "note": "text",
    "failures": 1,
    "policy": "passkey",
    "manageable": true,
    "route": true,
    "sent": true
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/forwarding#forwarding-resend)

---

© 2026 Intenseloop, Inc. Mailset’s site, docs and guides are copyrighted. You may read them and use their code to build with Mailset. Don’t republish them or use them to build a copy of Mailset. Terms: https://mailset.app/terms#content