# Email setup audit API

Check a domain's whole email setup: mail servers, SPF, DMARC and DKIM, graded, with a fix for every problem.

`GET /v1/email-audit`

- Price: Costs 2 credits per call; cached answers cost the same. Calls that fail upstream (502) are free.
- Cache: Answers are cached for the lowest record TTL, between 1 minute and 1 hour; send fresh=true to ask the source again.
- MCP tool: `audit_email`

The domain's MX, SPF (with its lookup count), DMARC and DKIM records, the mail provider they point to, and the findings that set the grade. Costs 2 credits per call; cached answers cost the same. Calls that fail upstream (502) are free. Answers are cached for the lowest record TTL, between 1 minute and 1 hour; send fresh=true to ask the source again. A retry with the same `X-Request-Id` returns the stored result of the first call for 24 hours without charging again, marked with the `X-Replayed: true` header.

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | yes | A domain, URL or email address; for an email address only the part after @ is used. |
| `selector` | string or null | no | A DKIM selector to try first, such as s1. |
| `fresh` | boolean | no | Skip the cache and ask the source again; costs the same. |

## Response

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `tool` | string | yes |  |
| `target` | string | yes |  |
| `status` | "ok" | "partial" | "error" | yes |  |
| `fetched_at` | string | no |  |
| `cached` | boolean | no |  |
| `credits_used` | integer | no | Credits this call took from your balance. 0 for free tools, for a replay of an earlier call, and for a free check run on the website without signing in |
| `summary` | string | yes |  |
| `score` | integer or null | no |  |
| `findings` | array of object | no |  |
| `credits_remaining` | integer | yes | Your balance after this call. It can be below zero after a refund; free tools still work then |
| `data` | object | yes | This tool's result |
| `data.name` | string | yes |  |
| `data.unicode` | string | yes |  |
| `data.nxdomain` | boolean | yes |  |
| `data.providers` | array of object | no |  |
| `data.providers.id` | string | yes |  |
| `data.providers.name` | string | yes |  |
| `data.providers.source` | "mx" | "spf" | yes |  |
| `data.mx` | object or null | no |  |
| `data.spf` | object or null | no |  |
| `data.dmarc` | object or null | no |  |
| `data.dkim` | object or null | no |  |
| `data.policies` | object or null | no |  |
| `data.min_ttl` | integer or null | no |  |

## Errors

- `400` Invalid domain, URL or parameter, a TLD this tool can't check, or an X-Request-Id already used for another call (`invalid_domain`, `invalid_url`, `invalid_request`, `unsupported_tld`)
- `401` Missing, unknown or revoked API key, or one whose creator is no longer a member of the account (`unauthorized`)
- `402` Balance below the call's price (`insufficient_credits`)
- `403` Account suspended, the key's creator is over the plan's seats, or an anonymous check without a valid proof-of-work or for a tool that needs an account, or bulk checks before a first purchase (`account_suspended`, `plan_limit`, `challenge_required`, `sign_in_required`, `bulk_locked`)
- `429` Too many requests, today's free checks are used up, or too many website scans at once; wait for the number of seconds in the Retry-After header (`rate_limited`, `free_limit_reached`, `too_many_jobs`). Not charged
- `500` Unexpected error (`internal_error`)
- `502` Every upstream source failed; not charged (`source_unavailable`). A Retry-After header says how long to wait when the source asked us to

## Example

```sh
curl "https://api.dnssuper.com/v1/email-audit?domain=example.com" \
  -H "Authorization: Bearer $DNSSUPER_API_KEY"
```

```python
import os

import httpx

client = httpx.Client(
    base_url="https://api.dnssuper.com",
    headers={"Authorization": f"Bearer {os.environ['DNSSUPER_API_KEY']}"},
    timeout=60,
)
response = client.get("/v1/email-audit", params={
    "domain": "example.com",
})
response.raise_for_status()
result = response.json()
print(result["summary"], result["credits_used"])
```

