Exports
A copy of your whole account, to download.
An SDK signs every request with your key: Authentication. To sign one yourself, see Calling the API without an SDK.
exports.start
Start an export of your whole account.
POST/v1/exports.start
Parameters
It takes no input: send an empty object.
Returns
data is an object with:
One of
runningreadyfailedcancelledMessages written, and how many there are to write.
When the archive is deleted.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.exports.start();
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.exports.start()
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.Exports.Start(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(answer)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.exports.start
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->exports->start();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Export;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
Export answer = mailset.exports().start();
System.out.println(answer);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset.exports().start().await?;
println!("{answer:?}");
curl https://mailset.app/v1/exports.start \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{}}'
curl can’t sign a request. $TOKEN is your credential’s token, and $MS_TIME and $MS_PROOF sign this exact body: Calling the API without an SDK shows how.
mailset exports start
{
"ok": true,
"data": {
"id": "out_3f9a1c0e7b2d",
"state": "running",
"done": 1,
"total": 12,
"skipped": 1,
"bytes": 20480,
"reason": "The day’s sending limit is reached.",
"createdAt": 1796048940000,
"finishedAt": 1796048940000,
"expiresAt": 1796048940000
}
}
exports.list
Show your data exports.
POST/v1/exports.list
Parameters
It takes no input: send an empty object.
Returns
data is a list of objects, each with:
One of
runningreadyfailedcancelledMessages written, and how many there are to write.
When the archive is deleted.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.exports.list();
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.exports.list()
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.Exports.List(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(answer)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.exports.list
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->exports->list();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Export;
import java.util.List;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
List<Export> answer = mailset.exports().list();
System.out.println(answer);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset.exports().list().await?;
println!("{answer:?}");
curl https://mailset.app/v1/exports.list \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{}}'
curl can’t sign a request. $TOKEN is your credential’s token, and $MS_TIME and $MS_PROOF sign this exact body: Calling the API without an SDK shows how.
mailset exports list
{
"ok": true,
"data": [
{
"id": "out_3f9a1c0e7b2d",
"state": "running",
"done": 1,
"total": 12,
"skipped": 1,
"bytes": 20480,
"reason": "The day’s sending limit is reached.",
"createdAt": 1796048940000,
"finishedAt": 1796048940000,
"expiresAt": 1796048940000
}
]
}
exports.cancel
Stop an export, or delete a finished one.
POST/v1/exports.cancel
Parameters
The export’s id, from
exports list.
Returns
data is an object with:
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.exports.cancel({
id: "exp_6f1a9c3e7b2d4058a4c1e9b7",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.exports.cancel(
{"id": "exp_6f1a9c3e7b2d4058a4c1e9b7"}
)
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.ExportsCancelParams{
ID: "exp_6f1a9c3e7b2d4058a4c1e9b7",
}
answer, err := client.Exports.Cancel(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.exports.cancel(
id: 'exp_6f1a9c3e7b2d4058a4c1e9b7'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->exports->cancel([
'id' => 'exp_6f1a9c3e7b2d4058a4c1e9b7',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ExportsCancelParams;
import app.mailset.model.ExportsCancelResult;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ExportsCancelParams.builder()
.id("exp_6f1a9c3e7b2d4058a4c1e9b7")
.build();
ExportsCancelResult answer =
mailset.exports().cancel(params);
System.out.println(answer);
use mailset::types::ExportsCancelParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.exports()
.cancel(ExportsCancelParams {
id: "exp_6f1a9c3e7b2d4058a4c1e9b7".into(),
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/exports.cancel \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"id":"exp_6f1a9c3e7b2d4058a4c1e9b7"}}'
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 exports cancel exp_6f1a9c3e7b2d4058a4c1e9b7
{
"ok": true,
"data": {
"cancelled": true
}
}
exports.link
Get a short-lived download link for an export.
POST/v1/exports.link
Parameters
The export’s id, from
exports list.
Beside input
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.exports.link({
id: "exp_6f1a9c3e7b2d4058a4c1e9b7",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.exports.link(
{"id": "exp_6f1a9c3e7b2d4058a4c1e9b7"}
)
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.ExportsLinkParams{
ID: "exp_6f1a9c3e7b2d4058a4c1e9b7",
}
answer, err := client.Exports.Link(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.exports.link(
id: 'exp_6f1a9c3e7b2d4058a4c1e9b7'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->exports->link([
'id' => 'exp_6f1a9c3e7b2d4058a4c1e9b7',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.ExportLink;
import app.mailset.model.ExportsLinkParams;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = ExportsLinkParams.builder()
.id("exp_6f1a9c3e7b2d4058a4c1e9b7")
.build();
ExportLink answer = mailset.exports().link(params);
System.out.println(answer);
use mailset::types::ExportsLinkParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.exports()
.link(ExportsLinkParams {
id: "exp_6f1a9c3e7b2d4058a4c1e9b7".into(),
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/exports.link \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"id":"exp_6f1a9c3e7b2d4058a4c1e9b7"}}'
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 exports link exp_6f1a9c3e7b2d4058a4c1e9b7
{
"ok": true,
"data": {
"url": "https://hooks.example.com/mailset",
"expiresAt": 1796048940000
}
}