Vacation replies

Vacation replies

The reply people get while you are away.

An SDK signs every request with your key: Authentication. To sign one yourself, see Calling the API without an SDK.

On this page
  1. vacation.list
  2. vacation.set

vacation.list

Show the vacation reply on each of your mailboxes.

POST/v1/vacation.list

API token

Parameters

It takes no input: send an empty object.

Returns

data is a list of objects, each with:

  • mailboxstring
  • onboolean
  • subjectstring
  • textstring
  • startsAtnullable number
  • endsAtnullable number
  • stateenum

    One ofoffscheduledendedheldactive

  • notenullable string

    Why it isn’t replying right now, in words.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.vacation.list();
console.log(answer);
from mailset import Mailset

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

answer = mailset.vacation.list()
print(answer)
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)
}
require 'mailset'

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

answer = mailset.vacation.list
p answer
<?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;
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);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.vacation().list().await?;
println!("{answer:?}");
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 shows how.

mailset vacation list
Response
{
  "ok": true,
  "data": [
    {
      "mailbox": "text",
      "on": true,
      "subject": "Your Acme receipt",
      "text": "text",
      "startsAt": 1796048940000,
      "endsAt": 1796048940000,
      "state": "off",
      "note": "text"
    }
  ]
}

vacation.set

Set a mailbox’s vacation reply.

POST/v1/vacation.set

API token

Parameters

  • mailboxstringrequired

    The mailbox’s address.

  • onbooleanoptional

    Turn the reply on or off.

  • subjectstringoptional

    The reply’s subject.

    At most 200 characters.

  • textstringoptional

    The reply’s text.

    At most 20,000 characters.

  • startsAtnullable integer or stringoptional

    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.

  • endsAtnullable integer or stringoptional

    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:

  • mailboxstring
  • onboolean
  • subjectstring
  • textstring
  • startsAtnullable number
  • endsAtnullable number
  • stateenum

    One ofoffscheduledendedheldactive

  • notenullable string

    Why it isn’t replying right now, in words.

In the CLIErrors

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: "moc.elpmaxe@ana",
});
console.log(answer);
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": "moc.elpmaxe@ana",
    }
)
print(answer)
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{
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: 'moc.elpmaxe@ana'
)
p answer
<?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' => 'moc.elpmaxe@ana',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
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("moc.elpmaxe@ana")
        .build();
Vacation answer = mailset.vacation().set(params);
System.out.println(answer);
use mailset::types::VacationSetParams;

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

let answer = mailset
    .vacation()
    .set(VacationSetParams {
        mailbox: "moc.elpmaxe@ana".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 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":"moc.elpmaxe@ana"}}'

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 shows how.

mailset vacation set moc.elpmaxe@ana --on --subject "Away until Monday" --text "I am away and will answer on Monday." --ends-at 2026-12-07T09:00:00Z
Response
{
  "ok": true,
  "data": {
    "mailbox": "text",
    "on": true,
    "subject": "Your Acme receipt",
    "text": "text",
    "startsAt": 1796048940000,
    "endsAt": 1796048940000,
    "state": "off",
    "note": "text"
  }
}