Sending domains

Sending domains

Sending-only subdomains, their suppressions, and your org’s limits.

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

On this page
  1. The Sending domain object
  2. The Suppression object
  3. sending.domains.add
  4. sending.domains.check
  5. sending.domains.list
  6. sending.domains.remove
  7. sending.domains.route
  8. sending.submit
  9. sending.domains.resume
  10. sending.suppressions.list
  11. sending.suppressions.remove
  12. sending.status

The Sending domain object

A subdomain that only sends: its DNS records and whether it can send.

Attributes

  • domainstring

    The sending domain.

  • trackingDomainnullable string

    Where its links and opens go. Null: its mail is never tracked.

  • stateenum

    pending: not ready yet. ready: it can send. failing: it was ready and a check stopped passing. paused: its brake stopped its mail.

    One ofpendingreadyfailingpaused

  • checksobject

    What the last check found.

    Show child attributesHide child attributes
    • dkimboolean

      Its DKIM records are in place.

    • bounceboolean

      Its bounce record is in place.

    • trackingboolean

      The tracking domain points at Mailset. False with no tracking domain.

    • trackingTlsboolean

      The tracking domain’s certificate is issued. False with no tracking domain.

  • recordsarray of objects

    The DNS records it needs, and whether each is in place.

    Show child attributesHide child attributes
    • purposeenum

      What the record is for: dkim and dkim2 sign its mail, bounce takes its bounces, tracking points the tracking domain at Mailset, mx takes mail for its aliases or route.

      One ofdkimdkim2bouncetrackingmx

    • typeenum

      The record’s type.

      One ofCNAMETXTMX

    • hoststring

      The record’s name, in full.

    • valuestring

      What the record has to hold.

    • prioritynumberoptional

      The MX’s priority. No other record has one.

    • okboolean

      Whether DNS answered with it at the last check.

  • pausednullable string

    Why its brake stopped its mail. Null while it may send.

  • routenullable string

    The hook every message to the domain goes to (sending domains route). Null without one.

  • createdAtnumber

    When it was added, in ms since the epoch.

  • connectarray of objectsoptional

    One-click setup (Domain Connect): links to the DNS host’s own page that add the records still missing, where the host has Mailset’s templates. Only on add and check. Open one in a browser to approve it there.

    Show child attributesHide child attributes
    • serviceenum

      Which of Mailset’s templates the page applies: mail, sending, tracking, park or logo.

      One ofmailsendingtrackingparklogo

    • urlstring

      The DNS host’s page where the domain’s owner approves the records.

    • recordsarray of objects

      What the page adds, as domains check lists them.

      Show child attributesHide child attributes
      • typestring

        The record’s type: CNAME, TXT or MX.

      • hoststring

        The record’s name, in full.

      • valuestring

        What the record holds.

      • prioritynullable number

        An MX’s priority. Null on any other record.

Answered by

sending.domains.addsending.domains.checksending.domains.listsending.domains.routesending.domains.resume

