Conversations

Conversations

List, search, read and file conversations.

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 Conversation object
  2. The Message object
  3. threads.list
  4. threads.get
  5. threads.update
  6. threads.markAllRead
  7. threads.count
  8. threads.updateAll
  9. threads.search
  10. threads.label
  11. threads.assign
  12. threads.snooze
  13. threads.unsnooze
  14. threads.classify

The Conversation object

A conversation as a list shows it: who, what, where it is and its marks.

Attributes

  • idstring

    The conversation’s id.

  • mailboxstring

    The address of the mailbox it is in.

  • fromstring

    Who it is from, as a list shows them.

  • fromAddressstringoptional

    The address its newest incoming message is from. Absent when nothing in it came in.

  • subjectstring

    Its subject.

  • snippetstring

    The start of its newest message.

  • countnumber

    How many messages it holds.

  • latestAtnumber

    When its newest message is dated, in milliseconds since 1970.

  • unreadboolean

    Whether it is unread.

  • starredboolean

    Whether any of its messages is starred.

  • importantboolean

    The Important marker: a person or a rule put it there.

  • placeenum

    Where it is: the inbox, the archive, Trash or Junk.

    One ofinboxarchivedtrashjunk

  • sentboolean

    You’ve written in it, so it is in Sent.

  • hasAttachmentboolean

    Whether any of its messages has a file.

  • labelsarray of strings

    The labels on it, by name.

  • snoozedUntilnullable number

    When it comes back to your inbox, in milliseconds since 1970, if you’ve snoozed it.

  • assigneenullable objectoptional

    Shared mailboxes only: who owns it, or null when anyone can take it.

    Show child attributesHide child attributes
    • emailstring

      Their address.

    • namenullable string

      Their name, or null when they have none.

    • deactivatedbooleanoptional

      Their org deactivated them. Present only when true.

  • tabenumoptional

    Its inbox tab. Absent when sorting is off and there is one inbox.

    One ofprimaryupdatesnewsletterspromotions

  • needsReplybooleanoptional

    It is waiting on an answer from you.

  • phishingobjectoptional

    Why it looks forged. Absent when there is nothing to warn about.

    Show child attributesHide child attributes
    • domainstring

      The domain the mail really came from.

    • imitatesnullable string

      The domain or name it passes itself off as. Null when it imitates nobody known.

    • failednullable string

      The check it failed, such as DMARC. Null when none did.

    • reasonenumoptional

      What it does that looks like fraud: a lookalike domain, a payment ask, a request for credentials, or a risky attachment.

      One oflookalikepaymentcredentialsattachment

  • followUpbooleanoptional

    It is back because something you sent got no answer.

  • picturenullable object

    The sender’s picture, or null for initials.

    Show child attributesHide child attributes
    • urlstring

      A short-lived URL of the picture.

    • iconboolean

      It is a site’s icon, drawn smaller on a neutral tile.

  • senderDeactivatedbooleanoptional

    The sender shown is someone in your org who is deactivated. Present only when true.

Answered by

threads.listthreads.getthreads.searchrules.testsenders.get

