Exports

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.

On this page
  1. exports.start
  2. exports.list
  3. exports.cancel
  4. exports.link

exports.start

Start an export of your whole account.

POST/v1/exports.start

API token

Parameters

It takes no input: send an empty object.

Returns

data is an object with:

  • idstring
  • stateenum

    One ofrunningreadyfailedcancelled

  • donenumber

    Messages written, and how many there are to write.

  • totalnumber
  • skippednumber
  • bytesnumber
  • reasonnullable string
  • createdAtnumber
  • finishedAtnullable number
  • expiresAtnullable number

    When the archive is deleted.

In the CLIErrors

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
Response
{
  "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

API token

Parameters

It takes no input: send an empty object.

Returns

data is a list of objects, each with:

  • idstring
  • stateenum

    One ofrunningreadyfailedcancelled

  • donenumber

    Messages written, and how many there are to write.

  • totalnumber
  • skippednumber
  • bytesnumber
  • reasonnullable string
  • createdAtnumber
  • finishedAtnullable number
  • expiresAtnullable number

    When the archive is deleted.

In the CLIErrors

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
Response
{
  "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

API token

Parameters

  • idstringrequired

    The export’s id, from exports list.

Returns

data is an object with:

  • cancelledboolean

In the CLIErrors

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
Response
{
  "ok": true,
  "data": {
    "cancelled": true
  }
}