Mailboxes

Mailboxes

Create mailboxes, and decide who holds each one.

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

On this page
  1. The Mailbox object
  2. mailboxes.list
  3. mailboxes.add
  4. mailboxes.grant
  5. mailboxes.revoke
  6. mailboxes.all
  7. mailboxes.deletePlan
  8. mailboxes.delete
  9. mailboxes.receiving
  10. mailboxes.resume
  11. mailboxes.reassign
  12. mailboxes.name

The Mailbox object

A mailbox you can open: its address, its kind and its people.

Attributes

  • idstring

    The mailbox’s id.

  • addressstring

    Its address.

  • kindenum

    person for one person’s mailbox, shared for a team’s.

    One ofpersonshared

  • membersarray of strings

    The addresses of the people who can open it.

  • deactivatedarray of stringsoptional

    People who held it and are deactivated. They can’t open it, and aren’t in members.

    Default [].

  • namesmap of stringsoptional

    What to call the people in members and deactivated, by address, for those who have a name.

  • unreadnumber

    Unread conversations in it.

  • junknumber

    Conversations in its Junk.

  • snoozednumber

    Conversations you have snoozed here.

  • picturenullable string

    A short-lived URL of its picture, or null when it has none.

  • namenullable stringoptional

    The name its mail goes out under. Null sends with the address alone.

    Default null.

  • orgstringoptional

    The id of the org it belongs to.

Answered by

mailboxes.list

The Mailbox object
{
  "id": "out_3f9a1c0e7b2d",
  "address": "moc.elpmaxe@olleh",
  "kind": "person",
  "members": [
    "text"
  ],
  "deactivated": [
    "text"
  ],
  "names": {},
  "unread": 1,
  "junk": 1,
  "snoozed": 1,
  "picture": "text",
  "name": "Acme API",
  "org": "text"
}

mailboxes.list

List the mailboxes you can open.

POST/v1/mailboxes.list

App key with readAPI token

Parameters

It takes no input: send an empty object.

Returns

data is a list of Mailbox objects.

In the CLIErrors

import { Mailset } from 'mailset';

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

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

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

answer = mailset.mailboxes.list()
print(answer)
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

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

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

answer = mailset.mailboxes.list
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->mailboxes->list();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Mailbox;
import java.util.List;

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

List<Mailbox> answer = mailset.mailboxes().list();
System.out.println(answer);
// Reads MAILSET_KEY from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.mailboxes().list().await?;
println!("{answer:?}");
curl https://mailset.app/v1/mailboxes.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 mailboxes list
Response
{
  "ok": true,
  "data": [
    {
      "id": "out_3f9a1c0e7b2d",
      "address": "moc.elpmaxe@olleh",
      "kind": "person",
      "members": [
        "text"
      ],
      "deactivated": [
        "text"
      ],
      "names": {},
      "unread": 1,
      "junk": 1,
      "snoozed": 1,
      "picture": "text",
      "name": "Acme API",
      "org": "text"
    }
  ]
}

mailboxes.add

Add a mailbox on one of your domains.

POST/v1/mailboxes.add

Admin or ownerPasskey

