Senders

Senders

Photos for the addresses you send from, and who writes to you.

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

On this page
  1. senders.connect
  2. senders.disconnect
  3. senders.accounts
  4. senders.create
  5. senders.photo
  6. senders.list
  7. senders.keep
  8. senders.get
  9. senders.unsubscribe
  10. senders.trash

senders.connect

Connect your Google Workspace or Cloud Identity org, so Mailset can make the Google users behind sender photos: opens Google.

POST/v1/senders.connect

Admin or ownerPasskey

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.

  • 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:

  • urlstring

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.senders.connect();
console.log(answer);
from mailset import Mailset

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

answer = mailset.senders.connect()
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.Senders.Connect(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.senders.connect
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->senders->connect();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendersConnectResult;

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

SendersConnectResult answer = mailset.senders().connect();
System.out.println(answer);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.senders().connect().await?;
println!("{answer:?}");
curl https://mailset.app/v1/senders.connect \
  -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 senders connect
Response
{
  "ok": true,
  "data": {
    "url": "https://hooks.example.com/mailset"
  }
}

senders.disconnect

End Mailset’s access to your Google org at Google.

POST/v1/senders.disconnect

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 an object with:

  • disconnectedboolean

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.senders.disconnect();
console.log(answer);
from mailset import Mailset

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

answer = mailset.senders.disconnect()
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.Senders.Disconnect(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.senders.disconnect
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->senders->disconnect();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendersDisconnectResult;

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

SendersDisconnectResult answer =
        mailset.senders().disconnect();
System.out.println(answer);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.senders().disconnect().await?;
println!("{answer:?}");
curl https://mailset.app/v1/senders.disconnect \
  -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 senders disconnect
Response
{
  "ok": true,
  "data": {
    "disconnected": true
  }
}

senders.accounts

The addresses you send from, and whether each has a Google user with a photo, the picture Gmail shows beside your mail. A domain narrows it.

POST/v1/senders.accounts

Admin or owner

Parameters

  • domainstringoptional

    Only addresses at this domain.

Beside input

  • orgstringoptional

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

Returns

data is an object with:

  • availableboolean

    Whether a Google org can be connected.

  • connectionnullable object
    Show child attributesHide child attributes
    • stateenum

      One ofconnectedlost

    • accountstring

      The Google admin who connected it.

    • reasonnullable string
    • connectedAtnumber
  • addressesarray of objects
    Show child attributesHide child attributes
    • addressstring
    • usesarray of enums

      One ofmailboxaliascampaign

    • googleenum

      One ofuseraliasnonedomain_missingdomain_unverifieddomain_pendingunknown

    • aliasOfnullable string
    • photonullable boolean

      Null when there’s no user to have one.

  • morenumber

    Addresses past the most one call asks about: name a domain to see them.

  • problemnullable string

    Why Google couldn’t answer for some or all of them.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.senders.accounts({
	domain: "example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.senders.accounts(
    {"domain": "example.com"}
)
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.SendersAccountsParams{
		Domain: mailset.String("example.com"),
	}
	answer, err := client.Senders.Accounts(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.senders.accounts(domain: 'example.com')
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->senders->accounts([
    'domain' => 'example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SenderAccounts;
import app.mailset.model.SendersAccountsParams;

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

var params = SendersAccountsParams.builder()
        .domain("example.com")
        .build();
SenderAccounts answer =
        mailset.senders().accounts(params);
System.out.println(answer);
use mailset::types::SendersAccountsParams;

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

let answer = mailset
    .senders()
    .accounts(SendersAccountsParams {
        domain: Some("example.com".into()),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/senders.accounts \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"domain":"example.com"},"org":"org_3f9a1c0e7b2d"}'

curl can’t sign a request. $TOKEN is your credential’s token, and $MS_TIME and $MS_PROOF sign this exact body: Calling the API without an SDK shows how.

mailset senders accounts example.com
Response
{
  "ok": true,
  "data": {
    "available": true,
    "connection": {
      "state": "connected",
      "account": "text",
      "reason": "The day’s sending limit is reached.",
      "connectedAt": 1796048940000
    },
    "addresses": [
      {
        "address": "moc.elpmaxe@olleh",
        "uses": [
          "mailbox"
        ],
        "google": "user",
        "aliasOf": "text",
        "photo": true
      }
    ],
    "more": 1,
    "problem": "text"
  }
}

senders.create

Make the Google user for a sending address, so Gmail shows its photo.

POST/v1/senders.create

Admin or ownerPasskey

Parameters

  • addressstringrequired

    The sending address the Google user is for.

  • namestringrequired

    The user’s name, as “First Last”.

    At most 121 characters.

  • photostringoptional

    The photo, base64.

  • photoNamestringoptional

    The photo file’s name.

    At most 255 characters.

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.

The body may be up to 1 MB.

Returns

data is an object with:

  • addressstring
  • domainAddednullable string

    The subdomain Mailset added to the Google org first, when it had to.

  • photoenum

    none: no photo was given. failed: the user exists, and the photo didn’t go.

    One ofsetnonefailed

  • photoProblemnullable string
  • licencestring
  • visibilitystring
  • guidestring

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.senders.create({
	name: "Acme Team",
	photo: "<base64 of the file>",
	address: "moc.elpmaxe@olleh",
	photoName: "logo.png",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.senders.create(
    {
        "name": "Acme Team",
        "photo": "<base64 of the file>",
        "address": "moc.elpmaxe@olleh",
        "photo_name": "logo.png",
    }
)
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.SendersCreateParams{
require 'mailset'

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

answer = mailset.senders.create(
  name: 'Acme Team',
  photo: '<base64 of the file>',
  address: 'moc.elpmaxe@olleh',
  photo_name: 'logo.png'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->senders->create([
    'name' => 'Acme Team',
    'photo' => '<base64 of the file>',
    'address' => 'moc.elpmaxe@olleh',
    'photoName' => 'logo.png',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SenderCreated;
import app.mailset.model.SendersCreateParams;

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

var params = SendersCreateParams.builder()
        .name("Acme Team")
        .photo("<base64 of the file>")
        .address("moc.elpmaxe@olleh")
        .photoName("logo.png")
        .build();
SenderCreated answer = mailset.senders().create(params);
System.out.println(answer);
use mailset::types::SendersCreateParams;

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

let answer = mailset
    .senders()
    .create(SendersCreateParams {
        address: "moc.elpmaxe@olleh".into(),
        name: "Acme Team".into(),
        photo: Some("<base64 of the file>".into()),
        photo_name: Some("logo.png".into()),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/senders.create \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"name":"Acme Team","photo":"<base64 of the file>","address":"moc.elpmaxe@olleh","photoName":"logo.png"},"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 senders create moc.elpmaxe@olleh --name "Acme Team" --photo logo.png
Response
{
  "ok": true,
  "data": {
    "address": "moc.elpmaxe@olleh",
    "domainAdded": "text",
    "photo": "set",
    "photoProblem": "text",
    "licence": "text",
    "visibility": "text",
    "guide": "text"
  }
}

senders.photo

Replace the photo of a sending address’s Google user.

POST/v1/senders.photo

Admin or ownerPasskey

Parameters

  • addressstringrequired

    The sending address whose Google user gets the photo.

  • filestringrequired

    The photo, base64.

  • fileNamestringoptional

    The photo file’s name.

    At most 255 characters.

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.

The body may be up to 1 MB.

Returns

data is an object with:

  • addressstring
  • visibilitystring
  • guidestring

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.senders.photo({
	file: "<base64 of the file>",
	address: "moc.elpmaxe@olleh",
	fileName: "logo.png",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.senders.photo(
    {
        "file": "<base64 of the file>",
        "address": "moc.elpmaxe@olleh",
        "file_name": "logo.png",
    }
)
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.SendersPhotoParams{
require 'mailset'

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

answer = mailset.senders.photo(
  file: '<base64 of the file>',
  address: 'moc.elpmaxe@olleh',
  file_name: 'logo.png'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->senders->photo([
    'file' => '<base64 of the file>',
    'address' => 'moc.elpmaxe@olleh',
    'fileName' => 'logo.png',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SenderPhotoSet;
import app.mailset.model.SendersPhotoParams;

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

var params = SendersPhotoParams.builder()
        .file("<base64 of the file>")
        .address("moc.elpmaxe@olleh")
        .fileName("logo.png")
        .build();
SenderPhotoSet answer = mailset.senders().photo(params);
System.out.println(answer);
use mailset::types::SendersPhotoParams;

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

let answer = mailset
    .senders()
    .photo(SendersPhotoParams {
        address: "moc.elpmaxe@olleh".into(),
        file: "<base64 of the file>".into(),
        file_name: Some("logo.png".into()),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/senders.photo \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"file":"<base64 of the file>","address":"moc.elpmaxe@olleh","fileName":"logo.png"},"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 senders photo moc.elpmaxe@olleh --file logo.png
Response
{
  "ok": true,
  "data": {
    "address": "moc.elpmaxe@olleh",
    "visibility": "text",
    "guide": "text"
  }
}

senders.list

List who writes to your mailboxes, and how much of it you open.

POST/v1/senders.list

API token

Parameters

  • mailboxstringoptional

    Only this mailbox’s senders.

  • querystringoptional

    Only senders whose name or address has this in it.

    At most 100 characters.

Returns

data is a list of objects, each with:

  • mailboxstring

    The mailbox they write to.

  • addressstring

    Their address.

  • namenullable string

    Their name, or null when their mail gave none.

  • stateenum

    new until you decide, then allowed or blocked.

    One ofnewallowedblocked

  • countnumber

    How many messages of theirs are kept, outside Junk and Trash.

  • openednumber

    How many of those were opened.

  • recentnumber

    How many arrived in the last 90 days.

  • recentOpenednumber

    How many of the recent ones were opened.

  • firstAtnullable number

    When their first message came, in milliseconds since 1970. Null when nothing of theirs is kept.

  • lastAtnullable number

    When their newest message came, in milliseconds since 1970. Null when nothing of theirs is kept.

  • tabnullable enum

    The tab their latest conversation is in.

    One ofprimaryupdatesnewsletterspromotions

  • subjectnullable string

    What their latest message is about, for a sender still to decide on.

  • blockedAtnullable number

    When they were blocked, in milliseconds since 1970, or null.

  • discardednumber

    How many of their messages were discarded since the block.

  • unsubscribenullable enum

    A blocked sender: whether they were asked to stop sending, too.

    One ofpendingsentfailednone

  • picturenullable object

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

  • mailsetbooleanoptional

    Mailset’s own sign-in, security and billing mail: never new, and it can’t be blocked. 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.senders.list({
	mailbox: "moc.elpmaxe@ana",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.senders.list(
    {"mailbox": "moc.elpmaxe@ana"}
)
print(answer)
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.SendersListParams{
		Mailbox: mailset.String("moc.elpmaxe@ana"),
	}
	answer, err := client.Senders.List(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.senders.list(mailbox: 'moc.elpmaxe@ana')
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->senders->list([
    'mailbox' => 'moc.elpmaxe@ana',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Sender;
import app.mailset.model.SendersListParams;
import java.util.List;

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

var params = SendersListParams.builder()
        .mailbox("moc.elpmaxe@ana")
        .build();
List<Sender> answer = mailset.senders().list(params);
System.out.println(answer);
use mailset::types::SendersListParams;

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

let answer = mailset
    .senders()
    .list(SendersListParams {
        mailbox: Some("moc.elpmaxe@ana".into()),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/senders.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"}}'

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 senders list --mailbox moc.elpmaxe@ana
Response
{
  "ok": true,
  "data": [
    {
      "mailbox": "text",
      "address": "moc.elpmaxe@olleh",
      "name": "Acme API",
      "state": "new",
      "count": 12,
      "opened": 1,
      "recent": 1,
      "recentOpened": 1,
      "firstAt": 1796048940000,
      "lastAt": 1796048940000,
      "tab": "primary",
      "subject": "Your Acme receipt",
      "blockedAt": 1796048940000,
      "discarded": 1,
      "unsubscribe": "pending",
      "picture": {
        "url": "https://hooks.example.com/mailset",
        "icon": true
      },
      "mailset": true
    }
  ]
}

senders.keep

Say yes to a new sender, so they stop showing as new.

POST/v1/senders.keep

API token

Parameters

  • mailboxstringrequired

    One of your mailboxes, by address.

  • addressstringrequired

    The sender’s address.

Returns

data is an object with:

  • keptboolean

    True when the sender was new and is now allowed.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.senders.keep({
	mailbox: "moc.elpmaxe@ana",
	address: "gro.elpmaxe@swen",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.senders.keep(
    {
        "mailbox": "moc.elpmaxe@ana",
        "address": "gro.elpmaxe@swen",
    }
)
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.SendersKeepParams{
		Mailbox: "moc.elpmaxe@ana",
		Address: "gro.elpmaxe@swen",
	}
	answer, err := client.Senders.Keep(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.senders.keep(
  mailbox: 'moc.elpmaxe@ana',
  address: 'gro.elpmaxe@swen'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->senders->keep([
    'mailbox' => 'moc.elpmaxe@ana',
    'address' => 'gro.elpmaxe@swen',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendersKeepParams;
import app.mailset.model.SendersKeepResult;

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

var params = SendersKeepParams.builder()
        .mailbox("moc.elpmaxe@ana")
        .address("gro.elpmaxe@swen")
        .build();
SendersKeepResult answer = mailset.senders().keep(params);
System.out.println(answer);
use mailset::types::SendersKeepParams;

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

let answer = mailset
    .senders()
    .keep(SendersKeepParams {
        mailbox: "moc.elpmaxe@ana".into(),
        address: "gro.elpmaxe@swen".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/senders.keep \
  -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","address":"gro.elpmaxe@swen"}}'

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 senders keep gro.elpmaxe@swen --mailbox moc.elpmaxe@ana
Response
{
  "ok": true,
  "data": {
    "kept": true
  }
}

senders.get

Show how one sender’s mail arrived and what they wrote lately.

POST/v1/senders.get

API token

Parameters

  • mailboxstringrequired

    One of your mailboxes, by address.

  • addressstringrequired

    The sender’s address.

Returns

data is an object with:

  • mailboxstring

    The mailbox they write to.

  • addressstring

    Their address.

  • authnullable object

    How their newest message arrived. Null when nothing of theirs is kept, or it was imported.

    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.

  • importedbooleanoptional

    Their newest message was imported: whether Google, where it arrived, said it is really from their domain.

  • byMailsetbooleanoptional

    Their newest message was filed here by Mailset itself. Present only when true.

  • answeredboolean

    You have written in one of their conversations.

  • threadsarray of Conversation objects

    Their newest conversations, newest first.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.senders.get({
	mailbox: "moc.elpmaxe@ana",
	address: "gro.elpmaxe@swen",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.senders.get(
    {
        "mailbox": "moc.elpmaxe@ana",
        "address": "gro.elpmaxe@swen",
    }
)
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.SendersGetParams{
		Mailbox: "moc.elpmaxe@ana",
		Address: "gro.elpmaxe@swen",
	}
	answer, err := client.Senders.Get(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.senders.get(
  mailbox: 'moc.elpmaxe@ana',
  address: 'gro.elpmaxe@swen'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->senders->get([
    'mailbox' => 'moc.elpmaxe@ana',
    'address' => 'gro.elpmaxe@swen',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SenderDetail;
import app.mailset.model.SendersGetParams;

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

var params = SendersGetParams.builder()
        .mailbox("moc.elpmaxe@ana")
        .address("gro.elpmaxe@swen")
        .build();
SenderDetail answer = mailset.senders().get(params);
System.out.println(answer);
use mailset::types::SendersGetParams;

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

let answer = mailset
    .senders()
    .get(SendersGetParams {
        mailbox: "moc.elpmaxe@ana".into(),
        address: "gro.elpmaxe@swen".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/senders.get \
  -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","address":"gro.elpmaxe@swen"}}'

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 senders get gro.elpmaxe@swen --mailbox moc.elpmaxe@ana
Response
{
  "ok": true,
  "data": {
    "mailbox": "text",
    "address": "moc.elpmaxe@olleh",
    "auth": {
      "tls": true,
      "spf": true,
      "dkim": true,
      "dmarc": true,
      "forged": true
    },
    "imported": true,
    "byMailset": true,
    "answered": true,
    "threads": [
      {
        "id": "out_3f9a1c0e7b2d",

senders.unsubscribe

Ask a sender to stop writing to one mailbox, by the newest mail they sent it.

POST/v1/senders.unsubscribe

API token

Parameters

  • mailboxstringrequired

    One of your mailboxes, by address.

  • addressstringrequired

    The sender’s address.

Returns

data is an object with:

  • stateenum

    One ofsentfailedlinknone

  • urlstringoptional

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.senders.unsubscribe({
	mailbox: "moc.elpmaxe@ana",
	address: "gro.elpmaxe@swen",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.senders.unsubscribe(
    {
        "mailbox": "moc.elpmaxe@ana",
        "address": "gro.elpmaxe@swen",
    }
)
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.SendersUnsubscribeParams{
		Mailbox: "moc.elpmaxe@ana",
		Address: "gro.elpmaxe@swen",
	}
	answer, err := client.Senders.Unsubscribe(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.senders.unsubscribe(
  mailbox: 'moc.elpmaxe@ana',
  address: 'gro.elpmaxe@swen'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->senders->unsubscribe([
    'mailbox' => 'moc.elpmaxe@ana',
    'address' => 'gro.elpmaxe@swen',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendersUnsubscribeParams;
import app.mailset.model.UnsubscribeResult;

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

var params = SendersUnsubscribeParams.builder()
        .mailbox("moc.elpmaxe@ana")
        .address("gro.elpmaxe@swen")
        .build();
UnsubscribeResult answer =
        mailset.senders().unsubscribe(params);
System.out.println(answer);
use mailset::types::SendersUnsubscribeParams;

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

let answer = mailset
    .senders()
    .unsubscribe(SendersUnsubscribeParams {
        mailbox: "moc.elpmaxe@ana".into(),
        address: "gro.elpmaxe@swen".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/senders.unsubscribe \
  -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","address":"gro.elpmaxe@swen"}}'

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 senders unsubscribe gro.elpmaxe@swen --mailbox moc.elpmaxe@ana
Response
{
  "ok": true,
  "data": {
    "state": "sent",
    "url": "https://hooks.example.com/mailset"
  }
}

senders.trash

Move what a sender sent to one mailbox into Trash.

POST/v1/senders.trash

API token

Parameters

  • mailboxstringrequired

    One of your mailboxes, by address.

  • addressstringrequired

    The sender’s address.

Returns

data is an object with:

  • threadsarray of objects

    The conversations moved, and where each was.

    Show child attributesHide child attributes
    • idstring

      The conversation’s id.

    • fromenum

      Where it was, so the move can be undone.

      One ofinboxarchived

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.senders.trash({
	mailbox: "moc.elpmaxe@ana",
	address: "ten.elpmaxe@sreffo",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.senders.trash(
    {
        "mailbox": "moc.elpmaxe@ana",
        "address": "ten.elpmaxe@sreffo",
    }
)
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.SendersTrashParams{
		Mailbox: "moc.elpmaxe@ana",
		Address: "ten.elpmaxe@sreffo",
	}
	answer, err := client.Senders.Trash(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.senders.trash(
  mailbox: 'moc.elpmaxe@ana',
  address: 'ten.elpmaxe@sreffo'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->senders->trash([
    'mailbox' => 'moc.elpmaxe@ana',
    'address' => 'ten.elpmaxe@sreffo',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendersTrashParams;
import app.mailset.model.SendersTrashResult;

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

var params = SendersTrashParams.builder()
        .mailbox("moc.elpmaxe@ana")
        .address("ten.elpmaxe@sreffo")
        .build();
SendersTrashResult answer =
        mailset.senders().trash(params);
System.out.println(answer);
use mailset::types::SendersTrashParams;

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

let answer = mailset
    .senders()
    .trash(SendersTrashParams {
        mailbox: "moc.elpmaxe@ana".into(),
        address: "ten.elpmaxe@sreffo".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/senders.trash \
  -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","address":"ten.elpmaxe@sreffo"}}'

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 senders trash ten.elpmaxe@sreffo --mailbox moc.elpmaxe@ana
Response
{
  "ok": true,
  "data": {
    "threads": [
      {
        "id": "out_3f9a1c0e7b2d",
        "from": "inbox"
      }
    ]
  }
}