# Mailbox pictures

The picture a mailbox shows inside Mailset.

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

## avatars.set

Set a mailbox’s picture from a PNG, JPEG or WebP file.

`POST /v1/avatars.set`

An admin or owner of the org.

### Parameters

- `address` (string, required): The mailbox’s address.
- `name` (string, required): The picture file’s name. At most 255 characters.
- `data` (string, required): The file, base64.

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:

- `address` (string): The mailbox’s address.
- `picture` (string): A short-lived URL for the picture.

### Request

TypeScript:

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

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

const answer = await mailset.avatars.set({
	address: "support@example.com",
	name: "logo.png",
	data: "<the message as base64>",
});
console.log(answer);
```

`<the message as base64>` is a whole email, headers and body: [Send your own MIME](https://mailset.app/docs/recipes/mime).

Python:

```python
from mailset import Mailset

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

answer = mailset.avatars.set(
    {
        "address": "support@example.com",
        "name": "logo.png",
        "data": "<the message as base64>",
    }
)
print(answer)
```

`<the message as base64>` is a whole email, headers and body: [Send your own MIME](https://mailset.app/docs/recipes/mime).

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.AvatarsSetParams{
		Address: "support@example.com",
		Name:    "logo.png",
		Data:    "<the message as base64>",
	}
	answer, err := client.Avatars.Set(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

`<the message as base64>` is a whole email, headers and body: [Send your own MIME](https://mailset.app/docs/recipes/mime).

Ruby:

```ruby
require 'mailset'

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

answer = mailset.avatars.set(
  address: 'support@example.com',
  name: 'logo.png',
  data: '<the message as base64>'
)
p answer
```

`<the message as base64>` is a whole email, headers and body: [Send your own MIME](https://mailset.app/docs/recipes/mime).

PHP:

```php
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->avatars->set([
    'address' => 'support@example.com',
    'name' => 'logo.png',
    'data' => '<the message as base64>',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

`<the message as base64>` is a whole email, headers and body: [Send your own MIME](https://mailset.app/docs/recipes/mime).

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AvatarsSetParams;
import app.mailset.model.AvatarsSetResult;

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

var params = AvatarsSetParams.builder()
        .address("support@example.com")
        .name("logo.png")
        .data("<the message as base64>")
        .build();
AvatarsSetResult answer = mailset.avatars().set(params);
System.out.println(answer);
```

`<the message as base64>` is a whole email, headers and body: [Send your own MIME](https://mailset.app/docs/recipes/mime).

Rust:

```rust
use mailset::types::AvatarsSetParams;

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

let answer = mailset
    .avatars()
    .set(AvatarsSetParams {
        address: "support@example.com".into(),
        name: "logo.png".into(),
        data: "<the message as base64>".into(),
    })
    .await?;
println!("{answer:?}");
```

`<the message as base64>` is a whole email, headers and body: [Send your own MIME](https://mailset.app/docs/recipes/mime).

curl:

```bash
curl https://mailset.app/v1/avatars.set \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"address":"support@example.com","name":"logo.png","data":"<base64 of the file>"},"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 avatars set support@example.com --file logo.png
```

### Response

```json
{
  "ok": true,
  "data": {
    "address": "hello@example.com",
    "picture": "text"
  }
}
```

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

## avatars.remove

Remove a mailbox’s picture.

`POST /v1/avatars.remove`

An admin or owner of the org.

### Parameters

- `address` (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.avatars.remove({
	address: "support@example.com",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

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

answer = mailset.avatars.remove(
    {"address": "support@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.AvatarsRemoveParams{
		Address: "support@example.com",
	}
	answer, err := client.Avatars.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.avatars.remove(
  address: 'support@example.com'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->avatars->remove([
    'address' => 'support@example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AvatarsRemoveParams;
import app.mailset.model.AvatarsRemoveResult;

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

var params = AvatarsRemoveParams.builder()
        .address("support@example.com")
        .build();
AvatarsRemoveResult answer =
        mailset.avatars().remove(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::AvatarsRemoveParams;

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

let answer = mailset
    .avatars()
    .remove(AvatarsRemoveParams {
        address: "support@example.com".into(),
    })
    .await?;
println!("{answer:?}");
```

curl:

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

### Response

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

In the CLI: [mailset reference](https://mailset.app/docs/cli/avatars#avatars-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