Parameters

  • addressstringrequired

    The new mailbox’s address, on one of the org’s domains.

  • kindenumoptional

    person for one person’s mail, shared for a team’s.

    One ofpersonshared

    Default person.

  • membersarray of stringsoptional

    Who can open it. Empty means you.

    Default [].

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

  • approvalstringoptional

    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:

  • idstring

    The mailbox’s id.

  • addressstring

    Its address.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.mailboxes.add({
	kind: "shared",
	members: [
		"moc.elpmaxe@ana",
		"moc.elpmaxe@neb",
	],
	address: "moc.elpmaxe@troppus",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.mailboxes.add(
    {
        "kind": "shared",
        "members": ["moc.elpmaxe@ana", "moc.elpmaxe@neb"],
        "address": "moc.elpmaxe@troppus",
    }
)
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.MailboxesAddParams{
require 'mailset'

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

answer = mailset.mailboxes.add(
  kind: 'shared',
  members: ['moc.elpmaxe@ana', 'moc.elpmaxe@neb'],
  address: 'moc.elpmaxe@troppus'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->mailboxes->add([
    'kind' => 'shared',
    'members' => ['moc.elpmaxe@ana', 'moc.elpmaxe@neb'],
    'address' => 'moc.elpmaxe@troppus',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.MailboxKind;
import app.mailset.model.MailboxesAddParams;
import app.mailset.model.MailboxesAddResult;
import java.util.List;

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

var params = MailboxesAddParams.builder()
        .kind(MailboxKind.SHARED)
        .members(List.of(
                "moc.elpmaxe@ana",
                "moc.elpmaxe@neb"))
        .address("moc.elpmaxe@troppus")
        .build();
MailboxesAddResult answer =
        mailset.mailboxes().add(params);
System.out.println(answer);
use mailset::types::{MailboxKind, MailboxesAddParams};

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

let answer = mailset
    .mailboxes()
    .add(MailboxesAddParams {
        address: "moc.elpmaxe@troppus".into(),
        kind: Some(MailboxKind::Shared),
        members: Some(vec![
            "moc.elpmaxe@ana".into(),
            "moc.elpmaxe@neb".into(),
        ]),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/mailboxes.add \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"kind":"shared","members":["moc.elpmaxe@ana","moc.elpmaxe@neb"],"address":"moc.elpmaxe@troppus"},"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 shows how.

mailset mailboxes add moc.elpmaxe@troppus --kind shared --members moc.elpmaxe@ana,moc.elpmaxe@neb
Response
{
  "ok": true,
  "data": {
    "id": "out_3f9a1c0e7b2d",
    "address": "moc.elpmaxe@olleh"
  }
}

mailboxes.grant

Give someone in the org access to a mailbox.

POST/v1/mailboxes.grant

Admin or ownerPasskey

Parameters

  • addressstringrequired

    The mailbox’s address.

  • memberstringrequired

    The member’s address.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

  • approvalstringoptional

    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:

  • addressstring

    The mailbox’s address.

  • membersarray of strings

    Everyone who can open it now, by address.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.mailboxes.grant({
	member: "moc.elpmaxe@neb",
	address: "moc.elpmaxe@troppus",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.mailboxes.grant(
    {
        "member": "moc.elpmaxe@neb",
        "address": "moc.elpmaxe@troppus",
    }
)
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.MailboxesGrantParams{
		Member:  "moc.elpmaxe@neb",
		Address: "moc.elpmaxe@troppus",
	}
	answer, err := client.Mailboxes.Grant(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.mailboxes.grant(
  member: 'moc.elpmaxe@neb',
  address: 'moc.elpmaxe@troppus'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->mailboxes->grant([
    'member' => 'moc.elpmaxe@neb',
    'address' => 'moc.elpmaxe@troppus',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.MailboxesGrantParams;
import app.mailset.model.MailboxesGrantResult;

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

var params = MailboxesGrantParams.builder()
        .member("moc.elpmaxe@neb")
        .address("moc.elpmaxe@troppus")
        .build();
MailboxesGrantResult answer =
        mailset.mailboxes().grant(params);
System.out.println(answer);
use mailset::types::MailboxesGrantParams;

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

let answer = mailset
    .mailboxes()
    .grant(MailboxesGrantParams {
        address: "moc.elpmaxe@troppus".into(),
        member: "moc.elpmaxe@neb".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/mailboxes.grant \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"member":"moc.elpmaxe@neb","address":"moc.elpmaxe@troppus"},"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 shows how.

mailset mailboxes grant moc.elpmaxe@troppus --member moc.elpmaxe@neb
Response
{
  "ok": true,
  "data": {
    "address": "moc.elpmaxe@olleh",
    "members": [
      "text"
    ]
  }
}

mailboxes.revoke

Take someone out of a mailbox.

POST/v1/mailboxes.revoke

Admin or ownerPasskey

Parameters

  • addressstringrequired

    The mailbox’s address.

  • memberstringrequired

    The member’s address.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

  • approvalstringoptional

    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:

  • addressstring

    The mailbox’s address.

  • membersarray of strings

    Everyone who can open it now, by address.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.mailboxes.revoke({
	member: "moc.elpmaxe@neb",
	address: "moc.elpmaxe@troppus",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.mailboxes.revoke(
    {
        "member": "moc.elpmaxe@neb",
        "address": "moc.elpmaxe@troppus",
    }
)
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.MailboxesRevokeParams{
		Member:  "moc.elpmaxe@neb",
		Address: "moc.elpmaxe@troppus",
	}
	answer, err := client.Mailboxes.Revoke(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.mailboxes.revoke(
  member: 'moc.elpmaxe@neb',
  address: 'moc.elpmaxe@troppus'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->mailboxes->revoke([
    'member' => 'moc.elpmaxe@neb',
    'address' => 'moc.elpmaxe@troppus',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.MailboxesRevokeParams;
import app.mailset.model.MailboxesRevokeResult;

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

var params = MailboxesRevokeParams.builder()
        .member("moc.elpmaxe@neb")
        .address("moc.elpmaxe@troppus")
        .build();
MailboxesRevokeResult answer =
        mailset.mailboxes().revoke(params);
System.out.println(answer);
use mailset::types::MailboxesRevokeParams;

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

let answer = mailset
    .mailboxes()
    .revoke(MailboxesRevokeParams {
        address: "moc.elpmaxe@troppus".into(),
        member: "moc.elpmaxe@neb".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/mailboxes.revoke \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"member":"moc.elpmaxe@neb","address":"moc.elpmaxe@troppus"},"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 shows how.

mailset mailboxes revoke moc.elpmaxe@troppus --member moc.elpmaxe@neb
Response
{
  "ok": true,
  "data": {
    "address": "moc.elpmaxe@olleh",
    "members": [
      "text"
    ]
  }
}

mailboxes.all

List every mailbox in the org, and who holds each.

POST/v1/mailboxes.all

Admin or owner

Parameters

It takes no input: send an empty object.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

Returns

data is a list of objects, each with:

  • idstring
  • addressstring
  • kindenum

    One ofpersonshared

  • peoplearray of objects
    Show child attributesHide child attributes
    • emailstring
    • accessenum

      One ofownerdelegate

    • deactivatedboolean
  • aliasesarray of strings
  • receivingboolean

    False: mail to it is refused.

  • pausednullable object

    Set when its brake stopped the mail people write from it. An owner or admin ends it with mailboxes.resume.

    Show child attributesHide child attributes
    • reasonstring

      Why it was paused, in words.

    • atnumber

      When it was paused, in ms since the epoch.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.mailboxes.all();
console.log(answer);
from mailset import Mailset

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

answer = mailset.mailboxes.all()
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.Mailboxes.All(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.mailboxes.all
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->mailboxes->all();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.OrgMailbox;
import java.util.List;

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

List<OrgMailbox> answer = mailset.mailboxes().all();
System.out.println(answer);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.mailboxes().all().await?;
println!("{answer:?}");
curl https://mailset.app/v1/mailboxes.all \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{},"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 shows how.

mailset mailboxes all
Response
{
  "ok": true,
  "data": [
    {
      "id": "out_3f9a1c0e7b2d",
      "address": "moc.elpmaxe@olleh",
      "kind": "person",
      "people": [
        {
          "email": "moc.elpmaxe@olleh",
          "access": "owner",
          "deactivated": true
        }
      ],
      "aliases": [
        "text"
      ],
      "receiving": true,
      "paused": {
        "reason": "The day’s sending limit is reached.",
        "at": 1796048940000
      }
    }
  ]
}

mailboxes.deletePlan

Show exactly what deleting a mailbox would destroy.

POST/v1/mailboxes.deletePlan

Admin or owner

Parameters

  • addressstringrequired

    The mailbox’s address.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

Returns

data is an object with:

  • addressstring
  • kindenum

    One ofpersonshared

  • peoplearray of strings
  • conversationsnumber
  • messagesnumber
  • attachmentsnumber
  • draftsnumber
  • schedulednumber
  • aliasesarray of strings
  • groupsarray of strings
  • objectsnumber

    Stored files that go with it.

  • bytesnumber

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.mailboxes.deletePlan({
	address: "moc.elpmaxe@dlo",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.mailboxes.delete_plan(
    {"address": "moc.elpmaxe@dlo"}
)
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.MailboxesDeletePlanParams{
		Address: "moc.elpmaxe@dlo",
	}
	answer, err := client.Mailboxes.DeletePlan(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.mailboxes.delete_plan(
  address: 'moc.elpmaxe@dlo'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->mailboxes->deletePlan([
    'address' => 'moc.elpmaxe@dlo',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.MailboxDeletionPlan;
import app.mailset.model.MailboxesDeletePlanParams;

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

var params = MailboxesDeletePlanParams.builder()
        .address("moc.elpmaxe@dlo")
        .build();
MailboxDeletionPlan answer =
        mailset.mailboxes().deletePlan(params);
System.out.println(answer);
use mailset::types::MailboxesDeletePlanParams;

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

let answer = mailset
    .mailboxes()
    .delete_plan(MailboxesDeletePlanParams {
        address: "moc.elpmaxe@dlo".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/mailboxes.deletePlan \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"address":"moc.elpmaxe@dlo"},"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 shows how.

mailset mailboxes deletePlan moc.elpmaxe@dlo
Response
{
  "ok": true,
  "data": {
    "address": "moc.elpmaxe@olleh",
    "kind": "person",
    "people": [
      "text"
    ],
    "conversations": 1,
    "messages": 1,
    "attachments": 1,
    "drafts": 1,
    "scheduled": 1,
    "aliases": [
      "text"
    ],
    "groups": [
      "text"
    ],
    "objects": 1,
    "bytes": 20480
  }
}

mailboxes.delete

Delete a mailbox and all its mail for good.

POST/v1/mailboxes.delete

Admin or ownerPasskey

Parameters

  • addressstringrequired

    The mailbox’s address.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

  • approvalstringoptional

    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:

  • deletedboolean

    Always true: the mailbox is gone.

  • objectsnumber

    How many stored files went with it.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.mailboxes.delete({
	address: "moc.elpmaxe@dlo",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.mailboxes.delete(
    {"address": "moc.elpmaxe@dlo"}
)
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.MailboxesDeleteParams{
		Address: "moc.elpmaxe@dlo",
	}
	answer, err := client.Mailboxes.Delete(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.mailboxes.delete(
  address: 'moc.elpmaxe@dlo'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->mailboxes->delete([
    'address' => 'moc.elpmaxe@dlo',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.MailboxesDeleteParams;
import app.mailset.model.MailboxesDeleteResult;

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

var params = MailboxesDeleteParams.builder()
        .address("moc.elpmaxe@dlo")
        .build();
MailboxesDeleteResult answer =
        mailset.mailboxes().delete(params);
System.out.println(answer);
use mailset::types::MailboxesDeleteParams;

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

let answer = mailset
    .mailboxes()
    .delete(MailboxesDeleteParams {
        address: "moc.elpmaxe@dlo".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/mailboxes.delete \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"address":"moc.elpmaxe@dlo"},"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 shows how.

mailset mailboxes delete moc.elpmaxe@dlo
Response
{
  "ok": true,
  "data": {
    "deleted": true,
    "objects": 1
  }
}

mailboxes.receiving

Accept or refuse new mail to a mailbox.

POST/v1/mailboxes.receiving

Admin or ownerPasskey

Parameters

  • addressstringrequired

    The mailbox’s address.

  • receivingbooleanrequired

    True to accept new mail, false to refuse it.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

  • approvalstringoptional

    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:

  • addressstring

    The mailbox’s address.

  • receivingboolean

    Whether it accepts new mail now.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.mailboxes.receiving({
	receiving: false,
	address: "moc.elpmaxe@dlo",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.mailboxes.receiving(
    {"receiving": False, "address": "moc.elpmaxe@dlo"}
)
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.MailboxesReceivingParams{
		Receiving: false,
		Address:   "moc.elpmaxe@dlo",
	}
	answer, err := client.Mailboxes.Receiving(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.mailboxes.receiving(
  receiving: false,
  address: 'moc.elpmaxe@dlo'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->mailboxes->receiving([
    'receiving' => false,
    'address' => 'moc.elpmaxe@dlo',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.MailboxesReceivingParams;
import app.mailset.model.MailboxesReceivingResult;

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

var params = MailboxesReceivingParams.builder()
        .receiving(false)
        .address("moc.elpmaxe@dlo")
        .build();
MailboxesReceivingResult answer =
        mailset.mailboxes().receiving(params);
System.out.println(answer);
use mailset::types::MailboxesReceivingParams;

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

let answer = mailset
    .mailboxes()
    .receiving(MailboxesReceivingParams {
        address: "moc.elpmaxe@dlo".into(),
        receiving: false,
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/mailboxes.receiving \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"receiving":false,"address":"moc.elpmaxe@dlo"},"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 shows how.

mailset mailboxes receiving moc.elpmaxe@dlo --receiving false
Response
{
  "ok": true,
  "data": {
    "address": "moc.elpmaxe@olleh",
    "receiving": true
  }
}

mailboxes.resume

Let a mailbox its brake paused send again, once you know why it was.

POST/v1/mailboxes.resume

Admin or ownerPasskey

Parameters

  • addressstringrequired

    The mailbox’s address.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

  • approvalstringoptional

    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:

  • addressstring

    The mailbox’s address.

  • resumedboolean

    True when it was paused and may send again.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.mailboxes.resume({
	address: "moc.elpmaxe@ana",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.mailboxes.resume(
    {"address": "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.MailboxesResumeParams{
		Address: "moc.elpmaxe@ana",
	}
	answer, err := client.Mailboxes.Resume(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.mailboxes.resume(
  address: 'moc.elpmaxe@ana'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->mailboxes->resume([
    'address' => 'moc.elpmaxe@ana',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.MailboxesResumeParams;
import app.mailset.model.MailboxesResumeResult;

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

var params = MailboxesResumeParams.builder()
        .address("moc.elpmaxe@ana")
        .build();
MailboxesResumeResult answer =
        mailset.mailboxes().resume(params);
System.out.println(answer);
use mailset::types::MailboxesResumeParams;

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

let answer = mailset
    .mailboxes()
    .resume(MailboxesResumeParams {
        address: "moc.elpmaxe@ana".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/mailboxes.resume \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"address":"moc.elpmaxe@ana"},"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 shows how.

mailset mailboxes resume moc.elpmaxe@ana
Response
{
  "ok": true,
  "data": {
    "address": "moc.elpmaxe@olleh",
    "resumed": true
  }
}

mailboxes.reassign

Give a mailbox to one person. Everyone else loses it.

POST/v1/mailboxes.reassign

Admin or ownerPasskey

Parameters

  • addressstringrequired

    The mailbox’s address.

  • tostringrequired

    The member who gets it, by address.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

  • approvalstringoptional

    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:

  • addressstring

    The mailbox’s address.

  • membersarray of strings

    Everyone who can open it now: the one person.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.mailboxes.reassign({
	to: "moc.elpmaxe@ana",
	address: "moc.elpmaxe@neb",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.mailboxes.reassign(
    {
        "to": "moc.elpmaxe@ana",
        "address": "moc.elpmaxe@neb",
    }
)
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.MailboxesReassignParams{
		To:      "moc.elpmaxe@ana",
		Address: "moc.elpmaxe@neb",
	}
	answer, err := client.Mailboxes.Reassign(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.mailboxes.reassign(
  to: 'moc.elpmaxe@ana',
  address: 'moc.elpmaxe@neb'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->mailboxes->reassign([
    'to' => 'moc.elpmaxe@ana',
    'address' => 'moc.elpmaxe@neb',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.MailboxesReassignParams;
import app.mailset.model.MailboxesReassignResult;

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

var params = MailboxesReassignParams.builder()
        .to("moc.elpmaxe@ana")
        .address("moc.elpmaxe@neb")
        .build();
MailboxesReassignResult answer =
        mailset.mailboxes().reassign(params);
System.out.println(answer);
use mailset::types::MailboxesReassignParams;

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

let answer = mailset
    .mailboxes()
    .reassign(MailboxesReassignParams {
        address: "moc.elpmaxe@neb".into(),
        to: "moc.elpmaxe@ana".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/mailboxes.reassign \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"to":"moc.elpmaxe@ana","address":"moc.elpmaxe@neb"},"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 shows how.

mailset mailboxes reassign moc.elpmaxe@neb --to moc.elpmaxe@ana
Response
{
  "ok": true,
  "data": {
    "address": "moc.elpmaxe@olleh",
    "members": [
      "text"
    ]
  }
}

mailboxes.name

Set the name a mailbox’s mail goes out under.

POST/v1/mailboxes.name

Admin or owner

Parameters

  • addressstringrequired

    The mailbox’s address.

  • namestringrequired

    The name its mail goes out under. Empty clears it.

    At most 200 characters.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

Returns

data is an object with:

  • addressstring

    The mailbox’s address.

  • namenullable string

    The name it has now. Null: it sends with the address alone.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.mailboxes.name({
	name: "Acme Support",
	address: "moc.elpmaxe@troppus",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.mailboxes.name(
    {
        "name": "Acme Support",
        "address": "moc.elpmaxe@troppus",
    }
)
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.MailboxesNameParams{
		Name:    "Acme Support",
		Address: "moc.elpmaxe@troppus",
	}
	answer, err := client.Mailboxes.Name(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.mailboxes.name(
  name: 'Acme Support',
  address: 'moc.elpmaxe@troppus'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->mailboxes->name([
    'name' => 'Acme Support',
    'address' => 'moc.elpmaxe@troppus',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.MailboxesNameParams;
import app.mailset.model.MailboxesNameResult;

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

var params = MailboxesNameParams.builder()
        .name("Acme Support")
        .address("moc.elpmaxe@troppus")
        .build();
MailboxesNameResult answer =
        mailset.mailboxes().name(params);
System.out.println(answer);
use mailset::types::MailboxesNameParams;

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

let answer = mailset
    .mailboxes()
    .name(MailboxesNameParams {
        address: "moc.elpmaxe@troppus".into(),
        name: "Acme Support".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/mailboxes.name \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"name":"Acme Support","address":"moc.elpmaxe@troppus"},"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 shows how.

mailset mailboxes name moc.elpmaxe@troppus --name "Acme Support"
Response
{
  "ok": true,
  "data": {
    "address": "moc.elpmaxe@olleh",
    "name": "Acme API"
  }
}