Postmaster

Postmaster

How Gmail sees each of your domains.

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

On this page
  1. postmaster.status
  2. postmaster.connect
  3. postmaster.disconnect

postmaster.status

The Google account connected to Postmaster Tools, and Gmail’s view of each domain.

POST/v1/postmaster.status

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

  • availableboolean

    Whether a Google account can be connected.

  • connectionnullable object
    Show child attributesHide child attributes
    • stateenum

      One ofconnectedlost

    • accountstring
    • reasonnullable string
    • connectedAtnumber
  • domainsarray of objects
    Show child attributesHide child attributes
    • 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.postmaster.status();
console.log(answer);
from mailset import Mailset

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

answer = mailset.postmaster.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.Postmaster.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.postmaster.status
p answer
<?php

require 'vendor/autoload.php';

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

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

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

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

let answer = mailset.postmaster().status().await?;
println!("{answer:?}");
curl https://mailset.app/v1/postmaster.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 postmaster status
Response
{
  "ok": true,
  "data": {
    "available": true,
    "connection": {
      "state": "connected",
      "account": "text",
      "reason": "The day’s sending limit is reached.",
      "connectedAt": 1796048940000
    },
    "domains": [
      {
        "name": "Acme API",
        "sending": true,
        "record": {
          "host": "text",
          "type": "TXT",
          "value": "text",

postmaster.connect

Connect a Google account so Mailset can read Gmail’s numbers: opens Google.

POST/v1/postmaster.connect

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

  • urlstring

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.postmaster.connect();
console.log(answer);
from mailset import Mailset

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

answer = mailset.postmaster.connect()
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.Postmaster.Connect(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.postmaster.connect
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->postmaster->connect();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.PostmasterConnectResult;

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

PostmasterConnectResult answer =
        mailset.postmaster().connect();
System.out.println(answer);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.postmaster().connect().await?;
println!("{answer:?}");
curl https://mailset.app/v1/postmaster.connect \
  -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 postmaster connect
Response
{
  "ok": true,
  "data": {
    "url": "https://hooks.example.com/mailset"
  }
}

postmaster.disconnect

End Mailset’s access to Postmaster Tools at Google.

POST/v1/postmaster.disconnect

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

  • disconnectedboolean

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.postmaster.disconnect();
console.log(answer);
from mailset import Mailset

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

answer = mailset.postmaster.disconnect()
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.Postmaster.Disconnect(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
require 'mailset'

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

answer = mailset.postmaster.disconnect
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->postmaster->disconnect();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.PostmasterDisconnectResult;

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

PostmasterDisconnectResult answer =
        mailset.postmaster().disconnect();
System.out.println(answer);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.postmaster().disconnect().await?;
println!("{answer:?}");
curl https://mailset.app/v1/postmaster.disconnect \
  -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 postmaster disconnect
Response
{
  "ok": true,
  "data": {
    "disconnected": true
  }
}