# Vacation replies

The reply people get while you are away.

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

## vacation.list

Show the vacation reply on each of your mailboxes.

`POST /v1/vacation.list`

Any signed-in person, with an API token.

### Parameters

It takes no input: send an empty object.

### Returns

`data` is a list of objects, each with:

- `mailbox` (string)
- `on` (boolean)
- `subject` (string)
- `text` (string)
- `startsAt` (nullable number)
- `endsAt` (nullable number)
- `state` (enum): One of `off`, `scheduled`, `ended`, `held`, `active`.
- `note` (nullable string): Why it isn’t replying right now, in words.

### Request

TypeScript:

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

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

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

Python:

```python
from mailset import Mailset

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

answer = mailset.vacation.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.Vacation.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.vacation.list
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

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

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

Java:

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

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

List<Vacation> answer = mailset.vacation().list();
System.out.println(answer);
```

Rust:

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

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

curl:

```bash
curl https://mailset.app/v1/vacation.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 vacation list
```

### Response

```json
{
  "ok": true,
  "data": [
    {
      "mailbox": "text",
      "on": true,
      "subject": "Your Acme receipt",
      "text": "text",
      "startsAt": 1796048940000,
      "endsAt": 1796048940000,
      "state": "off",
      "note": "text"
    }
  ]
}
```

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

## vacation.set

Set a mailbox’s vacation reply.

`POST /v1/vacation.set`

Any signed-in person, with an API token.

### Parameters

- `mailbox` (string, required): The mailbox’s address.
- `on` (boolean, optional): Turn the reply on or off.
- `subject` (string, optional): The reply’s subject. At most 200 characters.
- `text` (string, optional): The reply’s text. At most 20,000 characters.
- `startsAt` (nullable integer or string, optional): When it starts replying: ms since the epoch, or an ISO date and time with its offset (`2026-12-07T09:00:00Z`). Null clears it.
- `endsAt` (nullable integer or string, optional): When it stops: ms since the epoch, or an ISO date and time with its offset (`2026-12-07T09:00:00Z`). Null clears it.

### Returns

`data` is an object with:

- `mailbox` (string)
- `on` (boolean)
- `subject` (string)
- `text` (string)
- `startsAt` (nullable number)
- `endsAt` (nullable number)
- `state` (enum): One of `off`, `scheduled`, `ended`, `held`, `active`.
- `note` (nullable string): Why it isn’t replying right now, in words.

### Request

TypeScript:

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

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

const answer = await mailset.vacation.set({
	on: true,
	subject: "Away until Monday",
	text: "I am away and will answer on Monday.",
	endsAt: "2026-12-07T09:00:00Z",
	mailbox: "ana@example.com",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

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

answer = mailset.vacation.set(
    {
        "on": True,
        "subject": "Away until Monday",
        "text": "I am away and will answer on Monday.",
        "ends_at": "2026-12-07T09:00:00Z",
        "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.VacationSetParams{
		On:      mailset.Bool(true),
		Subject: mailset.String("Away until Monday"),
		Text: mailset.String("I am away and will answer " +
			"on Monday."),
		EndsAt:  "2026-12-07T09:00:00Z",
		Mailbox: "ana@example.com",
	}
	answer, err := client.Vacation.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.vacation.set(
  on: true,
  subject: 'Away until Monday',
  text: 'I am away and will answer on Monday.',
  ends_at: '2026-12-07T09:00:00Z',
  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->vacation->set([
    'on' => true,
    'subject' => 'Away until Monday',
    'text' => 'I am away and will answer on Monday.',
    'endsAt' => '2026-12-07T09:00:00Z',
    'mailbox' => 'ana@example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.Vacation;
import app.mailset.model.VacationSetParams;
import java.time.Instant;

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

var params = VacationSetParams.builder()
        .on(true)
        .subject("Away until Monday")
        .text("I am away and will answer on Monday.")
        .endsAt(Instant.parse("2026-12-07T09:00:00Z"))
        .mailbox("ana@example.com")
        .build();
Vacation answer = mailset.vacation().set(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::VacationSetParams;

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

let answer = mailset
    .vacation()
    .set(VacationSetParams {
        mailbox: "ana@example.com".into(),
        on: Some(true),
        subject: Some("Away until Monday".into()),
        text: Some(
            "I am away and will answer on Monday.".into(),
        ),
        ends_at: Some(Some(
            "2026-12-07T09:00:00Z".into(),
        )),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/vacation.set \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"on":true,"subject":"Away until Monday","text":"I am away and will answer on Monday.","endsAt":"2026-12-07T09:00:00Z","mailbox":"ana@example.com"}}'
```

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 vacation set ana@example.com --on --subject "Away until Monday" --text "I am away and will answer on Monday." --ends-at 2026-12-07T09:00:00Z
```

### Response

```json
{
  "ok": true,
  "data": {
    "mailbox": "text",
    "on": true,
    "subject": "Your Acme receipt",
    "text": "text",
    "startsAt": 1796048940000,
    "endsAt": 1796048940000,
    "state": "off",
    "note": "text"
  }
}
```

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

---

© 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