The Sending domain object
{
  "domain": "example.com",
  "trackingDomain": "example.com",
  "state": "pending",
  "checks": {
    "dkim": true,
    "bounce": true,
    "tracking": true,
    "trackingTls": true
  },
  "records": [
    {
      "purpose": "dkim",
      "type": "CNAME",
      "host": "text",
      "value": "text",
      "priority": 1,
      "ok": true

The Suppression object

An address a sending domain no longer writes to, and why.

Attributes

  • addressstring

    The address the domain won’t write to.

  • reasonstring

    bounced (a hard bounce of class mailbox, domain or suppressed) or complained (a spam report).

  • atnumber

    When it was suppressed, in ms since the epoch.

Answered by

sending.suppressions.list

The Suppression object
{
  "address": "moc.elpmaxe@olleh",
  "reason": "The day’s sending limit is reached.",
  "at": 1796048940000
}

sending.domains.add

Add a sending domain, with a tracking domain or without.

POST/v1/sending.domains.add

Campaigns keyAdmin or owner

Parameters

  • domainstringrequired

    The sending domain, such as news.example.com.

  • trackingDomainnullable stringoptional

    Where its links and opens go: a CNAME to Mailset’s link host, on the same registered domain. Left out, its mail is never tracked, and the domain may be the registered domain itself (example.com), for replies sent as its support address.

Beside input

  • orgstringoptional

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

Returns

data is the Sending domain object.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.sending.domains.add({
	trackingDomain: "link.example.com",
	domain: "news.example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.sending.domains.add(
    {
        "tracking_domain": "link.example.com",
        "domain": "news.example.com",
    }
)
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.SendingDomainsAddParams{
		TrackingDomain: mailset.String("link.example.com"),
		Domain:         "news.example.com",
	}
	answer, err := client.Sending.Domains.Add(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

# Reads MAILSET_KEY from the environment: a campaigns key.
mailset = Mailset::Client.new

answer = mailset.sending.domains.add(
  tracking_domain: 'link.example.com',
  domain: 'news.example.com'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->sending->domains->add([
    'trackingDomain' => 'link.example.com',
    'domain' => 'news.example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendingDomain;
import app.mailset.model.SendingDomainsAddParams;

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

var params = SendingDomainsAddParams.builder()
        .trackingDomain("link.example.com")
        .domain("news.example.com")
        .build();
SendingDomain answer =
        mailset.sending().domains().add(params);
System.out.println(answer);
use mailset::types::SendingDomainsAddParams;

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

let answer = mailset
    .sending()
    .domains()
    .add(SendingDomainsAddParams {
        domain: "news.example.com".into(),
        tracking_domain: Some(Some(
            "link.example.com".into(),
        )),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/sending.domains.add \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"trackingDomain":"link.example.com","domain":"news.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 sending domains add news.example.com --tracking-domain link.example.com
Response
{
  "ok": true,
  "data": {
    "domain": "example.com",
    "trackingDomain": "example.com",
    "state": "pending",
    "checks": {
      "dkim": true,
      "bounce": true,
      "tracking": true,
      "trackingTls": true
    },
    "records": [
      {
        "purpose": "dkim",
        "type": "CNAME",
        "host": "text",
        "value": "text",

sending.domains.check

Check a sending domain’s records and certificate now.

POST/v1/sending.domains.check

Campaigns keyAdmin or owner

Parameters

  • domainstringrequired

    The sending domain, such as news.example.com.

Beside input

  • orgstringoptional

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

Returns

data is the Sending domain object.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.sending.domains.check({
	domain: "news.example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.sending.domains.check(
    {"domain": "news.example.com"}
)
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.SendingDomainsCheckParams{
		Domain: "news.example.com",
	}
	answer, err := client.Sending.Domains.Check(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

# Reads MAILSET_KEY from the environment: a campaigns key.
mailset = Mailset::Client.new

answer = mailset.sending.domains.check(
  domain: 'news.example.com'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->sending->domains->check([
    'domain' => 'news.example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendingDomain;
import app.mailset.model.SendingDomainsCheckParams;

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

var params = SendingDomainsCheckParams.builder()
        .domain("news.example.com")
        .build();
SendingDomain answer =
        mailset.sending().domains().check(params);
System.out.println(answer);
use mailset::types::SendingDomainsCheckParams;

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

let answer = mailset
    .sending()
    .domains()
    .check(SendingDomainsCheckParams {
        domain: "news.example.com".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/sending.domains.check \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"domain":"news.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 sending domains check news.example.com
Response
{
  "ok": true,
  "data": {
    "domain": "example.com",
    "trackingDomain": "example.com",
    "state": "pending",
    "checks": {
      "dkim": true,
      "bounce": true,
      "tracking": true,
      "trackingTls": true
    },
    "records": [
      {
        "purpose": "dkim",
        "type": "CNAME",
        "host": "text",
        "value": "text",

sending.domains.list

List the sending domains, their checks and records.

POST/v1/sending.domains.list

Campaigns keyAdmin 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 a list of Sending domain objects.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.sending.domains.list();
console.log(answer);
from mailset import Mailset

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

answer = mailset.sending.domains.list()
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()
	answer, err := client.Sending.Domains.List(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

# Reads MAILSET_KEY from the environment: a campaigns key.
mailset = Mailset::Client.new

answer = mailset.sending.domains.list
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->sending->domains->list();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendingDomain;
import java.util.List;

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

List<SendingDomain> answer =
        mailset.sending().domains().list();
System.out.println(answer);
// Reads MAILSET_KEY from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.sending().domains().list().await?;
println!("{answer:?}");
curl https://mailset.app/v1/sending.domains.list \
  -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 sending domains list
Response
{
  "ok": true,
  "data": [
    {
      "domain": "example.com",
      "trackingDomain": "example.com",
      "state": "pending",
      "checks": {
        "dkim": true,
        "bounce": true,
        "tracking": true,
        "trackingTls": true
      },
      "records": [
        {
          "purpose": "dkim",
          "type": "CNAME",
          "host": "text",

sending.domains.remove

Remove a sending domain; mail still waiting is dropped.

POST/v1/sending.domains.remove

Campaigns keyAdmin or owner

Parameters

  • domainstringrequired

    The sending domain, such as news.example.com.

Beside input

  • orgstringoptional

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

Returns

data is an object with:

  • removedboolean

    True when the domain was there to remove.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.sending.domains.remove({
	domain: "news.example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.sending.domains.remove(
    {"domain": "news.example.com"}
)
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.SendingDomainsRemoveParams{
require 'mailset'

# Reads MAILSET_KEY from the environment: a campaigns key.
mailset = Mailset::Client.new

answer = mailset.sending.domains.remove(
  domain: 'news.example.com'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->sending->domains->remove([
    'domain' => 'news.example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendingDomainsRemoveParams;
import app.mailset.model.SendingDomainsRemoveResult;

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

var params = SendingDomainsRemoveParams.builder()
        .domain("news.example.com")
        .build();
SendingDomainsRemoveResult answer =
        mailset.sending().domains().remove(params);
System.out.println(answer);
use mailset::types::SendingDomainsRemoveParams;

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

let answer = mailset
    .sending()
    .domains()
    .remove(SendingDomainsRemoveParams {
        domain: "news.example.com".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/sending.domains.remove \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"domain":"news.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 sending domains remove news.example.com
Response
{
  "ok": true,
  "data": {
    "removed": true
  }
}

sending.domains.route

Send every message to a sending domain to a webhook.

POST/v1/sending.domains.route

Campaigns keyAdmin or owner

Parameters

  • domainstringrequired

    The sending domain, such as news.example.com.

  • urlstringrequired

    Where every message to the domain is POSTed: an https URL on a public host name.

    At most 500 characters.

Beside input

  • orgstringoptional

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

Returns

data is an object with:

  • domainSending domain object

    The domain as it is now.

  • secretstring

    The route’s signing secret, shown this once.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.sending.domains.route({
	url: "https://app.example.com/hooks/replies",
	domain: "news.example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.sending.domains.route(
    {
        "url": "https://app.example.com/hooks/replies",
        "domain": "news.example.com",
    }
)
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.SendingDomainsRouteParams{
		URL:    "https://app.example.com/hooks/replies",
		Domain: "news.example.com",
	}
	answer, err := client.Sending.Domains.Route(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

# Reads MAILSET_KEY from the environment: a campaigns key.
mailset = Mailset::Client.new

answer = mailset.sending.domains.route(
  url: 'https://app.example.com/hooks/replies',
  domain: 'news.example.com'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->sending->domains->route([
    'url' => 'https://app.example.com/hooks/replies',
    'domain' => 'news.example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendingDomainRouted;
import app.mailset.model.SendingDomainsRouteParams;

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

var params = SendingDomainsRouteParams.builder()
        .url("https://app.example.com/hooks/replies")
        .domain("news.example.com")
        .build();
SendingDomainRouted answer =
        mailset.sending().domains().route(params);
System.out.println(answer);
use mailset::types::SendingDomainsRouteParams;

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

let answer = mailset
    .sending()
    .domains()
    .route(SendingDomainsRouteParams {
        domain: "news.example.com".into(),
        url: "https://app.example.com/hooks/replies"
            .into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/sending.domains.route \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"url":"https://app.example.com/hooks/replies","domain":"news.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 sending domains route news.example.com --url https://app.example.com/hooks/replies
Response
{
  "ok": true,
  "data": {
    "domain": {
      "domain": "example.com",
      "trackingDomain": "example.com",
      "state": "pending",
      "checks": {
        "dkim": true,
        "bounce": true,
        "tracking": true,
        "trackingTls": true
      },
      "records": [
        {
          "purpose": "dkim",
          "type": "CNAME",
          "host": "text",

sending.submit

Send one whole message from a sending domain, the way a reply goes.

POST/v1/sending.submit

Campaigns keyAdmin or owner

Parameters

  • domainstringrequired

    The sending domain the message goes from.

  • rawstringrequired

    The whole RFC 5322 message, base64, up to 20 MB. From is an address at the domain.

    At most 27,962,035 characters.

  • refstringrequired

    Your own id for the message: 1 to 64 letters, digits, - or _. It comes back on its events.

  • recipientsarray of stringsoptional

    The envelope: who it goes to. Left out, everyone the message names in To, Cc and Bcc, each once whatever its case.

    1 to 50 items.

Beside input

  • orgstringoptional

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

The body may be up to 28 MB.

Returns

data is an object with:

  • resultsarray of objects

    One result per envelope address, in order.

    Show child attributesHide child attributes
    • addressstring

      The envelope address.

    • idstringoptional

      Mailset’s id for this address’s copy. Its events carry it as message.

    • stateenumoptional

      queued: it will go.

      Alwaysqueued

    • refusedenumoptional

      Why it wasn’t taken. suppressed: the address bounced or reported spam from this domain before. invalid: the message is wrong, or the address can’t or won’t get it. paused: the domain is paused or isn’t ready.

      One ofsuppressedinvalidpaused

    • reasonstringoptional

      The refusal, in words.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.sending.submit({
	ref: "ticket-4821",
	domain: "news.example.com",
	from: "Acme Support <moc.elpmaxe.swen@troppus>",
	to: "moc.elpmaxe@airam",
	subject: "Re: your order",
	text: "It ships tomorrow.",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.sending.submit(
    {
        "ref": "ticket-4821",
        "domain": "news.example.com",
        "from": "Acme Support <moc.elpmaxe.swen@troppus>",
        "to": "moc.elpmaxe@airam",
        "subject": "Re: your order",
        "text": "It ships tomorrow.",
    }
)
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.SendingSubmitParams{
require 'mailset'

# Reads MAILSET_KEY from the environment: a campaigns key.
mailset = Mailset::Client.new

answer = mailset.sending.submit(
  ref: 'ticket-4821',
  domain: 'news.example.com',
  from: 'Acme Support <moc.elpmaxe.swen@troppus>',
  to: 'moc.elpmaxe@airam',
  subject: 'Re: your order',
  text: 'It ships tomorrow.'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->sending->submit(
    'news.example.com',
    'ticket-4821',
    [
        'from' =>
            'Acme Support <moc.elpmaxe.swen@troppus>',
        'to' => 'moc.elpmaxe@airam',
        'subject' => 'Re: your order',
        'text' => 'It ships tomorrow.',
    ],
);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.Message;
import app.mailset.SendingSubmit;
import app.mailset.model.SendingSubmitted;

// Reads MAILSET_KEY from the environment,
// a campaigns key.
Mailset mailset = Mailset.fromEnv();

var message = Message.builder()
        .from("Acme Support <moc.elpmaxe.swen@troppus>")
        .to("moc.elpmaxe@airam")
        .subject("Re: your order")
        .text("It ships tomorrow.")
        .build();
var reply = SendingSubmit.builder()
        .domain("news.example.com")
        .ref("ticket-4821")
        .message(message)
        .build();
SendingSubmitted answer = mailset.sending().submit(reply);
System.out.println(answer);
use mailset::Message;

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

let reply = Message::builder()
    .from("Acme Support <moc.elpmaxe.swen@troppus>")
    .to("moc.elpmaxe@airam")
    .subject("Re: your order")
    .text("It ships tomorrow.");
let answer = mailset
    .sending()
    .submit("news.example.com", "ticket-4821", reply)
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/sending.submit \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"ref":"ticket-4821","domain":"news.example.com","name":"reply.eml","raw":"<the message as base64>"},"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. <the message as base64> is a whole email, headers and body: Send your own MIME.

mailset sending submit news.example.com --ref ticket-4821 --file reply.eml
Response
{
  "ok": true,
  "data": {
    "results": [
      {
        "address": "moc.elpmaxe@olleh",
        "id": "out_3f9a1c0e7b2d",
        "state": "queued"
      }
    ]
  }
}

sending.domains.resume

Let a sending domain its brake paused send again, once you know why it was.

POST/v1/sending.domains.resume

OwnerPasskey

Parameters

  • domainstringrequired

    The sending domain, such as news.example.com.

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 the Sending domain object.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.sending.domains.resume({
	domain: "news.example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.sending.domains.resume(
    {"domain": "news.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.SendingDomainsResumeParams{
require 'mailset'

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

answer = mailset.sending.domains.resume(
  domain: 'news.example.com'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->sending->domains->resume([
    'domain' => 'news.example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendingDomain;
import app.mailset.model.SendingDomainsResumeParams;

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

var params = SendingDomainsResumeParams.builder()
        .domain("news.example.com")
        .build();
SendingDomain answer =
        mailset.sending().domains().resume(params);
System.out.println(answer);
use mailset::types::SendingDomainsResumeParams;

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

let answer = mailset
    .sending()
    .domains()
    .resume(SendingDomainsResumeParams {
        domain: "news.example.com".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/sending.domains.resume \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"domain":"news.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 sending domains resume news.example.com
Response
{
  "ok": true,
  "data": {
    "domain": "example.com",
    "trackingDomain": "example.com",
    "state": "pending",
    "checks": {
      "dkim": true,
      "bounce": true,
      "tracking": true,
      "trackingTls": true
    },
    "records": [
      {
        "purpose": "dkim",
        "type": "CNAME",
        "host": "text",
        "value": "text",

sending.suppressions.list

The addresses a sending domain won’t write to.

POST/v1/sending.suppressions.list

Campaigns keyAdmin or owner

Parameters

  • domainstringrequired

    The sending domain, such as news.example.com.

  • cursorstringoptional

    The next of the page before, for the page after it.

    At most 400 characters.

Beside input

  • orgstringoptional

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

Returns

data is an object with:

  • suppressionsarray of Suppression objects

    One page of the suppressed addresses.

  • nextnullable string

    Pass it as cursor for the next page. Null on the last one.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.sending.suppressions.list({
	domain: "news.example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.sending.suppressions.list(
    {"domain": "news.example.com"}
)
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.SendingSuppressionsListParams{
require 'mailset'

# Reads MAILSET_KEY from the environment: a campaigns key.
mailset = Mailset::Client.new

answer = mailset.sending.suppressions.list(
  domain: 'news.example.com'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->sending->suppressions->list([
    'domain' => 'news.example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendingSuppressionsListParams;
import app.mailset.model.SuppressionPage;

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

var params = SendingSuppressionsListParams.builder()
        .domain("news.example.com")
        .build();
SuppressionPage answer =
        mailset.sending().suppressions().list(params);
System.out.println(answer);
use mailset::types::SendingSuppressionsListParams;

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

let answer = mailset
    .sending()
    .suppressions()
    .list(SendingSuppressionsListParams {
        domain: "news.example.com".into(),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/sending.suppressions.list \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"domain":"news.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 sending suppressions list news.example.com
Response
{
  "ok": true,
  "data": {
    "suppressions": [
      {
        "address": "moc.elpmaxe@olleh",
        "reason": "The day’s sending limit is reached.",
        "at": 1796048940000
      }
    ],
    "next": "eyJhIjoxNzk2MDkyNDQyfQ"
  }
}

sending.suppressions.remove

Let a sending domain write to an address again.

POST/v1/sending.suppressions.remove

Campaigns keyAdmin or owner

Parameters

  • domainstringrequired

    The sending domain, such as news.example.com.

  • addressstringrequired

    The address the domain may write to again.

Beside input

  • orgstringoptional

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

Returns

data is an object with:

  • removedboolean

    True when the address was suppressed.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.sending.suppressions.remove({
	address: "moc.elpmaxe@airam",
	domain: "news.example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.sending.suppressions.remove(
    {
        "address": "moc.elpmaxe@airam",
        "domain": "news.example.com",
    }
)
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.SendingSuppressionsRemoveParams{
require 'mailset'

# Reads MAILSET_KEY from the environment: a campaigns key.
mailset = Mailset::Client.new

answer = mailset.sending.suppressions.remove(
  address: 'moc.elpmaxe@airam',
  domain: 'news.example.com'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->sending->suppressions->remove([
    'address' => 'moc.elpmaxe@airam',
    'domain' => 'news.example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendingSuppressionsRemoveParams;
import app.mailset.model.SendingSuppressionsRemoveResult;

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

var params = SendingSuppressionsRemoveParams.builder()
        .address("moc.elpmaxe@airam")
        .domain("news.example.com")
        .build();
SendingSuppressionsRemoveResult answer =
        mailset.sending().suppressions().remove(params);
System.out.println(answer);
use mailset::types::SendingSuppressionsRemoveParams;

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

let answer = mailset
    .sending()
    .suppressions()
    .remove(SendingSuppressionsRemoveParams {
        domain: "news.example.com".into(),
        address: "moc.elpmaxe@airam".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/sending.suppressions.remove \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"address":"moc.elpmaxe@airam","domain":"news.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 sending suppressions remove news.example.com --address moc.elpmaxe@airam
Response
{
  "ok": true,
  "data": {
    "removed": true
  }
}

sending.status

Show your org’s sending limits, and whether it is paused.

POST/v1/sending.status

Anyone in the org

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:

  • tierenum

    How far the org may send: no_card (only to its own domains), trial or paid. limits has the numbers.

    One ofno_cardtrialpaid

  • limitsobject

    The limits its tier sets.

    Show child attributesHide child attributes
    • externalPerDaynullable number

      Recipients outside the org, per 24 hours. Null: no limit.

    • externalTotalnullable number

      Recipients outside the org, ever. Null: no limit.

    • perMinutenullable number

      Recipients per minute. Null: no limit.

    • perMessagenumber

      Recipients in one message, at most.

  • externalTodaynumber

    Recipients outside the org in the last 24 hours.

  • externalTotalnumber

    Recipients outside the org, ever.

  • campaignsPerDaynullable number

    What its campaigns may send outside the org in 24 hours: the day’s cap less the room kept for people’s mail. Null: no cap.

  • campaignsTodaynumber

    Campaign recipients outside the org in the last 24 hours, counted in externalToday too.

  • pausednullable object

    Set when this org’s mail is stopped. Only Mailset support ends it.

    Show child attributesHide child attributes
    • reasonstring

      Why it was paused, in words.

    • atnumber

      When it was paused, in ms since the epoch.

  • heldnullable string

    Set while Mailset is holding mail from new and smaller accounts for now, to protect delivery for everyone.

  • pausedMailboxesarray of objects

    Mailboxes whose own brake stopped the mail people write from them. An owner or admin resumes each with mailboxes resume.

    Show child attributesHide child attributes
    • addressstring

      The mailbox’s address.

    • reasonstring

      Why its brake stopped it, in words.

    • atnumber

      When it was paused, in ms since the epoch.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.sending.status();
console.log(answer);
from mailset import Mailset

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

answer = mailset.sending.status()
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.Sending.Status(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.sending.status
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->sending->status();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.SendingStatus;

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

SendingStatus answer = mailset.sending().status();
System.out.println(answer);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.sending().status().await?;
println!("{answer:?}");
curl https://mailset.app/v1/sending.status \
  -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 sending status
Response
{
  "ok": true,
  "data": {
    "tier": "no_card",
    "limits": {
      "externalPerDay": 12,
      "externalTotal": 12,
      "perMinute": 12,
      "perMessage": 1
    },
    "externalToday": 1,
    "externalTotal": 12,
    "campaignsPerDay": 12,
    "campaignsToday": 1,
    "paused": {
      "reason": "The day’s sending limit is reached.",
      "at": 1796048940000
    },