```ts
const response = await fetch(`https://api.dnssuper.com/v1/email-audit?${new URLSearchParams({"domain":"example.com"})}`, {
  headers: { Authorization: `Bearer ${process.env.DNSSUPER_API_KEY}` },
});
if (!response.ok) throw new Error((await response.json()).error.message);
const result = await response.json();
console.log(result.summary, result.credits_used);
```

Example response:

```json
{
  "tool": "email-checker",
  "target": "example.com",
  "status": "ok",
  "fetched_at": "2026-11-14T10:00:00Z",
  "cached": false,
  "credits_used": 2,
  "summary": "Email for example.com is set up well: grade A, 100 of 100. Mail is handled by Google Workspace.",
  "score": 100,
  "findings": [
    {
      "id": "spf.softfail_all",
      "severity": "info",
      "title": "Your SPF record ends in ~all",
      "detail": "",
      "fix": "Move to -all once DMARC reports show all your mail passes."
    },
    {
      "id": "bimi.missing",
      "severity": "info",
      "title": "No BIMI record",
      "detail": "",
      "fix": "Publish a BIMI record if you want your logo shown next to your mail in supporting inboxes."
    },
    {
      "id": "mx.ok",
      "severity": "pass",
      "title": "Your mail servers are set up",
      "detail": "",
      "fix": "Nothing to do."
    },
    {
      "id": "spf.valid",
      "severity": "pass",
      "title": "Your SPF record is valid",
      "detail": "",
      "fix": "Nothing to do."
    },
    {
      "id": "dmarc.enforced",
      "severity": "pass",
      "title": "Your DMARC policy is enforced",
      "detail": "p=reject",
      "fix": "Nothing to do."
    },
    {
      "id": "dkim.found",
      "severity": "pass",
      "title": "DKIM keys found",
      "detail": "google",
      "fix": "Nothing to do."
    },
    {
      "id": "mta_sts.enforced",
      "severity": "pass",
      "title": "MTA-STS is enforced",
      "detail": "",
      "fix": "Nothing to do; keep the policy's mx lines in step with your MX records."
    },
    {
      "id": "tls_rpt.valid",
      "severity": "pass",
      "title": "TLS reporting is set up",
      "detail": "",
      "fix": "Nothing to do; read the reports now and then."
    }
  ],
  "data": {
    "name": "example.com",
    "unicode": "example.com",
    "nxdomain": false,
    "providers": [
      {
        "id": "google-workspace",
        "name": "Google Workspace",
        "source": "mx"
      }
    ],
    "mx": {
      "status": "found",
      "null_mx": false,
      "implicit": false,
      "records": [
        {
          "preference": 1,
          "host": "aspmx.l.google.com",
          "ttl": 3600,
          "is_ip": false,
          "A": [
            "142.250.27.26"
          ],
          "AAAA": [
            "2a00:1450:4025:401::1a"
          ],
          "status": "ok",
          "provider": "google-workspace"
        },
        {
          "preference": 5,
          "host": "alt1.aspmx.l.google.com",
          "ttl": 3600,
          "is_ip": false,
          "A": [
            "142.250.153.27"
          ],
          "AAAA": [],
          "status": "ok",
          "provider": "google-workspace"
        }
      ]
    },
    "spf": {
      "status": "found",
      "record": "v=spf1 include:_spf.google.com ~all",
      "records": [
        "v=spf1 include:_spf.google.com ~all"
      ],
      "all": "~all",
      "lookups": 4,
      "lookup_limit": 10,
      "void_lookups": 0,
      "capped": false,
      "tree": {
        "domain": "example.com",
        "status": "found",
        "record": "v=spf1 include:_spf.google.com ~all",
        "errors": [],
        "terms": [
          {
            "term": "include:_spf.google.com",
            "mechanism": "include",
            "qualifier": "+",
            "target": "_spf.google.com",
            "counted": true,
            "status": "ok",
            "addresses": [],
            "hosts": [],
            "detail": "",
            "child": {
              "domain": "_spf.google.com",
              "status": "found",
              "record": "v=spf1 include:_netblocks.google.com include:_netblocks2.google.com include:_netblocks3.google.com ~all",
              "errors": [],
              "terms": [
                {
                  "term": "include:_netblocks.google.com",
                  "mechanism": "include",
                  "qualifier": "+",
                  "target": "_netblocks.google.com",
                  "counted": true,
                  "status": "ok",
                  "addresses": [],
                  "hosts": [],
                  "detail": "",
                  "child": {
                    "domain": "_netblocks.google.com",
                    "status": "found",
                    "record": "v=spf1 ip4:35.190.247.0/24 ip4:64.233.160.0/19 ip4:66.102.0.0/20 ip4:66.249.80.0/20 ip4:72.14.192.0/18 ~all",
                    "errors": [],
                    "terms": [
                      {
                        "term": "ip4:35.190.247.0/24",
                        "mechanism": "ip4",
                        "qualifier": "+",
                        "target": "35.190.247.0",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      },
                      {
                        "term": "ip4:64.233.160.0/19",
                        "mechanism": "ip4",
                        "qualifier": "+",
                        "target": "64.233.160.0",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      },
                      {
                        "term": "ip4:66.102.0.0/20",
                        "mechanism": "ip4",
                        "qualifier": "+",
                        "target": "66.102.0.0",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      },
                      {
                        "term": "ip4:66.249.80.0/20",
                        "mechanism": "ip4",
                        "qualifier": "+",
                        "target": "66.249.80.0",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      },
                      {
                        "term": "ip4:72.14.192.0/18",
                        "mechanism": "ip4",
                        "qualifier": "+",
                        "target": "72.14.192.0",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      },
                      {
                        "term": "~all",
                        "mechanism": "all",
                        "qualifier": "~",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      }
                    ]
                  }
                },
                {
                  "term": "include:_netblocks2.google.com",
                  "mechanism": "include",
                  "qualifier": "+",
                  "target": "_netblocks2.google.com",
                  "counted": true,
                  "status": "ok",
                  "addresses": [],
                  "hosts": [],
                  "detail": "",
                  "child": {
                    "domain": "_netblocks2.google.com",
                    "status": "found",
                    "record": "v=spf1 ip6:2001:4860:4000::/36 ip6:2404:6800:4000::/36 ip6:2607:f8b0:4000::/36 ~all",
                    "errors": [],
                    "terms": [
                      {
                        "term": "ip6:2001:4860:4000::/36",
                        "mechanism": "ip6",
                        "qualifier": "+",
                        "target": "2001:4860:4000::",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      },
                      {
                        "term": "ip6:2404:6800:4000::/36",
                        "mechanism": "ip6",
                        "qualifier": "+",
                        "target": "2404:6800:4000::",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      },
                      {
                        "term": "ip6:2607:f8b0:4000::/36",
                        "mechanism": "ip6",
                        "qualifier": "+",
                        "target": "2607:f8b0:4000::",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      },
                      {
                        "term": "~all",
                        "mechanism": "all",
                        "qualifier": "~",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      }
                    ]
                  }
                },
                {
                  "term": "include:_netblocks3.google.com",
                  "mechanism": "include",
                  "qualifier": "+",
                  "target": "_netblocks3.google.com",
                  "counted": true,
                  "status": "ok",
                  "addresses": [],
                  "hosts": [],
                  "detail": "",
                  "child": {
                    "domain": "_netblocks3.google.com",
                    "status": "found",
                    "record": "v=spf1 ip4:172.217.0.0/19 ip4:172.217.32.0/20 ip4:108.177.96.0/19 ~all",
                    "errors": [],
                    "terms": [
                      {
                        "term": "ip4:172.217.0.0/19",
                        "mechanism": "ip4",
                        "qualifier": "+",
                        "target": "172.217.0.0",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      },
                      {
                        "term": "ip4:172.217.32.0/20",
                        "mechanism": "ip4",
                        "qualifier": "+",
                        "target": "172.217.32.0",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      },
                      {
                        "term": "ip4:108.177.96.0/19",
                        "mechanism": "ip4",
                        "qualifier": "+",
                        "target": "108.177.96.0",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      },
                      {
                        "term": "~all",
                        "mechanism": "all",
                        "qualifier": "~",
                        "counted": false,
                        "status": "ok",
                        "addresses": [],
                        "hosts": [],
                        "detail": ""
                      }
                    ]
                  }
                },
                {
                  "term": "~all",
                  "mechanism": "all",
                  "qualifier": "~",
                  "counted": false,
                  "status": "ok",
                  "addresses": [],
                  "hosts": [],
                  "detail": ""
                }
              ]
            }
          },
          {
            "term": "~all",
            "mechanism": "all",
            "qualifier": "~",
            "counted": false,
            "status": "ok",
            "addresses": [],
            "hosts": [],
            "detail": ""
          }
        ]
      }
    },
    "dmarc": {
      "status": "found",
      "name": "_dmarc.example.com",
      "source": "exact",
      "record": "v=DMARC1; p=reject; rua=mailto:dmarc@example.com",
      "policy": "reject",
      "effective_policy": "reject",
      "pct": 100,
      "adkim": "r",
      "aspf": "r",
      "reports": [
        {
          "kind": "rua",
          "uri": "mailto:dmarc@example.com",
          "domain": "example.com",
          "external": false,
          "authorized": true
        }
      ]
    },
    "dkim": {
      "selectors_tried": [
        "google",
        "selector1",
        "selector2",
        "zmail",
        "zoho",
        "fm1",
        "fm2",
        "fm3",
        "protonmail",
        "protonmail2",
        "protonmail3",
        "hostingermail-a",
        "hostingermail-b",
        "hostingermail-c",
        "sig1",
        "s1",
        "s2",
        "smtp",
        "mx",
        "k1",
        "pic",
        "k2",
        "k3",
        "pm",
        "brevo1",
        "brevo2",
        "mail",
        "scph0920",
        "scph1021",
        "hs1",
        "hs2",
        "zendesk1",
        "zendesk2",
        "default",
        "dkim",
        "selector",
        "key1",
        "key2",
        "email",
        "dkim1"
      ],
      "failed": [],
      "found": [
        {
          "selector": "google",
          "name": "google._domainkey.example.com",
          "status": "ok",
          "key_type": "rsa",
          "key_bits": 2048,
          "testing": false,
          "provider": "google-workspace",
          "record": "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApTGFY+knX9gV8lx+vLMRL+4h2Vef2XWTq1+IUtMY/ZRRoGQG31IR2Yz+FkzYaolUU2JMq2NbUzELco8z3Ef/iPmN4wITl7/cTQnwbn15fwvgeP59ICpyWpGtr/aq83ISRBjKEfTlRub1tRG/VVps0QaD4GjVBMGVPLYKKvlT9gG2Bzd86bLTkPOJcVHhjzqytVoqVW09guYc9W6J2XDfTES0ocQ7/p4zDR6/wmR4su5wwcy8C5GpeyKNERmR6w9DvH0c1ySrjtpvBMjDu4LTT4ruHJCHLqbWA1M31nFAi30vasgB0q6JZcEcOyM1ByetpiuqLfWNTLBm+RWQe4BguQIDAQAB"
        }
      ]
    },
    "policies": {
      "checked": true,
      "mta_sts": {
        "present": true,
        "record": "v=STSv1; id=2026111401",
        "verdict": "enforced",
        "headline": "MTA-STS is enforced: senders must deliver over verified TLS.",
        "checked": true
      },
      "tls_rpt": {
        "present": true,
        "record": "v=TLSRPTv1; rua=mailto:tlsrpt@example.com",
        "verdict": "valid",
        "headline": "TLS-RPT reports are requested.",
        "checked": true
      },
      "bimi": {
        "present": false,
        "verdict": "missing",
        "headline": "No BIMI record, so no brand logo in inboxes.",
        "checked": true
      }
    },
    "min_ttl": 300
  },
  "credits_remaining": 498
}
```

## MCP

```json
{
  "tool": "audit_email",
  "arguments": {
    "domain": "example.com"
  }
}
```

```text
Email for example.com is set up well: grade A, 100 of 100. Mail is handled by Google Workspace.
Score: 100/100
Providers: Google Workspace (MX)
MX: aspmx.l.google.com (1), alt1.aspmx.l.google.com (5)
SPF: v=spf1 include:_spf.google.com ~all (4 of 10 lookups)
DMARC: p=reject, 1 report address
DKIM: google (2048-bit RSA); tried 40 selectors
Policies: MTA-STS enforced, TLS-RPT yes, BIMI no
- info: Your SPF record ends in ~all
- info: No BIMI record
6 checks passed
Credits: 2 credits used, 498 remaining | fresh | checked 2026-11-14 10:00 UTC
```