The Conversation object
{
  "id": "out_3f9a1c0e7b2d",
  "mailbox": "text",
  "from": "moc.elpmaxe@olleh",
  "fromAddress": "moc.elpmaxe@olleh",
  "subject": "Your Acme receipt",
  "snippet": "text",
  "count": 12,
  "latestAt": 1796048940000,
  "unread": true,
  "starred": true,
  "important": true,
  "place": "inbox",
  "sent": true,
  "hasAttachment": true,
  "labels": [
    "text"
  ],

The Message object

One message of a conversation, as threads.get answers it: its headers, body and files.

Attributes

  • idstring

    The message’s id.

  • fromNamenullable string

    The sender’s name, or null when the message gave none.

  • fromAddressstring

    The sender’s address.

  • toarray of strings

    The addresses in To and Cc.

  • replyToarray of objectsoptional

    Where the sender asked for replies to go, when that isn’t just their From. Absent for most mail.

    At most 10 items.

    Show child attributesHide child attributes
    • namenullable string

      The name, or null.

    • addressstring

      The address.

  • sentAtnumber

    When it is dated, in milliseconds since 1970.

  • textstring

    Its text.

  • htmlnullable string

    Its HTML part as it arrived. Null for plain mail, mail sent from here, and anything very large.

  • authnullable object

    How it arrived. Null on mail sent from here.

    Show child attributesHide child attributes
    • tlsboolean

      It arrived over an encrypted connection.

    • spfboolean

      SPF passed.

    • dkimboolean

      DKIM passed.

    • dmarcboolean

      DMARC passed.

    • forgedbooleanoptional

      The sender’s domain says this From is not theirs: DMARC ran and failed.

  • outgoingboolean

    It was sent from this mailbox.

  • starredboolean

    Whether it is starred.

  • attachmentsarray of objects

    Its files.

    Show child attributesHide child attributes
    • idstring

      The file’s id, for attachments.get.

    • namestring

      Its file name.

    • contentTypestring

      Its media type.

    • sizenumber

      Its size in bytes.

    • inlineboolean

      It is shown inside the message, like a picture in the text.

    • scanenum

      What the virus scan said.

      One ofcleaninfectedunscanned

    • skippednullable string

      Why it wasn’t kept, when it wasn’t.

  • picturenullable object

    The sender’s picture, or null for initials.

    Show child attributesHide child attributes
    • urlstring

      A short-lived URL of the picture.

    • iconboolean

      It is a site’s icon, drawn smaller on a neutral tile.

  • deactivatedbooleanoptional

    Sent by someone in your org who is deactivated. Present only when true.

  • unsubscribeobjectoptional

    A way to leave this sender’s list. Absent when the message offers none.

    Show child attributesHide child attributes
    • howenum

      oneClick: Mailset asks the sender for you. link: the sender’s own page, for you to open.

      One ofoneClicklink

    • urlstringoptional

      The sender’s page, when how is link.

    • doneboolean

      This mailbox already asked this sender to stop.

Answered by

threads.get

The Message object
{
  "id": "out_3f9a1c0e7b2d",
  "fromName": "text",
  "fromAddress": "moc.elpmaxe@olleh",
  "to": [
    "moc.elpmaxe@ana"
  ],
  "replyTo": [
    {
      "name": "Acme API",
      "address": "moc.elpmaxe@olleh"
    }
  ],
  "sentAt": 1796048940000,
  "text": "text",
  "html": "text",
  "auth": {
    "tls": true,

threads.list

List conversations.

POST/v1/threads.list

App key with readAPI token

Parameters

  • mailboxstringoptional

    Only this mailbox. Left out: every mailbox you can open.

  • placeenumoptional

    Where to look: inbox, archived, trash or junk.

    One ofinboxarchivedtrashjunk

    Default inbox.

  • starredbooleanoptional

    Only conversations with a starred message.

  • importantbooleanoptional

    Conversations marked important, anywhere but Trash and Junk.

  • sentbooleanoptional

    The Sent folder: conversations you’ve written in, wherever they are.

  • labelstringoptional

    Conversations with this label, anywhere but Trash and Junk.

    At most 60 characters.

  • snoozedbooleanoptional

    Only what you’ve snoozed.

  • tabenumoptional

    One tab of the inbox.

    One ofprimaryupdatesnewsletterspromotions

  • limitintegeroptional

    How many conversations a page holds, 1 to 100.

    Default 50. From 1 to 100.

  • beforestringoptional

    The next of the page before, for the page after it.

Returns

data is an object with:

  • threadsarray of Conversation objects

    One page of conversations, newest first.

  • nextnullable string

    Pass back as before for the next page. Null at the end.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.threads.list({
	mailbox: "moc.elpmaxe@ana",
	limit: 20,
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.threads.list(
    {"mailbox": "moc.elpmaxe@ana", "limit": 20}
)
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()
	params := &mailset.ThreadsListParams{
		Mailbox: mailset.String("moc.elpmaxe@ana"),
		Limit:   mailset.Int(20),
	}
	answer, err := client.Threads.List(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.threads.list(
  mailbox: 'moc.elpmaxe@ana',
  limit: 20
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->threads->list([
    'mailbox' => 'moc.elpmaxe@ana',
    'limit' => 20,
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ThreadPage;
import app.mailset.model.ThreadsListParams;

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

var params = ThreadsListParams.builder()
        .mailbox("moc.elpmaxe@ana")
        .limit(20L)
        .build();
ThreadPage answer = mailset.threads().list(params);
System.out.println(answer);
use mailset::types::ThreadsListParams;

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

let answer = mailset
    .threads()
    .list(ThreadsListParams {
        mailbox: Some("moc.elpmaxe@ana".into()),
        limit: Some(20),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/threads.list \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"mailbox":"moc.elpmaxe@ana","limit":20}}'

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 threads list --mailbox moc.elpmaxe@ana --limit 20
Response
{
  "ok": true,
  "data": {
    "threads": [
      {
        "id": "out_3f9a1c0e7b2d",
        "mailbox": "text",
        "from": "moc.elpmaxe@olleh",
        "fromAddress": "moc.elpmaxe@olleh",
        "subject": "Your Acme receipt",
        "snippet": "text",
        "count": 12,
        "latestAt": 1796048940000,
        "unread": true,
        "starred": true,
        "important": true,
        "place": "inbox",
        "sent": true,

threads.get

Read a conversation.

POST/v1/threads.get

App key with readAPI token

Parameters

  • idstringrequired

    The conversation’s id, from threads list or threads search.

Returns

data is an object with:

  • summaryConversation object

    The conversation as a list shows it.

  • messagesarray of Message objects

    Its messages, oldest first.

  • unreadFromnullable string

    While unread: the id of the message it was marked unread from.

  • notesarray of objects

    Notes only the mailbox’s members see. Never mail.

    Show child attributesHide child attributes
    • idstring

      The note’s id.

    • authornullable object

      Who wrote it, or null when they are gone.

      Show child attributesHide child attributes
      • emailstring

        Their address.

      • namenullable string

        Their name, or null when they have none.

      • deactivatedbooleanoptional

        Their org deactivated them. Present only when true.

    • textstring

      What it says.

    • atnumber

      When it was written, in milliseconds since 1970.

  • eventsarray of objects

    Its owner changes, oldest first.

    Show child attributesHide child attributes
    • idstring

      The event’s id.

    • actornullable object

      Who did it, or null when they are gone.

      Show child attributesHide child attributes
      • emailstring

        Their address.

      • namenullable string

        Their name, or null when they have none.

      • deactivatedbooleanoptional

        Their org deactivated them. Present only when true.

    • assigneenullable object

      Who owns the conversation now. Null when it was unassigned.

      Show child attributesHide child attributes
      • emailstring

        Their address.

      • namenullable string

        Their name, or null when they have none.

      • deactivatedbooleanoptional

        Their org deactivated them. Present only when true.

    • atnumber

      When it happened, in milliseconds since 1970.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.threads.get({
	id: "t_5d2c8a1f9e3b47c6a0d1e2f3",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.threads.get(
    {"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"}
)
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()
	params := &mailset.ThreadsGetParams{
		ID: "t_5d2c8a1f9e3b47c6a0d1e2f3",
	}
	answer, err := client.Threads.Get(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.threads.get(
  id: 't_5d2c8a1f9e3b47c6a0d1e2f3'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->threads->get([
    'id' => 't_5d2c8a1f9e3b47c6a0d1e2f3',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ThreadDetail;
import app.mailset.model.ThreadsGetParams;

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

var params = ThreadsGetParams.builder()
        .id("t_5d2c8a1f9e3b47c6a0d1e2f3")
        .build();
ThreadDetail answer = mailset.threads().get(params);
System.out.println(answer);
use mailset::types::ThreadsGetParams;

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

let answer = mailset
    .threads()
    .get(ThreadsGetParams {
        id: "t_5d2c8a1f9e3b47c6a0d1e2f3".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/threads.get \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"id":"t_5d2c8a1f9e3b47c6a0d1e2f3"}}'

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 threads get t_5d2c8a1f9e3b47c6a0d1e2f3
Response
{
  "ok": true,
  "data": {
    "summary": {
      "id": "out_3f9a1c0e7b2d",
      "mailbox": "text",
      "from": "moc.elpmaxe@olleh",
      "fromAddress": "moc.elpmaxe@olleh",
      "subject": "Your Acme receipt",
      "snippet": "text",
      "count": 12,
      "latestAt": 1796048940000,
      "unread": true,
      "starred": true,
      "important": true,
      "place": "inbox",
      "sent": true,
      "hasAttachment": true,

threads.update

Mark, star, mark important, archive or move conversations.

POST/v1/threads.update

API token

Parameters

  • idsarray of stringsrequired

    The conversations’ ids, 1 to 200.

    1 to 200 items.

  • unreadbooleanoptional

    Mark them unread, or read.

  • starredbooleanoptional

    Star them, or take the star off.

  • importantbooleanoptional

    Sets the Important marker by hand, or clears it.

  • placeenumoptional

    Move them: inbox, archived, trash or junk.

    One ofinboxarchivedtrashjunk

Returns

data is an object with:

  • updatednumber

    How many changed.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.threads.update({
	ids: [
		"t_5d2c8a1f9e3b47c6a0d1e2f3",
		"t_b7e41c9a2f6d4083c5a9e1b2",
	],
	place: "archived",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.threads.update(
    {
        "ids": [
            "t_5d2c8a1f9e3b47c6a0d1e2f3",
            "t_b7e41c9a2f6d4083c5a9e1b2",
        ],
        "place": "archived",
    }
)
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.ThreadsUpdateParams{
require 'mailset'

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

answer = mailset.threads.update(
  ids: [
    't_5d2c8a1f9e3b47c6a0d1e2f3',
    't_b7e41c9a2f6d4083c5a9e1b2'
  ],
  place: 'archived'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->threads->update([
    'ids' => [
        't_5d2c8a1f9e3b47c6a0d1e2f3',
        't_b7e41c9a2f6d4083c5a9e1b2',
    ],
    'place' => 'archived',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Place;
import app.mailset.model.ThreadsUpdateParams;
import app.mailset.model.ThreadsUpdateResult;
import java.util.List;

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

var params = ThreadsUpdateParams.builder()
        .ids(List.of(
                "t_5d2c8a1f9e3b47c6a0d1e2f3",
                "t_b7e41c9a2f6d4083c5a9e1b2"))
        .place(Place.ARCHIVED)
        .build();
ThreadsUpdateResult answer =
        mailset.threads().update(params);
System.out.println(answer);
use mailset::types::{Place, ThreadsUpdateParams};

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

let answer = mailset
    .threads()
    .update(ThreadsUpdateParams {
        ids: vec![
            "t_5d2c8a1f9e3b47c6a0d1e2f3".into(),
            "t_b7e41c9a2f6d4083c5a9e1b2".into(),
        ],
        place: Some(Place::Archived),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/threads.update \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"ids":["t_5d2c8a1f9e3b47c6a0d1e2f3","t_b7e41c9a2f6d4083c5a9e1b2"],"place":"archived"}}'

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 threads update --ids t_5d2c8a1f9e3b47c6a0d1e2f3,t_b7e41c9a2f6d4083c5a9e1b2 --place archived
Response
{
  "ok": true,
  "data": {
    "updated": 1
  }
}

threads.markAllRead

Mark a whole list as read, not only what is loaded.

POST/v1/threads.markAllRead

API token

Parameters

  • mailboxstringoptional

    Only this mailbox. Left out: every mailbox you can open.

  • placeenumoptional

    Where to look: inbox, archived, trash or junk.

    One ofinboxarchivedtrashjunk

    Default inbox.

  • starredbooleanoptional

    Only conversations with a starred message.

  • importantbooleanoptional

    Conversations marked important, anywhere but Trash and Junk.

  • sentbooleanoptional

    Conversations you’ve written in, wherever they are.

  • labelstringoptional

    Conversations with this label, anywhere but Trash and Junk.

    At most 60 characters.

  • snoozedbooleanoptional

    Only what you’ve snoozed.

  • querystringoptional

    A search’s results, with the same words as threads search.

    At most 500 characters.

  • exceptarray of stringsoptional

    Mailboxes to leave alone: All inboxes hides these.

    Default []. At most 200 items.

  • ownerenumoptional

    One tab of a shared mailbox.

    One ofunassignedmine

  • tabenumoptional

    One tab of a personal inbox.

    One ofprimaryupdatesnewsletterspromotions

Returns

data is an object with:

  • updatednumber

    How many were marked read.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.threads.markAllRead({
	mailbox: "moc.elpmaxe@ana",
	tab: "promotions",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.threads.mark_all_read(
    {"mailbox": "moc.elpmaxe@ana", "tab": "promotions"}
)
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.ThreadsMarkAllReadParams{
		Mailbox: mailset.String("moc.elpmaxe@ana"),
		Tab:     mailset.InboxTabNamePromotions,
	}
	answer, err := client.Threads.MarkAllRead(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.threads.mark_all_read(
  mailbox: 'moc.elpmaxe@ana',
  tab: 'promotions'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->threads->markAllRead([
    'mailbox' => 'moc.elpmaxe@ana',
    'tab' => 'promotions',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.InboxTabName;
import app.mailset.model.ThreadsMarkAllReadParams;
import app.mailset.model.ThreadsMarkAllReadResult;

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

var params = ThreadsMarkAllReadParams.builder()
        .mailbox("moc.elpmaxe@ana")
        .tab(InboxTabName.PROMOTIONS)
        .build();
ThreadsMarkAllReadResult answer =
        mailset.threads().markAllRead(params);
System.out.println(answer);
use mailset::types::{
    InboxTabName, ThreadsMarkAllReadParams,
};

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

let answer = mailset
    .threads()
    .mark_all_read(ThreadsMarkAllReadParams {
        mailbox: Some("moc.elpmaxe@ana".into()),
        tab: Some(InboxTabName::Promotions),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/threads.markAllRead \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"mailbox":"moc.elpmaxe@ana","tab":"promotions"}}'

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 threads markAllRead --mailbox moc.elpmaxe@ana --tab promotions
Response
{
  "ok": true,
  "data": {
    "updated": 1
  }
}

threads.count

Count the conversations in a whole list; a search counts up to 1,000.

POST/v1/threads.count

API token

Parameters

  • mailboxstringoptional

    Only this mailbox. Left out: every mailbox you can open.

  • placeenumoptional

    Where to look: inbox, archived, trash or junk.

    One ofinboxarchivedtrashjunk

    Default inbox.

  • starredbooleanoptional

    Only conversations with a starred message.

  • importantbooleanoptional

    Conversations marked important, anywhere but Trash and Junk.

  • sentbooleanoptional

    Conversations you’ve written in, wherever they are.

  • labelstringoptional

    Conversations with this label, anywhere but Trash and Junk.

    At most 60 characters.

  • snoozedbooleanoptional

    Only what you’ve snoozed.

  • querystringoptional

    A search’s results, with the same words as threads search.

    At most 500 characters.

  • exceptarray of stringsoptional

    Mailboxes to leave alone: All inboxes hides these.

    Default []. At most 200 items.

  • ownerenumoptional

    One tab of a shared mailbox.

    One ofunassignedmine

  • tabenumoptional

    One tab of a personal inbox.

    One ofprimaryupdatesnewsletterspromotions

Returns

data is an object with:

  • countnumber

    How many conversations the list holds.

  • cappedboolean

    A search stopped counting at count: it found more.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.threads.count({
	mailbox: "moc.elpmaxe@ana",
	tab: "primary",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.threads.count(
    {"mailbox": "moc.elpmaxe@ana", "tab": "primary"}
)
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.ThreadsCountParams{
		Mailbox: mailset.String("moc.elpmaxe@ana"),
		Tab:     mailset.InboxTabNamePrimary,
	}
	answer, err := client.Threads.Count(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.threads.count(
  mailbox: 'moc.elpmaxe@ana',
  tab: 'primary'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->threads->count([
    'mailbox' => 'moc.elpmaxe@ana',
    'tab' => 'primary',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.InboxTabName;
import app.mailset.model.ThreadsCountParams;
import app.mailset.model.ThreadsCountResult;

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

var params = ThreadsCountParams.builder()
        .mailbox("moc.elpmaxe@ana")
        .tab(InboxTabName.PRIMARY)
        .build();
ThreadsCountResult answer =
        mailset.threads().count(params);
System.out.println(answer);
use mailset::types::{InboxTabName, ThreadsCountParams};

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

let answer = mailset
    .threads()
    .count(ThreadsCountParams {
        mailbox: Some("moc.elpmaxe@ana".into()),
        tab: Some(InboxTabName::Primary),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/threads.count \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"mailbox":"moc.elpmaxe@ana","tab":"primary"}}'

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 threads count --mailbox moc.elpmaxe@ana --tab primary
Response
{
  "ok": true,
  "data": {
    "count": 12,
    "capped": true
  }
}

threads.updateAll

Archive, move, mark, star or label a whole list, not only what is loaded.

POST/v1/threads.updateAll

API token

Parameters

  • mailboxstringoptional

    Only this mailbox. Left out: every mailbox you can open.

  • placeenumoptional

    Where to look: inbox, archived, trash or junk.

    One ofinboxarchivedtrashjunk

    Default inbox.

  • starredbooleanoptional

    Only conversations with a starred message.

  • importantbooleanoptional

    Conversations marked important, anywhere but Trash and Junk.

  • sentbooleanoptional

    Conversations you’ve written in, wherever they are.

  • labelstringoptional

    Conversations with this label, anywhere but Trash and Junk.

    At most 60 characters.

  • snoozedbooleanoptional

    Only what you’ve snoozed.

  • querystringoptional

    A search’s results, with the same words as threads search.

    At most 500 characters.

  • exceptarray of stringsoptional

    Mailboxes to leave alone: All inboxes hides these.

    Default []. At most 200 items.

  • ownerenumoptional

    One tab of a shared mailbox.

    One ofunassignedmine

  • tabenumoptional

    One tab of a personal inbox.

    One ofprimaryupdatesnewsletterspromotions

  • changeobjectrequired

    What happens to each one: the fields of threads update and threads label.

    Show child attributesHide child attributes
    • unreadbooleanoptional

      Mark them unread, or read.

    • starredbooleanoptional

      Star them, or take the star off.

    • importantbooleanoptional

      Mark them important, or clear it.

    • placeenumoptional

      Where they go: Archive, the inbox, Junk or Trash.

      One ofinboxarchivedtrashjunk

    • addarray of stringsoptional

      Labels to put on them, by name.

      Default []. At most 50 items.

    • removearray of stringsoptional

      Labels to take off them, by name.

      Default []. At most 50 items.

  • afterstringoptional

    Where the last call stopped: its next.

Returns

data is an object with:

  • updatednumber

    How many changed in this call.

  • nextnullable string

    The list is longer than one call goes: call again with this as after. Null once done.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.threads.updateAll({
	label: "Finance",
	change: {
		place: "archived",
	},
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.threads.update_all(
    {"label": "Finance", "change": {"place": "archived"}}
)
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.ThreadsUpdateAllParams{
require 'mailset'

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

answer = mailset.threads.update_all(
  label: 'Finance',
  change: { place: 'archived' }
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->threads->updateAll([
    'label' => 'Finance',
    'change' => ['place' => 'archived'],
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Place;
import app.mailset.model.ThreadsUpdateAllParams;
import app.mailset.model.ThreadsUpdateAllParamsChange;
import app.mailset.model.ThreadsUpdateAllResult;

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

var params = ThreadsUpdateAllParams.builder()
        .label("Finance")
        .change(ThreadsUpdateAllParamsChange.builder()
                .place(Place.ARCHIVED)
                .build())
        .build();
ThreadsUpdateAllResult answer =
        mailset.threads().updateAll(params);
System.out.println(answer);
use mailset::types::{
    Place, ThreadsUpdateAllParams,
    ThreadsUpdateAllParamsChange,
};

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

let answer = mailset
    .threads()
    .update_all(ThreadsUpdateAllParams {
        label: Some("Finance".into()),
        change: ThreadsUpdateAllParamsChange {
            place: Some(Place::Archived),
            ..Default::default()
        },
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/threads.updateAll \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"label":"Finance","change":{"place":"archived"}}}'

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 threads updateAll --label Finance --change '{"place":"archived"}'
Response
{
  "ok": true,
  "data": {
    "updated": 1,
    "next": "eyJhIjoxNzk2MDkyNDQyfQ"
  }
}

threads.search

Search mail, with from:, to:, subject:, has:attachment, larger:, smaller:, before:, after:, is:important, brackets, OR, and -word.

POST/v1/threads.search

App key with readAPI token

Parameters

  • querystringrequired

    What to find: words, and operators such as from:, to:, subject:, has:attachment, larger:, before:, after:, is:important, OR and -word. Up to 500 characters.

    At most 500 characters.

  • limitintegeroptional

    How many conversations a page holds, 1 to 100.

    Default 50. From 1 to 100.

  • beforestringoptional

    The next of the page before, for the page after it.

  • prefixbooleanoptional

    The last word is still being typed: a bare word of two letters or more matches the start of a word.

Returns

data is an object with:

  • threadsarray of Conversation objects

    One page of conversations, newest first.

  • nextnullable string

    Pass back as before for the next page. Null at the end.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.threads.search({
	limit: 20,
	query: "from:stripe.com has:attachment",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.threads.search(
    {
        "limit": 20,
        "query": "from:stripe.com has:attachment",
    }
)
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()
	params := &mailset.ThreadsSearchParams{
		Limit: mailset.Int(20),
		Query: "from:stripe.com has:attachment",
	}
	answer, err := client.Threads.Search(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.threads.search(
  limit: 20,
  query: 'from:stripe.com has:attachment'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->threads->search([
    'limit' => 20,
    'query' => 'from:stripe.com has:attachment',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ThreadPage;
import app.mailset.model.ThreadsSearchParams;

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

var params = ThreadsSearchParams.builder()
        .limit(20L)
        .query("from:stripe.com has:attachment")
        .build();
ThreadPage answer = mailset.threads().search(params);
System.out.println(answer);
use mailset::types::ThreadsSearchParams;

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

let answer = mailset
    .threads()
    .search(ThreadsSearchParams {
        query: "from:stripe.com has:attachment".into(),
        limit: Some(20),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/threads.search \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"limit":20,"query":"from:stripe.com has:attachment"}}'

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 threads search "from:stripe.com has:attachment" --limit 20
Response
{
  "ok": true,
  "data": {
    "threads": [
      {
        "id": "out_3f9a1c0e7b2d",
        "mailbox": "text",
        "from": "moc.elpmaxe@olleh",
        "fromAddress": "moc.elpmaxe@olleh",
        "subject": "Your Acme receipt",
        "snippet": "text",
        "count": 12,
        "latestAt": 1796048940000,
        "unread": true,
        "starred": true,
        "important": true,
        "place": "inbox",
        "sent": true,

threads.label

Put labels on conversations, or take them off.

POST/v1/threads.label

API token

Parameters

  • idsarray of stringsrequired

    The conversations’ ids, 1 to 200.

    1 to 200 items.

  • addarray of stringsoptional

    Labels to put on them, by name.

    Default []. At most 50 items.

  • removearray of stringsoptional

    Labels to take off them, by name.

    Default []. At most 50 items.

Returns

data is an object with:

  • updatednumber

    How many changed.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.threads.label({
	ids: [
		"t_5d2c8a1f9e3b47c6a0d1e2f3",
		"t_b7e41c9a2f6d4083c5a9e1b2",
	],
	add: [
		"Finance",
	],
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.threads.label(
    {
        "ids": [
            "t_5d2c8a1f9e3b47c6a0d1e2f3",
            "t_b7e41c9a2f6d4083c5a9e1b2",
        ],
        "add": ["Finance"],
    }
)
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.ThreadsLabelParams{
require 'mailset'

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

answer = mailset.threads.label(
  ids: [
    't_5d2c8a1f9e3b47c6a0d1e2f3',
    't_b7e41c9a2f6d4083c5a9e1b2'
  ],
  add: ['Finance']
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->threads->label([
    'ids' => [
        't_5d2c8a1f9e3b47c6a0d1e2f3',
        't_b7e41c9a2f6d4083c5a9e1b2',
    ],
    'add' => ['Finance'],
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ThreadsLabelParams;
import app.mailset.model.ThreadsLabelResult;
import java.util.List;

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

var params = ThreadsLabelParams.builder()
        .ids(List.of(
                "t_5d2c8a1f9e3b47c6a0d1e2f3",
                "t_b7e41c9a2f6d4083c5a9e1b2"))
        .add(List.of("Finance"))
        .build();
ThreadsLabelResult answer =
        mailset.threads().label(params);
System.out.println(answer);
use mailset::types::ThreadsLabelParams;

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

let answer = mailset
    .threads()
    .label(ThreadsLabelParams {
        ids: vec![
            "t_5d2c8a1f9e3b47c6a0d1e2f3".into(),
            "t_b7e41c9a2f6d4083c5a9e1b2".into(),
        ],
        add: Some(vec!["Finance".into()]),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/threads.label \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"ids":["t_5d2c8a1f9e3b47c6a0d1e2f3","t_b7e41c9a2f6d4083c5a9e1b2"],"add":["Finance"]}}'

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 threads label --ids t_5d2c8a1f9e3b47c6a0d1e2f3,t_b7e41c9a2f6d4083c5a9e1b2 --add Finance
Response
{
  "ok": true,
  "data": {
    "updated": 1
  }
}

threads.assign

Give a conversation in a shared mailbox an owner.

POST/v1/threads.assign

API token

Parameters

  • idstringrequired

    The conversation’s id.

  • assigneestring or enumrequired

    Someone in the mailbox, or nobody.

Returns

data is an object with:

  • assigneenullable object

    Who owns it now. Null: nobody.

    Show child attributesHide child attributes
    • emailstring

      Their address.

    • namenullable string

      Their name, or null when they have none.

    • deactivatedbooleanoptional

      Their org deactivated them. Present only when true.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.threads.assign({
	assignee: "moc.elpmaxe@neb",
	id: "t_5d2c8a1f9e3b47c6a0d1e2f3",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.threads.assign(
    {
        "assignee": "moc.elpmaxe@neb",
        "id": "t_5d2c8a1f9e3b47c6a0d1e2f3",
    }
)
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.ThreadsAssignParams{
		Assignee: "moc.elpmaxe@neb",
		ID:       "t_5d2c8a1f9e3b47c6a0d1e2f3",
	}
	answer, err := client.Threads.Assign(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.threads.assign(
  assignee: 'moc.elpmaxe@neb',
  id: 't_5d2c8a1f9e3b47c6a0d1e2f3'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->threads->assign([
    'assignee' => 'moc.elpmaxe@neb',
    'id' => 't_5d2c8a1f9e3b47c6a0d1e2f3',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ThreadsAssignParams;
import app.mailset.model.ThreadsAssignResult;

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

var params = ThreadsAssignParams.builder()
        .assignee("moc.elpmaxe@neb")
        .id("t_5d2c8a1f9e3b47c6a0d1e2f3")
        .build();
ThreadsAssignResult answer =
        mailset.threads().assign(params);
System.out.println(answer);
use mailset::types::ThreadsAssignParams;

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

let answer = mailset
    .threads()
    .assign(ThreadsAssignParams {
        id: "t_5d2c8a1f9e3b47c6a0d1e2f3".into(),
        assignee: "moc.elpmaxe@neb".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/threads.assign \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"assignee":"moc.elpmaxe@neb","id":"t_5d2c8a1f9e3b47c6a0d1e2f3"}}'

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 threads assign t_5d2c8a1f9e3b47c6a0d1e2f3 --assignee moc.elpmaxe@neb
Response
{
  "ok": true,
  "data": {
    "assignee": {
      "email": "moc.elpmaxe@olleh",
      "name": "Acme API",
      "deactivated": true
    }
  }
}

threads.snooze

Hide conversations until a time.

POST/v1/threads.snooze

API token

Parameters

  • idsarray of stringsrequired

    The conversations’ ids, 1 to 200.

    1 to 200 items.

  • untilinteger or stringrequired

    When they come back: ms since the epoch, or an ISO date and time with its offset (2026-12-07T09:00:00Z).

Returns

data is an object with:

  • updatednumber

    How many were snoozed.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.threads.snooze({
	ids: [
		"t_5d2c8a1f9e3b47c6a0d1e2f3",
	],
	until: "2026-12-07T09:00:00Z",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.threads.snooze(
    {
        "ids": ["t_5d2c8a1f9e3b47c6a0d1e2f3"],
        "until": "2026-12-07T09:00:00Z",
    }
)
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.ThreadsSnoozeParams{
		IDs:   []string{"t_5d2c8a1f9e3b47c6a0d1e2f3"},
		Until: "2026-12-07T09:00:00Z",
	}
	answer, err := client.Threads.Snooze(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.threads.snooze(
  ids: ['t_5d2c8a1f9e3b47c6a0d1e2f3'],
  until: '2026-12-07T09:00:00Z'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->threads->snooze([
    'ids' => ['t_5d2c8a1f9e3b47c6a0d1e2f3'],
    'until' => '2026-12-07T09:00:00Z',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ThreadsSnoozeParams;
import app.mailset.model.ThreadsSnoozeResult;
import java.time.Instant;
import java.util.List;

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

var params = ThreadsSnoozeParams.builder()
        .ids(List.of("t_5d2c8a1f9e3b47c6a0d1e2f3"))
        .until(Instant.parse("2026-12-07T09:00:00Z"))
        .build();
ThreadsSnoozeResult answer =
        mailset.threads().snooze(params);
System.out.println(answer);
use mailset::types::ThreadsSnoozeParams;

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

let answer = mailset
    .threads()
    .snooze(ThreadsSnoozeParams {
        ids: vec!["t_5d2c8a1f9e3b47c6a0d1e2f3".into()],
        until: "2026-12-07T09:00:00Z".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/threads.snooze \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"ids":["t_5d2c8a1f9e3b47c6a0d1e2f3"],"until":"2026-12-07T09:00:00Z"}}'

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 threads snooze --ids t_5d2c8a1f9e3b47c6a0d1e2f3 --until 2026-12-07T09:00:00Z
Response
{
  "ok": true,
  "data": {
    "updated": 1
  }
}

threads.unsnooze

Bring snoozed conversations back now.

POST/v1/threads.unsnooze

API token

Parameters

  • idsarray of stringsrequired

    The conversations’ ids, 1 to 200.

    1 to 200 items.

Returns

data is an object with:

  • updatednumber

    How many came back.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.threads.unsnooze({
	ids: [
		"t_5d2c8a1f9e3b47c6a0d1e2f3",
	],
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.threads.unsnooze(
    {"ids": ["t_5d2c8a1f9e3b47c6a0d1e2f3"]}
)
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.ThreadsUnsnoozeParams{
		IDs: []string{"t_5d2c8a1f9e3b47c6a0d1e2f3"},
	}
	answer, err := client.Threads.Unsnooze(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.threads.unsnooze(
  ids: ['t_5d2c8a1f9e3b47c6a0d1e2f3']
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->threads->unsnooze([
    'ids' => ['t_5d2c8a1f9e3b47c6a0d1e2f3'],
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ThreadsUnsnoozeParams;
import app.mailset.model.ThreadsUnsnoozeResult;
import java.util.List;

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

var params = ThreadsUnsnoozeParams.builder()
        .ids(List.of("t_5d2c8a1f9e3b47c6a0d1e2f3"))
        .build();
ThreadsUnsnoozeResult answer =
        mailset.threads().unsnooze(params);
System.out.println(answer);
use mailset::types::ThreadsUnsnoozeParams;

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

let answer = mailset
    .threads()
    .unsnooze(ThreadsUnsnoozeParams {
        ids: vec!["t_5d2c8a1f9e3b47c6a0d1e2f3".into()],
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/threads.unsnooze \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"ids":["t_5d2c8a1f9e3b47c6a0d1e2f3"]}}'

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 threads unsnooze --ids t_5d2c8a1f9e3b47c6a0d1e2f3
Response
{
  "ok": true,
  "data": {
    "updated": 1
  }
}

threads.classify

Move conversations to a tab, and keep them there.

POST/v1/threads.classify

API token

Parameters

  • idsarray of stringsrequired

    The conversations’ ids, 1 to 200.

    1 to 200 items.

  • tabenumrequired

    The tab they go to.

    One ofprimaryupdatesnewsletterspromotions

Returns

data is an object with:

  • updatednumber

    How many moved.

  • sendersarray of strings

    Who each one is from, so the app can offer to remember it.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.threads.classify({
	ids: [
		"t_5d2c8a1f9e3b47c6a0d1e2f3",
		"t_b7e41c9a2f6d4083c5a9e1b2",
	],
	tab: "newsletters",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.threads.classify(
    {
        "ids": [
            "t_5d2c8a1f9e3b47c6a0d1e2f3",
            "t_b7e41c9a2f6d4083c5a9e1b2",
        ],
        "tab": "newsletters",
    }
)
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.ThreadsClassifyParams{
require 'mailset'

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

answer = mailset.threads.classify(
  ids: [
    't_5d2c8a1f9e3b47c6a0d1e2f3',
    't_b7e41c9a2f6d4083c5a9e1b2'
  ],
  tab: 'newsletters'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->threads->classify([
    'ids' => [
        't_5d2c8a1f9e3b47c6a0d1e2f3',
        't_b7e41c9a2f6d4083c5a9e1b2',
    ],
    'tab' => 'newsletters',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.InboxTabName;
import app.mailset.model.ThreadsClassifyParams;
import app.mailset.model.ThreadsClassifyResult;
import java.util.List;

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

var params = ThreadsClassifyParams.builder()
        .ids(List.of(
                "t_5d2c8a1f9e3b47c6a0d1e2f3",
                "t_b7e41c9a2f6d4083c5a9e1b2"))
        .tab(InboxTabName.NEWSLETTERS)
        .build();
ThreadsClassifyResult answer =
        mailset.threads().classify(params);
System.out.println(answer);
use mailset::types::{
    InboxTabName, ThreadsClassifyParams,
};

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

let answer = mailset
    .threads()
    .classify(ThreadsClassifyParams {
        ids: vec![
            "t_5d2c8a1f9e3b47c6a0d1e2f3".into(),
            "t_b7e41c9a2f6d4083c5a9e1b2".into(),
        ],
        tab: InboxTabName::Newsletters,
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/threads.classify \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"ids":["t_5d2c8a1f9e3b47c6a0d1e2f3","t_b7e41c9a2f6d4083c5a9e1b2"],"tab":"newsletters"}}'

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 threads classify --ids t_5d2c8a1f9e3b47c6a0d1e2f3,t_b7e41c9a2f6d4083c5a9e1b2 --tab newsletters
Response
{
  "ok": true,
  "data": {
    "updated": 1,
    "senders": [
      "moc.elpmaxe@olleh"
    ]
  }
}