Domains

Domains

Add a domain, check its records, and set its policies.

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 Domain object
  2. domains.list
  3. domains.plan
  4. domains.add
  5. domains.parkPlan
  6. domains.park
  7. domains.check
  8. domains.dmarc
  9. domains.apply
  10. domains.sts
  11. domains.remove
  12. domains.postmaster
  13. domains.logo
  14. domains.verify
  15. domains.status
  16. domains.connect

The Domain object

A domain on Mailset: its DNS records, what works, and its policies.

Attributes

  • idstring

    The domain’s id.

  • namestring

    The domain’s name.

  • kindenum

    mail: Mailset sends and receives for it. sending: Mailset only sends. parked: no mail to or from it.

    One ofmailsendingparked

  • statusenum

    pending: not receiving yet. receiving: its mailboxes work. ready: sending works too. parked: a parked domain’s records are right.

    One ofpendingreceivingreadyparked

  • sendingenum

    Whether it can send: pending, ready or blocked.

    One ofpendingreadyblocked

  • providernullable stringoptional

    Which provider sends for it. Null on a parked 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: mx, spf, dkim, dmarc, bounce and the like.

      One ofmxdkimdkim2dkim3bouncebounce_spfspfdmarcmta_stsmta_sts_hosttls_rptbimi

    • typeenum

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

      One ofMXTXTCNAME

    • hoststring

      The record’s name, in full.

    • valuestring

      What the record has to hold.

    • prioritynullable number

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

    • stateenum

      ok: DNS answers with it. missing: nothing is there. wrong: something else is.

      One ofokmissingwrong

    • foundnullable string

      What DNS answered instead, when it isn’t what the record should hold.

  • stsnullable object

    Its MTA-STS policy and TLS reports. Null on a parked domain.

    Show child attributesHide child attributes
    • modeenum

      One oftestingenforce

    • stateenum

      One ofpendingtestingenforcingbroken

    • detailnullable string

      What’s wrong or what it’s waiting for. Null when there’s nothing to say.

    • reportsobject
      Show child attributesHide child attributes
      • windowDaysnumber
      • reportsnumber
      • successesnumber
      • failuresnumber
      • failureTypesarray of strings

        Kinds of failure, most sessions first: certificate-expired.

      • failureReportersarray of strings

        The DKIM-verified domains that reported failures.

      • lastAtnullable number
    • mxCertificateobject
      Show child attributesHide child attributes
      • stateenum

        One ofokexpiringfailingunknown

      • detailnullable string

        What’s wrong, in a sentence. Null when nothing is.

      • daysLeftnullable number
      • checkedAtnullable number
    • enforceBlockersarray of strings

      Why enforce would be refused, as of the last check. Empty: it’s allowed.

  • dmarcnullable objectoptional

    Its DMARC record and reports. Null on a parked domain.

    Show child attributesHide child attributes
    • problemsarray of strings

      What’s wrong with the record for mail Mailset sends, one sentence each. Empty: nothing.

    • fixnullable string

      The record to publish instead, the owner’s policy kept. Null when nothing needs changing.

    • reportsAuthorizedboolean

      Whether Mailset’s zone lets receivers send this domain’s reports to Mailset.

    • reportsobject
      Show child attributesHide child attributes
      • windowDaysnumber
      • reportsnumber
      • messagesnumber
      • passednumber

        Messages that passed DMARC.

      • reportersarray of strings

        The DKIM-verified domains that sent reports: google.com.

      • failingarray of objects

        The sources that failed, most messages first.

        Show child attributesHide child attributes
        • ipstring
        • messagesnumber
        • dispositionstring

          What receivers mostly did with it: none, quarantine or reject.

        • dkimstring

          DKIM’s and SPF’s own results, before alignment: pass, fail, none.

        • spfstring
      • lastAtnullable number
  • checkedAtnullable number

    When its records were last checked, in ms since the epoch. Null: never.

  • createdAtnumber

    When it was added, in ms since the epoch.

Answered by

domains.listdomains.adddomains.parkdomains.checkdomains.applydomains.sts

