# Delegates

Let a teammate read and send from your mailbox.

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).

## delegates.list

Show who can use a mailbox you hold.

`POST /v1/delegates.list`

Anyone in 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:

- `mailbox` (string)
- `owners` (array of strings)
- `delegates` (array of strings)
- `deactivated` (array of strings): Delegates or owners who are deactivated, kept so you can see them.
- `canChange` (boolean): You hold this mailbox, so you can change who else does.

### Request

TypeScript:

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

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

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

Python:

```python
from mailset import Mailset

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

answer = mailset.delegates.list(
    {"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.DelegatesListParams{
		Mailbox: "ana@example.com",
	}
	answer, err := client.Delegates.List(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.delegates.list(
  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->delegates->list([
    'mailbox' => 'ana@example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.Delegates;
import app.mailset.model.DelegatesListParams;

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

var params = DelegatesListParams.builder()
        .mailbox("ana@example.com")
        .build();
Delegates answer = mailset.delegates().list(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::DelegatesListParams;

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

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

curl:

```bash
curl https://mailset.app/v1/delegates.list \
  -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 delegates list ana@example.com
```

### Response

```json
{
  "ok": true,
  "data": {
    "mailbox": "text",
    "owners": [
      "text"
    ],
    "delegates": [
      "text"
    ],
    "deactivated": [
      "text"
    ],
    "canChange": true
  }
}
```

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

## delegates.add

Let someone in the org read and send from your mailbox.

`POST /v1/delegates.add`

Anyone in the org. It can stop for a passkey approval.

### Parameters

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

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 an object with:

- `mailbox` (string)
- `owners` (array of strings)
- `delegates` (array of strings)
- `deactivated` (array of strings): Delegates or owners who are deactivated, kept so you can see them.
- `canChange` (boolean): You hold this mailbox, so you can change who else does.

### Request

TypeScript:

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

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

const answer = await mailset.delegates.add({
	member: "ben@example.com",
	mailbox: "ana@example.com",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

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

answer = mailset.delegates.add(
    {
        "member": "ben@example.com",
        "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.DelegatesAddParams{
		Member:  "ben@example.com",
		Mailbox: "ana@example.com",
	}
	answer, err := client.Delegates.Add(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.delegates.add(
  member: 'ben@example.com',
  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->delegates->add([
    'member' => 'ben@example.com',
    'mailbox' => 'ana@example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.Delegates;
import app.mailset.model.DelegatesAddParams;

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

var params = DelegatesAddParams.builder()
        .member("ben@example.com")
        .mailbox("ana@example.com")
        .build();
Delegates answer = mailset.delegates().add(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::DelegatesAddParams;

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

let answer = mailset
    .delegates()
    .add(DelegatesAddParams {
        mailbox: "ana@example.com".into(),
        member: "ben@example.com".into(),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/delegates.add \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"member":"ben@example.com","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 delegates add ana@example.com --member ben@example.com
```

### Response

```json
{
  "ok": true,
  "data": {
    "mailbox": "text",
    "owners": [
      "text"
    ],
    "delegates": [
      "text"
    ],
    "deactivated": [
      "text"
    ],
    "canChange": true
  }
}
```

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

## delegates.remove

Stop someone using your mailbox.

`POST /v1/delegates.remove`

Anyone in the org.

### Parameters

- `mailbox` (string, required): Your mailbox’s address.
- `member` (string, required): The member’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.delegates.remove({
	member: "ben@example.com",
	mailbox: "ana@example.com",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

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

answer = mailset.delegates.remove(
    {
        "member": "ben@example.com",
        "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.DelegatesRemoveParams{
		Member:  "ben@example.com",
		Mailbox: "ana@example.com",
	}
	answer, err := client.Delegates.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.delegates.remove(
  member: 'ben@example.com',
  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->delegates->remove([
    'member' => 'ben@example.com',
    'mailbox' => 'ana@example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.DelegatesRemoveParams;
import app.mailset.model.DelegatesRemoveResult;

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

var params = DelegatesRemoveParams.builder()
        .member("ben@example.com")
        .mailbox("ana@example.com")
        .build();
DelegatesRemoveResult answer =
        mailset.delegates().remove(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::DelegatesRemoveParams;

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

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

curl:

```bash
curl https://mailset.app/v1/delegates.remove \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"member":"ben@example.com","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 delegates remove ana@example.com --member ben@example.com
```

### Response

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

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

---

© 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