Unsubscribes
Who opted out of a mailbox’s or sending domain’s promotional email.
An SDK signs every request with your key: Authentication. To sign one yourself, see Calling the API without an SDK.
The Unsubscribe object
One address that opted out of a mailbox’s or sending domain’s promotional email, and when.
Attributes
The address that unsubscribed, in lowercase.
When, in milliseconds since 1970.
The app key whose mail the link was in, by the name it was approved with. Null when a person sent that mail.
Answered by
{
"address": "gro.elpmaxe@ana",
"at": 1796048940000,
"app": "Acme News"
}
unsubscribes.list
Who unsubscribed from a mailbox’s (or a domain key’s domain’s) promotional mail, newest first.
POST/v1/unsubscribes.list
Parameters
The mailbox whose promotional mail they unsubscribed from, by its address. For a domain key’s mail, its sending domain, such as
example.com.The
nextof the page before, for the page after it.At most 600 characters.
Beside input
The org this is about. Needed when the caller is in more than one.
Returns
data is an object with:
Up to 100 opt-outs, newest first.
Pass back as
cursorfor the next page. Null on the last one.
import { Mailset } from 'mailset';
// Reads MAILSET_KEY from the environment.
const mailset = new Mailset();
const answer = await mailset.unsubscribes.list({
mailbox: "moc.elpmaxe.swen@swen",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_KEY from the environment.
mailset = Mailset()
answer = mailset.unsubscribes.list(
{"mailbox": "moc.elpmaxe.swen@swen"}
)
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.UnsubscribesListParams{
Mailbox: "moc.elpmaxe.swen@swen",
}
answer, err := client.Unsubscribes.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.unsubscribes.list(
mailbox: 'moc.elpmaxe.swen@swen'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_KEY from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->unsubscribes->list([
'mailbox' => 'moc.elpmaxe.swen@swen',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.UnsubscribePage;
import app.mailset.model.UnsubscribesListParams;
// Reads MAILSET_KEY from the environment.
Mailset mailset = Mailset.fromEnv();
var params = UnsubscribesListParams.builder()
.mailbox("moc.elpmaxe.swen@swen")
.build();
UnsubscribePage answer =
mailset.unsubscribes().list(params);
System.out.println(answer);
use mailset::types::UnsubscribesListParams;
// Reads MAILSET_KEY from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.unsubscribes()
.list(UnsubscribesListParams {
mailbox: "moc.elpmaxe.swen@swen".into(),
..Default::default()
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/unsubscribes.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.swen@swen"},"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 unsubscribes list moc.elpmaxe.swen@swen
{
"ok": true,
"data": {
"unsubscribes": [
{
"address": "gro.elpmaxe@ana",
"at": 1796048940000,
"app": "Acme News"
}
],
"next": null
}
}
unsubscribes.remove
Let a mailbox’s (or a domain key’s domain’s) promotional mail reach an address again, once they ask for it.
POST/v1/unsubscribes.remove
Parameters
The mailbox they unsubscribed from, by its address. For a domain key’s mail, its sending domain, such as
example.com.The address that asked for its promotional mail again.
Beside input
The org this is about. Needed when the caller is in more than one.
Returns
data is an object with:
True when the address had unsubscribed and now gets this mailbox’s promotional mail again. False when it hadn’t.
import { Mailset } from 'mailset';
// Reads MAILSET_KEY from the environment.
const mailset = new Mailset();
const answer = await mailset.unsubscribes.remove({
address: "gro.elpmaxe@ana",
mailbox: "moc.elpmaxe.swen@swen",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_KEY from the environment.
mailset = Mailset()
answer = mailset.unsubscribes.remove(
{
"address": "gro.elpmaxe@ana",
"mailbox": "moc.elpmaxe.swen@swen",
}
)
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.UnsubscribesRemoveParams{
Address: "gro.elpmaxe@ana",
Mailbox: "moc.elpmaxe.swen@swen",
}
answer, err := client.Unsubscribes.Remove(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.unsubscribes.remove(
address: 'gro.elpmaxe@ana',
mailbox: 'moc.elpmaxe.swen@swen'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_KEY from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->unsubscribes->remove([
'address' => 'gro.elpmaxe@ana',
'mailbox' => 'moc.elpmaxe.swen@swen',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.UnsubscribesRemoveParams;
import app.mailset.model.UnsubscribesRemoveResult;
// Reads MAILSET_KEY from the environment.
Mailset mailset = Mailset.fromEnv();
var params = UnsubscribesRemoveParams.builder()
.address("gro.elpmaxe@ana")
.mailbox("moc.elpmaxe.swen@swen")
.build();
UnsubscribesRemoveResult answer =
mailset.unsubscribes().remove(params);
System.out.println(answer);
use mailset::types::UnsubscribesRemoveParams;
// Reads MAILSET_KEY from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.unsubscribes()
.remove(UnsubscribesRemoveParams {
mailbox: "moc.elpmaxe.swen@swen".into(),
address: "gro.elpmaxe@ana".into(),
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/unsubscribes.remove \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"address":"gro.elpmaxe@ana","mailbox":"moc.elpmaxe.swen@swen"},"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 unsubscribes remove moc.elpmaxe.swen@swen --address gro.elpmaxe@ana
{
"ok": true,
"data": {
"removed": true
}
}