The Domain object
{
  "id": "out_3f9a1c0e7b2d",
  "name": "Acme API",
  "kind": "mail",
  "status": "pending",
  "sending": "pending",
  "provider": "text",
  "records": [
    {
      "purpose": "mx",
      "type": "MX",
      "host": "text",
      "value": "text",
      "priority": 1,
      "state": "ok",
      "found": "text"
    }
  ],

domains.list

List an org’s domains.

POST/v1/domains.list

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 a list of Domain objects.

In the CLIErrors

import { Mailset } from 'mailset';

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

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

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

answer = mailset.domains.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.Domains.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.domains.list
p answer
<?php

require 'vendor/autoload.php';

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

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

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

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

let answer = mailset.domains().list().await?;
println!("{answer:?}");
curl https://mailset.app/v1/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 domains list
Response
{
  "ok": true,
  "data": [
    {
      "id": "out_3f9a1c0e7b2d",
      "name": "Acme API",
      "kind": "mail",
      "status": "pending",
      "sending": "pending",
      "provider": "text",
      "records": [
        {
          "purpose": "mx",
          "type": "MX",
          "host": "text",
          "value": "text",
          "priority": 1,
          "state": "ok",

domains.plan

Show what adding a domain would change.

POST/v1/domains.plan

Admin or owner

Parameters

  • namestringrequired

    The domain’s name, such as example.com.

  • sendingbooleanoptional

    Sending only: just the records sending needs, with MX and SPF left as they are.

    Default false.

Beside input

  • orgstringoptional

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

Returns

data is an object with:

  • namestring
  • zonestring
  • dnsHostnullable string
  • dnsPagenullable string

    The host’s own page for this zone’s records, when it has one.

  • writableboolean

    Mailset can write to this DNS host itself.

  • changesarray of objects

    The records that can be named now. The DKIM and bounce records come once the domain is added.

    Show child attributesHide child attributes
    • purposeenum

      One ofmxdkimdkim2dkim3bouncebounce_spfspfdmarcmta_stsmta_sts_hosttls_rptbimi

    • typeenum

      One ofMXTXTCNAME

    • hoststring
    • fromnullable string
    • tostring
  • warningsarray of strings
  • leftoversobjectoptional

    Records old providers left, on domains plan.

    Show child attributesHide child attributes
    • visibleboolean

      Mailset read the zone. False: its DNS host has to be checked by hand.

    • foundarray of objects
      Show child attributesHide child attributes
      • providerIdstring

        What --drop-leftovers calls it: sparkpost.

      • providerstring
      • kindenum

        One ofbouncedkimspfmxverificationtracking

      • typestring
      • hoststring
      • valuestring
    • providersarray of objects

      Each provider in found, and whether it still sends as the domain.

      Show child attributesHide child attributes
      • idstring
      • namestring
      • sentnullable number

        Messages it sent as the domain. Null when Mailset couldn’t check.

      • uncheckednullable enum

        Why it couldn’t: no reports naming senders, or nothing it left shows in one.

        One ofno_reportsunrecognizable

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.domains.plan({
	name: "example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.domains.plan({"name": "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.DomainsPlanParams{
		Name: "example.com",
	}
	answer, err := client.Domains.Plan(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.domains.plan(name: 'example.com')
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->domains->plan([
    'name' => 'example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.DomainPlan;
import app.mailset.model.DomainsPlanParams;

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

var params = DomainsPlanParams.builder()
        .name("example.com")
        .build();
DomainPlan answer = mailset.domains().plan(params);
System.out.println(answer);
use mailset::types::DomainsPlanParams;

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

let answer = mailset
    .domains()
    .plan(DomainsPlanParams {
        name: "example.com".into(),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/domains.plan \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"name":"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 domains plan example.com
Response
{
  "ok": true,
  "data": {
    "name": "Acme API",
    "zone": "text",
    "dnsHost": "text",
    "dnsPage": "text",
    "writable": true,
    "changes": [
      {
        "purpose": "mx",
        "type": "MX",
        "host": "text",
        "from": "moc.elpmaxe@olleh",
        "to": "moc.elpmaxe@ana"
      }
    ],
    "warnings": [

domains.add

Add a domain and get its DNS records.

POST/v1/domains.add

Admin or owner

Parameters

  • namestringrequired

    The domain’s name, such as example.com.

  • sendingbooleanoptional

    Sending only: its mail keeps arriving where it does today, so it needs only the DKIM, bounce and DMARC records, and a domain key sends as the addresses it names there.

    Default false.

Beside input

  • orgstringoptional

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

Returns

data is the Domain object.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.domains.add({
	name: "example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.domains.add({"name": "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.DomainsAddParams{
		Name: "example.com",
	}
	answer, err := client.Domains.Add(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.domains.add(name: 'example.com')
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->domains->add([
    'name' => 'example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Domain;
import app.mailset.model.DomainsAddParams;

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

var params = DomainsAddParams.builder()
        .name("example.com")
        .build();
Domain answer = mailset.domains().add(params);
System.out.println(answer);
use mailset::types::DomainsAddParams;

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

let answer = mailset
    .domains()
    .add(DomainsAddParams {
        name: "example.com".into(),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/domains.add \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"name":"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 domains add example.com
Response
{
  "ok": true,
  "data": {
    "id": "out_3f9a1c0e7b2d",
    "name": "Acme API",
    "kind": "mail",
    "status": "pending",
    "sending": "pending",
    "provider": "text",
    "records": [
      {
        "purpose": "mx",
        "type": "MX",
        "host": "text",
        "value": "text",
        "priority": 1,
        "state": "ok",
        "found": "text"

domains.parkPlan

Show what parking a domain would change.

POST/v1/domains.parkPlan

Admin or owner

Parameters

  • namestringrequired

    The domain’s name, such as 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:

  • namestring
  • zonestring
  • dnsHostnullable string
  • dnsPagenullable string

    The host’s own page for this zone’s records, when it has one.

  • writableboolean

    Mailset can write to this DNS host itself.

  • changesarray of objects

    The records that can be named now. The DKIM and bounce records come once the domain is added.

    Show child attributesHide child attributes
    • purposeenum

      One ofmxdkimdkim2dkim3bouncebounce_spfspfdmarcmta_stsmta_sts_hosttls_rptbimi

    • typeenum

      One ofMXTXTCNAME

    • hoststring
    • fromnullable string
    • tostring
  • warningsarray of strings
  • leftoversobjectoptional

    Records old providers left, on domains plan.

    Show child attributesHide child attributes
    • visibleboolean

      Mailset read the zone. False: its DNS host has to be checked by hand.

    • foundarray of objects
      Show child attributesHide child attributes
      • providerIdstring

        What --drop-leftovers calls it: sparkpost.

      • providerstring
      • kindenum

        One ofbouncedkimspfmxverificationtracking

      • typestring
      • hoststring
      • valuestring
    • providersarray of objects

      Each provider in found, and whether it still sends as the domain.

      Show child attributesHide child attributes
      • idstring
      • namestring
      • sentnullable number

        Messages it sent as the domain. Null when Mailset couldn’t check.

      • uncheckednullable enum

        Why it couldn’t: no reports naming senders, or nothing it left shows in one.

        One ofno_reportsunrecognizable

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.domains.parkPlan({
	name: "acme.org",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.domains.park_plan({"name": "acme.org"})
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.DomainsParkPlanParams{
		Name: "acme.org",
	}
	answer, err := client.Domains.ParkPlan(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.domains.park_plan(name: 'acme.org')
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->domains->parkPlan([
    'name' => 'acme.org',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.DomainPlan;
import app.mailset.model.DomainsParkPlanParams;

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

var params = DomainsParkPlanParams.builder()
        .name("acme.org")
        .build();
DomainPlan answer = mailset.domains().parkPlan(params);
System.out.println(answer);
use mailset::types::DomainsParkPlanParams;

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

let answer = mailset
    .domains()
    .park_plan(DomainsParkPlanParams {
        name: "acme.org".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/domains.parkPlan \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"name":"acme.org"},"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 domains parkPlan acme.org
Response
{
  "ok": true,
  "data": {
    "name": "Acme API",
    "zone": "text",
    "dnsHost": "text",
    "dnsPage": "text",
    "writable": true,
    "changes": [
      {
        "purpose": "mx",
        "type": "MX",
        "host": "text",
        "from": "moc.elpmaxe@olleh",
        "to": "moc.elpmaxe@ana"
      }
    ],
    "warnings": [

domains.park

Park a domain: no mail to or from it, and nobody can spoof it.

POST/v1/domains.park

Admin or ownerPasskey

Parameters

  • namestringrequired

    The domain’s name, such as 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 Domain object.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.domains.park({
	name: "acme.org",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.domains.park({"name": "acme.org"})
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.DomainsParkParams{
		Name: "acme.org",
	}
	answer, err := client.Domains.Park(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.domains.park(name: 'acme.org')
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->domains->park(['name' => 'acme.org']);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Domain;
import app.mailset.model.DomainsParkParams;

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

var params = DomainsParkParams.builder()
        .name("acme.org")
        .build();
Domain answer = mailset.domains().park(params);
System.out.println(answer);
use mailset::types::DomainsParkParams;

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

let answer = mailset
    .domains()
    .park(DomainsParkParams {
        name: "acme.org".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/domains.park \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"name":"acme.org"},"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 domains park acme.org
Response
{
  "ok": true,
  "data": {
    "id": "out_3f9a1c0e7b2d",
    "name": "Acme API",
    "kind": "mail",
    "status": "pending",
    "sending": "pending",
    "provider": "text",
    "records": [
      {
        "purpose": "mx",
        "type": "MX",
        "host": "text",
        "value": "text",
        "priority": 1,
        "state": "ok",
        "found": "text"

domains.check

Check a domain’s DNS records now.

POST/v1/domains.check

Anyone in the org

Parameters

  • namestringrequired

    The domain’s name, such as example.com.

Beside input

  • orgstringoptional

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

Returns

data is the Domain object.

In the CLIErrors

import { Mailset } from 'mailset';

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

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

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

answer = mailset.domains.check({"name": "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.DomainsCheckParams{
		Name: "example.com",
	}
	answer, err := client.Domains.Check(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.domains.check(name: 'example.com')
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->domains->check([
    'name' => 'example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Domain;
import app.mailset.model.DomainsCheckParams;

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

var params = DomainsCheckParams.builder()
        .name("example.com")
        .build();
Domain answer = mailset.domains().check(params);
System.out.println(answer);
use mailset::types::DomainsCheckParams;

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

let answer = mailset
    .domains()
    .check(DomainsCheckParams {
        name: "example.com".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/domains.check \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"name":"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 domains check example.com
Response
{
  "ok": true,
  "data": {
    "id": "out_3f9a1c0e7b2d",
    "name": "Acme API",
    "kind": "mail",
    "status": "pending",
    "sending": "pending",
    "provider": "text",
    "records": [
      {
        "purpose": "mx",
        "type": "MX",
        "host": "text",
        "value": "text",
        "priority": 1,
        "state": "ok",
        "found": "text"

domains.dmarc

Show a domain’s DMARC: what’s wrong with the record, its pass rate and the sources that fail.

POST/v1/domains.dmarc

Anyone in the orgPasskey

Parameters

  • namestringrequired

    The domain’s name, such as example.com.

  • policyenumoptional

    The DMARC policy to publish: none, quarantine or reject. Left out: only show where it stands.

    One ofnonequarantinereject

  • anywaybooleanoptional

    Raise it before reports show the mail passing.

    Default false.

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 an object with:

  • namestring
  • recordnullable object

    The DMARC record as last checked: what’s published, and what to publish instead.

    Show child attributesHide child attributes
    • purposeenum

      What the record is for: mx, spf, dkim, dmarc, bounce and the like.

      One ofmxdkimdkim2dkim3bouncebounce_spfspfdmarcmta_stsmta_sts_hosttls_rptbimi

    • typeenum

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

      One ofMXTXTCNAME

    • hoststring

      The record’s name, in full.

    • valuestring

      What the record has to hold.

    • prioritynullable number

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

    • stateenum

      ok: DNS answers with it. missing: nothing is there. wrong: something else is.

      One ofokmissingwrong

    • foundnullable string

      What DNS answered instead, when it isn’t what the record should hold.

  • dmarcobject
    Show child attributesHide child attributes
    • problemsarray of strings

      What’s wrong with the record for mail Mailset sends, one sentence each. Empty: nothing.

    • fixnullable string

      The record to publish instead, the owner’s policy kept. Null when nothing needs changing.

    • reportsAuthorizedboolean

      Whether Mailset’s zone lets receivers send this domain’s reports to Mailset.

    • reportsobject
      Show child attributesHide child attributes
      • windowDaysnumber
      • reportsnumber
      • messagesnumber
      • passednumber

        Messages that passed DMARC.

      • reportersarray of strings

        The DKIM-verified domains that sent reports: google.com.

      • failingarray of objects

        The sources that failed, most messages first.

        Show child attributesHide child attributes
        • ipstring
        • messagesnumber
        • dispositionstring

          What receivers mostly did with it: none, quarantine or reject.

        • dkimstring

          DKIM’s and SPF’s own results, before alignment: pass, fail, none.

        • spfstring
      • lastAtnullable number
  • changeobjectoptional
    Show child attributesHide child attributes
    • policyenum

      One ofnonequarantinereject

    • hoststring

      _dmarc.<domain>.

    • beforenullable string

      The DMARC records published before, joined with | . Null: none.

    • recordstring

      The one record now, or the one to publish in place of every DMARC record there.

    • changedboolean

      False when the record already said this.

    • writtenboolean

      Mailset wrote it to the zone itself.

    • liveboolean

      The zone’s own nameservers answer it, and only it.

    • uncheckedboolean

      Raised with --anyway, before reports showed it safe.

    • writableboolean

      Mailset can write this zone.

    • dnsHostnullable string
    • dnsPagenullable string
    • problemnullable string

      Why Mailset couldn’t write it just now.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.domains.dmarc({
	policy: "quarantine",
	name: "example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.domains.dmarc(
    {"policy": "quarantine", "name": "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.DomainsDMARCParams{
		Policy: mailset.DMARCPolicyQuarantine,
		Name:   "example.com",
	}
	answer, err := client.Domains.DMARC(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.domains.dmarc(
  policy: 'quarantine',
  name: 'example.com'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->domains->dmarc([
    'policy' => 'quarantine',
    'name' => 'example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.DmarcPolicy;
import app.mailset.model.DomainDmarcAnswer;
import app.mailset.model.DomainsDmarcParams;

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

var params = DomainsDmarcParams.builder()
        .policy(DmarcPolicy.QUARANTINE)
        .name("example.com")
        .build();
DomainDmarcAnswer answer =
        mailset.domains().dmarc(params);
System.out.println(answer);
use mailset::types::{DmarcPolicy, DomainsDmarcParams};

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

let answer = mailset
    .domains()
    .dmarc(DomainsDmarcParams {
        name: "example.com".into(),
        policy: Some(DmarcPolicy::Quarantine),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/domains.dmarc \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"policy":"quarantine","name":"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 domains dmarc example.com --policy quarantine
Response
{
  "ok": true,
  "data": {
    "name": "Acme API",
    "record": {
      "purpose": "mx",
      "type": "MX",
      "host": "text",
      "value": "text",
      "priority": 1,
      "state": "ok",
      "found": "text"
    },
    "dmarc": {
      "problems": [
        "text"
      ],
      "fix": "text",

domains.apply

Write a domain’s records to its DNS host.

POST/v1/domains.apply

Admin or ownerPasskey

Parameters

  • namestringrequired

    The domain’s name, such as example.com.

  • sendingbooleanoptional

    Only the DKIM and bounce records: the domain sends, and its mail still arrives where it does today.

    Default false.

  • onlyMailsetbooleanoptional

    Mailset is the only thing that sends as this domain: SPF names only Mailset, and every other DKIM key is deleted. For a domain that left Google or another provider for good.

    Default false.

  • dropLeftoversboolean or array of stringsoptional

    The old providers whose records go, by id, as domains plan lists them: bounce, DKIM, SPF, verification and, once mail comes here, MX. Never what Mailset wrote. A bare flag is refused with the ids found.

  • includeTrackingbooleanoptional

    With --drop-leftovers: their tracking records too, which old links still use.

    Default false.

  • anywaybooleanoptional

    With --drop-leftovers: without DMARC reports showing they stopped sending.

    Default false.

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 an object with:

  • appliedarray of strings
  • removedarray of stringsoptional

    DKIM keys deleted by --only-mailset: other senders that could sign as the domain.

    Default [].

  • leftoversobjectoptional

    Records old providers left, and what --drop-leftovers did with each.

    Show child attributesHide child attributes
    • removedarray of objects
      Show child attributesHide child attributes
      • providerIdstring

        What --drop-leftovers calls it: sparkpost.

      • providerstring
      • kindenum

        One ofbouncedkimspfmxverificationtracking

      • typestring
      • hoststring
      • valuestring
    • keptarray of objects
      Show child attributesHide child attributes
      • providerIdstring

        What --drop-leftovers calls it: sparkpost.

      • providerstring
      • kindenum

        One ofbouncedkimspfmxverificationtracking

      • typestring
      • hoststring
      • valuestring
      • reasonstring
  • domainDomain object

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.domains.apply({
	name: "example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.domains.apply({"name": "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.DomainsApplyParams{
		Name: "example.com",
	}
	answer, err := client.Domains.Apply(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.domains.apply(name: 'example.com')
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->domains->apply([
    'name' => 'example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.DomainApplied;
import app.mailset.model.DomainsApplyParams;

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

var params = DomainsApplyParams.builder()
        .name("example.com")
        .build();
DomainApplied answer = mailset.domains().apply(params);
System.out.println(answer);
use mailset::types::DomainsApplyParams;

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

let answer = mailset
    .domains()
    .apply(DomainsApplyParams {
        name: "example.com".into(),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/domains.apply \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"name":"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 domains apply example.com
Response
{
  "ok": true,
  "data": {
    "applied": [
      "text"
    ],
    "removed": [
      "text"
    ],
    "leftovers": {
      "removed": [
        {
          "providerId": "out_3f9a1c0e7b2d",
          "provider": "text",
          "kind": "bounce",
          "type": "text",
          "host": "text",
          "value": "text"

domains.sts

Set a domain’s MTA-STS mode: testing or enforce.

POST/v1/domains.sts

Admin or ownerPasskey

Parameters

  • namestringrequired

    The domain’s name.

  • modeenumrequired

    testing: senders report TLS failures and deliver anyway. enforce: they refuse to deliver without TLS.

    One oftestingenforce

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 an object with:

  • domainDomain object
  • publishedboolean

    Whether Mailset wrote the new policy id to DNS itself.

  • publishRecordnullable string

    When it didn’t: the record to publish so senders notice the change.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.domains.sts({
	mode: "enforce",
	name: "example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.domains.sts(
    {"mode": "enforce", "name": "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.DomainsSTSParams{
		Mode: mailset.STSModeEnforce,
		Name: "example.com",
	}
	answer, err := client.Domains.STS(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.domains.sts(
  mode: 'enforce',
  name: 'example.com'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->domains->sts([
    'mode' => 'enforce',
    'name' => 'example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.DomainStsChanged;
import app.mailset.model.DomainsStsParams;
import app.mailset.model.StsMode;

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

var params = DomainsStsParams.builder()
        .mode(StsMode.ENFORCE)
        .name("example.com")
        .build();
DomainStsChanged answer = mailset.domains().sts(params);
System.out.println(answer);
use mailset::types::{DomainsStsParams, StsMode};

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

let answer = mailset
    .domains()
    .sts(DomainsStsParams {
        name: "example.com".into(),
        mode: StsMode::Enforce,
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/domains.sts \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"mode":"enforce","name":"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 domains sts example.com --mode enforce
Response
{
  "ok": true,
  "data": {
    "domain": {
      "id": "out_3f9a1c0e7b2d",
      "name": "Acme API",
      "kind": "mail",
      "status": "pending",
      "sending": "pending",
      "provider": "text",
      "records": [
        {
          "purpose": "mx",
          "type": "MX",
          "host": "text",
          "value": "text",
          "priority": 1,
          "state": "ok",

domains.remove

Remove a domain.

POST/v1/domains.remove

Admin or ownerPasskey

Parameters

  • namestringrequired

    The domain’s name, such as 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 an object with:

  • removedboolean
  • notestringoptional

    On a parked domain: what removing it left as it was.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.domains.remove({
	name: "acme.org",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.domains.remove({"name": "acme.org"})
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.DomainsRemoveParams{
		Name: "acme.org",
	}
	answer, err := client.Domains.Remove(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.domains.remove(name: 'acme.org')
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->domains->remove([
    'name' => 'acme.org',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.DomainsRemoveParams;
import app.mailset.model.DomainsRemoveResult;

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

var params = DomainsRemoveParams.builder()
        .name("acme.org")
        .build();
DomainsRemoveResult answer =
        mailset.domains().remove(params);
System.out.println(answer);
use mailset::types::DomainsRemoveParams;

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

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

domains.postmaster

Gmail’s view of a domain, from Google Postmaster Tools.

POST/v1/domains.postmaster

Admin or ownerPasskey

Parameters

  • namestringrequired

    The domain’s name, such as example.com.

  • tokenstringoptional

    The TXT value Postmaster Tools shows for the domain. Given, Mailset writes that record and checks it.

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 an object with:

  • namestring
  • sendingboolean

    It sends through Mailset: its DKIM and bounce records pass. Gmail’s numbers are shown only then.

  • recordobject
    Show child attributesHide child attributes
    • hoststring

      The domain itself: Postmaster Tools verifies the apex.

    • typeenum

      AlwaysTXT

    • valuenullable string
    • stateenum

      One ofnonelivemissing

    • writableboolean

      Mailset writes it to the DNS host itself.

    • dnsHostnullable string

      Who hosts the zone, when Mailset can tell: "Cloudflare".

    • dnsPagenullable string

      The host’s own page for this zone’s records.

  • gmailnullable object

    Null: no Google account connected, or the domain doesn’t send yet.

    Show child attributesHide child attributes
    • verificationenum

      One ofnot_addedunverifiedverifiedno_access

    • daysarray of objects

      Newest first, only the days Gmail has numbers for.

      Show child attributesHide child attributes
      • datestring

        2026-11-19, Gmail’s own day.

      • spamRatenullable number
      • dkimnullable number
      • spfnullable number
      • dmarcnullable number
      • deliveryErrorsnullable number
    • requirementsarray of objects
      Show child attributesHide child attributes
      • requirementenum

        One ofSPFDKIMSPF_AND_DKIMDMARC_POLICYDMARC_ALIGNMENTMESSAGE_FORMATTINGDNS_RECORDSENCRYPTIONUSER_REPORTED_SPAM_RATEONE_CLICK_UNSUBSCRIBEHONOR_UNSUBSCRIBE

      • compliantboolean
  • problemnullable string

    Why Gmail’s numbers couldn’t be read just now.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.domains.postmaster({
	name: "example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.domains.postmaster(
    {"name": "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.DomainsPostmasterParams{
		Name: "example.com",
	}
	answer, err := client.Domains.Postmaster(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.domains.postmaster(name: 'example.com')
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->domains->postmaster([
    'name' => 'example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.DomainsPostmasterParams;
import app.mailset.model.PostmasterDomain;

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

var params = DomainsPostmasterParams.builder()
        .name("example.com")
        .build();
PostmasterDomain answer =
        mailset.domains().postmaster(params);
System.out.println(answer);
use mailset::types::DomainsPostmasterParams;

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

let answer = mailset
    .domains()
    .postmaster(DomainsPostmasterParams {
        name: "example.com".into(),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/domains.postmaster \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"name":"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 domains postmaster example.com
Response
{
  "ok": true,
  "data": {
    "name": "Acme API",
    "sending": true,
    "record": {
      "host": "text",
      "type": "TXT",
      "value": "text",
      "state": "none",
      "writable": true,
      "dnsHost": "text",
      "dnsPage": "text"
    },
    "gmail": {
      "verification": "not_added",
      "days": [
        {

domains.verify

Add the TXT record a service asks for to prove a domain (Google, Yahoo, Apple, Microsoft, Facebook).

POST/v1/domains.verify

Admin or ownerPasskey

Parameters

  • namestringrequired

    The domain’s name, such as example.com.

  • txtstringrequired

    The TXT value the service asks for, as it shows it.

  • hoststringoptional

    The name under the domain the record goes on, when the service names one. Left out: the domain itself.

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 an object with:

  • namestring

    The org’s domain the record is for.

  • hoststring

    Where it goes: the domain itself or a name under it.

  • relativestring

    The host as a DNS host’s form asks for it: @ for the domain itself.

  • typeenum

    AlwaysTXT

  • valuestring
  • stringsarray of strings

    The value as DNS holds it, in 255-character strings.

  • stateenum

    live: the zone’s own nameservers answer it. missing: not yet.

    One oflivemissing

  • alreadyboolean

    It was there before, so nothing changed.

  • writtenboolean

    Mailset wrote it to the zone just now.

  • writableboolean

    Mailset writes this zone itself.

  • dnsHostnullable string
  • dnsPagenullable string
  • problemnullable string

    Why Mailset couldn’t write or check it just now.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.domains.verify({
	txt:
		"google-site-verification=k3XwPq7Zr2Lm9Vt4Yb8Nc1Hd6" +
		"Jf0Sg5Ua3Ee7Ww2Ii4",
	name: "example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.domains.verify(
    {
        "txt": (
            "google-site-verification=k3XwPq7Zr2Lm9Vt4Yb8"
            "Nc1Hd6Jf0Sg5Ua3Ee7Ww2Ii4"
        ),
        "name": "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.DomainsVerifyParams{
require 'mailset'

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

answer = mailset.domains.verify(
  txt:
    'google-site-verification=k3XwPq7Zr2Lm9Vt4Yb8Nc1Hd' \
    '6Jf0Sg5Ua3Ee7Ww2Ii4',
  name: 'example.com'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->domains->verify([
    'txt' =>
        'google-site-verification=k3XwPq7Zr2Lm9Vt4Yb8N'
        . 'c1Hd6Jf0Sg5Ua3Ee7Ww2Ii4',
    'name' => 'example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.DomainsVerifyParams;
import app.mailset.model.Verification;

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

var params = DomainsVerifyParams.builder()
        .txt("google-site-verification=k3XwPq7Zr2Lm9Vt4Yb"
                + "8Nc1Hd6Jf0Sg5Ua3Ee7Ww2Ii4")
        .name("example.com")
        .build();
Verification answer = mailset.domains().verify(params);
System.out.println(answer);
use mailset::types::DomainsVerifyParams;

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

let answer = mailset
    .domains()
    .verify(DomainsVerifyParams {
        name: "example.com".into(),
        txt: concat!(
            "google-site-verification=",
            "k3XwPq7Zr2Lm9Vt4Yb8Nc1Hd6Jf0Sg5Ua3Ee7Ww2Ii4",
        )
        .into(),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/domains.verify \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"txt":"google-site-verification=k3XwPq7Zr2Lm9Vt4Yb8Nc1Hd6Jf0Sg5Ua3Ee7Ww2Ii4","name":"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 domains verify example.com --txt "google-site-verification=k3XwPq7Zr2Lm9Vt4Yb8Nc1Hd6Jf0Sg5Ua3Ee7Ww2Ii4"
Response
{
  "ok": true,
  "data": {
    "name": "Acme API",
    "host": "text",
    "relative": "text",
    "type": "TXT",
    "value": "text",
    "strings": [
      "text"
    ],
    "state": "live",
    "already": true,
    "written": true,
    "writable": true,
    "dnsHost": "text",
    "dnsPage": "text",
    "problem": "text"
  }
}

domains.status

A domain’s setup checklist: where each step stands and the next command for it, steps on other sites included.

POST/v1/domains.status

Admin or owner

Parameters

  • namestringrequired

    The domain’s name, such as 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:

  • namestring
  • kindenum

    One ofmailsendingparked

  • statusenum

    One ofpendingreceivingreadyparked

  • sendingenum

    One ofpendingreadyblocked

  • checkedAtnullable number

    When its records were last checked. The rows that read DNS read it now.

  • rowsarray of objects
    Show child attributesHide child attributes
    • idenum

      One ofdnsmta_stsdmarclogocertificatepostmastercampaignsmailboxesyahoosender_photosold_provider

    • titlestring
    • stateenum

      One ofoktodomanualinfo

    • detailstring

      Where it stands, in a sentence or two.

    • nextnullable string

      What to run next: a mailset command, or mailset guide <topic> for a step on another site. Null when nothing is left to do.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.domains.status({
	name: "example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.domains.status({"name": "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.DomainsStatusParams{
		Name: "example.com",
	}
	answer, err := client.Domains.Status(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.domains.status(name: 'example.com')
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->domains->status([
    'name' => 'example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.DomainChecklist;
import app.mailset.model.DomainsStatusParams;

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

var params = DomainsStatusParams.builder()
        .name("example.com")
        .build();
DomainChecklist answer = mailset.domains().status(params);
System.out.println(answer);
use mailset::types::DomainsStatusParams;

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

let answer = mailset
    .domains()
    .status(DomainsStatusParams {
        name: "example.com".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/domains.status \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"name":"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 domains status example.com
Response
{
  "ok": true,
  "data": {
    "name": "Acme API",
    "kind": "mail",
    "status": "pending",
    "sending": "pending",
    "checkedAt": 1796048940000,
    "rows": [
      {
        "id": "dns",
        "title": "text",
        "state": "ok",
        "detail": "text",
        "next": "eyJhIjoxNzk2MDkyNDQyfQ"
      }
    ]
  }
}

domains.connect

One-click setup: a link to the DNS host’s own page, where you approve Mailset’s records once, for a host Mailset can’t write that supports Domain Connect.

POST/v1/domains.connect

Admin or owner

Parameters

  • namestringrequired

    The domain’s name, such as example.com.

  • sendingbooleanoptional

    Only what sending needs: the DKIM and bounce records.

    Default false.

Beside input

  • orgstringoptional

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

Returns

data is an object with:

  • namestring
  • dnsHostnullable string

    The DNS host, as it names itself. Null when Mailset can’t tell.

  • writableboolean

    Mailset writes this zone itself, so domains apply needs no link.

  • byHandarray of objects

    Records no link covers, to add by hand.

    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.

  • notesarray of strings

    Steps the links can’t take, in sentences.

  • problemnullable string

    Why there’s no link, in a sentence. Null when there is one, or nothing is left to add.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.domains.connect({
	name: "example.com",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.domains.connect({"name": "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.DomainsConnectParams{
		Name: "example.com",
	}
	answer, err := client.Domains.Connect(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.domains.connect(name: 'example.com')
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->domains->connect([
    'name' => 'example.com',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.DomainConnect;
import app.mailset.model.DomainsConnectParams;

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

var params = DomainsConnectParams.builder()
        .name("example.com")
        .build();
DomainConnect answer = mailset.domains().connect(params);
System.out.println(answer);
use mailset::types::DomainsConnectParams;

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

let answer = mailset
    .domains()
    .connect(DomainsConnectParams {
        name: "example.com".into(),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/domains.connect \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"name":"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 domains connect example.com
Response
{
  "ok": true,
  "data": {
    "name": "Acme API",
    "dnsHost": "text",
    "writable": true,
    "links": [
      {
        "service": "mail",
        "url": "https://hooks.example.com/mailset",
        "records": [
          {
            "type": "text",
            "host": "text",
            "value": "text",
            "priority": 1
          }
        ]