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
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
Parameters
It takes no input: send an empty object.
Beside input
The org this is about. Needed when the caller is in more than one.
An approval’s id, once someone approved it with their passkey. Without one, the answer is
step_up_requiredand names what to approve.
Returns
data is an object with:
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
{
"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
Parameters
It takes no input: send an empty object.
Beside input
The org this is about. Needed when the caller is in more than one.
Returns
data is an object with:
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
{
"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
Parameters
Only addresses at this domain.
Beside input
The org this is about. Needed when the caller is in more than one.
Returns
data is an object with:
Whether a Google org can be connected.
Addresses past the most one call asks about: name a domain to see them.
Why Google couldn’t answer for some or all of them.
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
{
"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
Parameters
The sending address the Google user is for.
The user’s name, as “First Last”.
At most 121 characters.
The photo, base64.
The photo file’s name.
At most 255 characters.
Beside input
The org this is about. Needed when the caller is in more than one.
An approval’s id, once someone approved it with their passkey. Without one, the answer is
step_up_requiredand names what to approve.
The body may be up to 1 MB.
Returns
data is an object with:
The subdomain Mailset added to the Google org first, when it had to.
none: no photo was given.failed: the user exists, and the photo didn’t go.One of
setnonefailed
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
{
"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
Parameters
The sending address whose Google user gets the photo.
The photo, base64.
The photo file’s name.
At most 255 characters.
Beside input
The org this is about. Needed when the caller is in more than one.
An approval’s id, once someone approved it with their passkey. Without one, the answer is
step_up_requiredand names what to approve.
The body may be up to 1 MB.
Returns
data is an object with:
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
{
"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
Parameters
Only this mailbox’s senders.
Only senders whose name or address has this in it.
At most 100 characters.
Returns
data is a list of objects, each with:
The mailbox they write to.
Their address.
Their name, or null when their mail gave none.
newuntil you decide, thenallowedorblocked.One of
newallowedblockedHow many messages of theirs are kept, outside Junk and Trash.
How many of those were opened.
How many arrived in the last 90 days.
How many of the recent ones were opened.
When their first message came, in milliseconds since 1970. Null when nothing of theirs is kept.
When their newest message came, in milliseconds since 1970. Null when nothing of theirs is kept.
The tab their latest conversation is in.
One of
primaryupdatesnewsletterspromotionsWhat their latest message is about, for a sender still to decide on.
When they were blocked, in milliseconds since 1970, or null.
How many of their messages were discarded since the block.
A blocked sender: whether they were asked to stop sending, too.
One of
pendingsentfailednoneTheir picture, or null for initials.
Mailset’s own sign-in, security and billing mail: never new, and it can’t be blocked. Present only when true.
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
{
"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
Parameters
One of your mailboxes, by address.
The sender’s address.
Returns
data is an object with:
True when the sender was new and is now allowed.
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
{
"ok": true,
"data": {
"kept": true
}
}
senders.get
Show how one sender’s mail arrived and what they wrote lately.
POST/v1/senders.get
Parameters
One of your mailboxes, by address.
The sender’s address.
Returns
data is an object with:
The mailbox they write to.
Their address.
How their newest message arrived. Null when nothing of theirs is kept, or it was imported.
Their newest message was imported: whether Google, where it arrived, said it is really from their domain.
Their newest message was filed here by Mailset itself. Present only when true.
You have written in one of their conversations.
Their newest conversations, newest first.
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
{
"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
Parameters
One of your mailboxes, by address.
The sender’s address.
Returns
data is an object with:
One of
sentfailedlinknone
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
{
"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
Parameters
One of your mailboxes, by address.
The sender’s address.
Returns
data is an object with:
The conversations moved, and where each was.
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
{
"ok": true,
"data": {
"threads": [
{
"id": "out_3f9a1c0e7b2d",
"from": "inbox"
}
]
}
}