Skip to Content
Email Security API

Batch Email Security Checks1 Credit / item

Check the email setup of up to 1000 domains in one call, and read their reports as a run.

POST
/v1/email/batch

Up to 1000 items in one call, each answered as its single call would answer it. Send the shared parameters beside the list. Every call creates a run and answers 202 with it at once: items already in the result cache are answered in it, and the rest show as pending. Read it at /v1/runs/{id} while its status is queued or running; each read shows the items finished so far. It ends completed, or failed when the run could not finish, which bills nothing. GET /v1/runs lists your runs. Each answered item (HTTP 200) costs 1 credit; failed items are not billed. The call reserves the cost of every item and is charged for the items answered when the run completes. See Batch Runs for the whole flow.

Authorization

See Authentication for details.

headerX-API-Key<token>

Provide your API key in an HTTP request header.

Request Body

application/json
  1. body
domains*array<>

The domains to check, 1000 at most, each a domain or an email address or URL with one. Each is answered as /v1/email?domain= would answer it, and billed only when answered

Items1 <= items <= 1000
verbose?boolean

Return extra detail: totalElapsed, retries and params, plus each errors entry's detail when the lookup fails. For email, each check also has a verifyCommand (dig), and the report adds the SPF include tree with per-record lookup counts (spf.tree), every DKIM selector probed (dkim.selectorsProbed), each DKIM key record and the MTA-STS policy file as served.

Defaultfalse
checks?string

The sections to run, as a comma list of mx, spf, dkim, dmarc, bimi, mtasts, tlsrpt, dane, ptr, dnssec. Every one by default; one is the sub-check form, which costs the same 1 credit with a smaller body. The SMTP/STARTTLS probe (smtp) and DNSBL listings (blacklist) are not offered yet

selector?string

DKIM selectors to check, as a comma list of at most 10. Checked first, and a selector with no key fails. The common selector list is still probed unless dkimDiscovery=false

dkimDiscovery?boolean

Probe a list of common DKIM selectors, ordered by the provider the domain's MX and SPF point at. Off checks only the selectors given

Defaulttrue
fresh?boolean

Run the checks again instead of answering from the 10-minute cache

Defaultfalse
transport?string

Transport for the DNS queries to each zone's nameservers. With udp, an answer too large for UDP is asked again over TCP; tcp asks everything over TCP

Default"udp"
Value in"udp""tcp"

Response Body

The run: queued, or completed already when every item was in the result cache. Read it by id

application/json
  1. response
id*string

The run ID, which names its tool: read it back at /v1/runs/{id}

tool*"email"

The tool the run belongs to

Value in"email"
endpoint*string

The endpoint that created it

status*string

queued or running until every item has an outcome, then completed. failed means the run itself could not finish and nothing was billed

Value in"queued""running""completed""failed"
createdAt*string
completedAt*|

When every item had an outcome; null until then

items*integer

How many items were sent

answered*|

How many items were answered (HTTP 200), the ones billed; null until completed

credits*|

What the run cost: answered items times the per-item price; null until completed

results*array<>|

One entry per item, in the order sent: the outcome of each finished item, the rest pending. Null for a failed run

errors*array<>

Why the run itself failed; empty otherwise. Each failed item has its own errors

Errors

See Errors for the response format.

invalid_request
A parameter is missing or not valid: an unknown check, a check not offered yet (smtp, blacklist), or more than 10 selectors.
400
invalid_query
The query is not a domain name, an email address or a URL with one.
400
authentication_failed
No API key was sent, or it could not be checked.
401
invalid_api_key
The API key is not valid.
401
api_key_expired
The API key has expired.
401
out_of_credits
The account has no credits left.
402
forbidden
The caller may not use this tool.
403
not_found
The domain does not exist.
404
rate_limited
The caller is over its rate limit; retry after the Retry-After header.
429
internal_error
An internal error on our side.
500
Example Request
curl -X POST 'https://api.dns.tools/v1/email/batch' \  -H 'Content-Type: application/json' \  -d '{  "domains": [    "github.com",    "gmail.com",    "no-such-domain-4821.com"  ]}'
Example Response
{  "id": "run_email_01m8sgqhnkxk8p2pazbx6vxnaf",  "tool": "email",  "endpoint": "batch",  "status": "completed",  "createdAt": "2026-12-01T19:18:59.647Z",  "completedAt": "2026-12-01T19:19:01.838Z",  "items": 3,  "answered": 2,  "credits": 2,  "results": [    {      "query": "github.com",      "pending": false,      "cached": false,      "errors": [],      "result": {        "mx": null,        "spf": {          "errors": [],          "record": "v=spf1 ip4:192.30.252.0/22 ip4:172.170.10.240/28 ip4:40.78.162.192/28 ip4:172.170.3.48/28 include:spf.protection.outlook.com include:_netblocks.google.com include:_netblocks2.google.com include:mail.zendesk.com include:_spf.salesforce.com include:servers.mcsv.net include:mktomail.com include:sendgrid.net ip4:62.253.227.114 ip4:166.78.69.169 ip4:166.78.69.170 ip4:166.78.71.131 ~all",          "records": 1,          "includes": [            "spf.protection.outlook.com",            "_netblocks.google.com",            "_netblocks2.google.com",            "mail.zendesk.com",            "_spf.salesforce.com",            "servers.mcsv.net",            "mktomail.com",            "sendgrid.net",            "ab.sendgrid.net"          ],          "dnsLookups": 10,          "lookupLimit": 10,          "voidLookups": 0,          "allQualifier": "~all",          "voidLookupLimit": 2,          "exceedsLookupLimit": false,          "authorizesAddresses": true        },        "bimi": null,        "dane": null,        "dkim": null,        "dmarc": {          "pct": 100,          "psd": null,          "rua": [            {              "uri": "mailto:dmarc@github.com",              "domain": "github.com",              "external": false,              "authorized": null            }          ],          "ruf": [            {              "uri": "mailto:dmarc@github.com",              "domain": "github.com",              "external": false,              "authorized": null            }          ],          "errors": [],          "policy": "quarantine",          "record": "v=DMARC1; p=quarantine; sp=reject; pct=100; rua=mailto:dmarc@github.com; ruf=mailto:dmarc@github.com; fo=1",          "testing": false,          "alignment": {            "spf": "r",            "dkim": "r"          },          "recordName": "_dmarc.github.com",          "removedTags": [            "pct"          ],          "appliedPolicy": "quarantine",          "inheritedFrom": null,          "subdomainPolicy": "reject",          "nonexistentSubdomainPolicy": "reject"        },        "fixes": [          {            "fix": "Trim includes for services that no longer send before adding another.",            "check": "spf-lookups",            "record": null,            "severity": "low"          },          {            "fix": "Change ~all to -all once every sender is listed. With a DMARC policy of quarantine or reject, ~all is acceptable.",            "check": "spf-all",            "record": {              "name": "github.com",              "type": "TXT",              "value": "v=spf1 ip4:192.30.252.0/22 ip4:172.170.10.240/28 ip4:40.78.162.192/28 ip4:172.170.3.48/28 include:spf.protection.outlook.com include:_netblocks.google.com include:_netblocks2.google.com include:mail.zendesk.com include:_spf.salesforce.com include:servers.mcsv.net include:mktomail.com include:sendgrid.net ip4:62.253.227.114 ip4:166.78.69.169 ip4:166.78.69.170 ip4:166.78.71.131 -all"            },            "severity": "low"          },          {            "fix": "Remove pct from the record.",            "check": "dmarc-deprecated-tags",            "record": null,            "severity": "info"          }        ],        "grade": "A+",        "score": 95,        "checks": [          {            "id": "spf-record",            "fix": null,            "name": "SPF record",            "state": "ok",            "detail": "v=spf1 ip4:192.30.252.0/22 ip4:172.170.10.240/28 ip4:40.78.162.192/28 ip4:172.170.3.48/28 include:spf.protection.outlook.com include:_netblocks.google.com include:_netblocks2.google.com include:mail.zendesk.com include:_spf.salesforce.com include:servers.mcsv.net include:mktomail.com include:sendgrid.net ip4:62.253.227.114 ip4:166.78.69.169 ip4:166.78.69.170 ip4:166.78.71.131 ~all",            "record": null,            "section": "spf",            "category": "spf",            "severity": "info"          },          {            "id": "spf-syntax",            "fix": null,            "name": "SPF syntax",            "state": "ok",            "detail": "Every term parses.",            "record": null,            "section": "spf",            "category": "spf",            "severity": "info"          },          {            "id": "spf-lookups",            "fix": "Trim includes for services that no longer send before adding another.",            "name": "SPF DNS lookups",            "state": "warn",            "detail": "10 DNS lookups of 10. One more include will break SPF.",            "record": null,            "section": "spf",            "category": "spf",            "severity": "low"          },          {            "id": "spf-void-lookups",            "fix": null,            "name": "SPF void lookups",            "state": "ok",            "detail": "No lookup comes back empty.",            "record": null,            "section": "spf",            "category": "spf",            "severity": "info"          },          {            "id": "spf-includes",            "fix": null,            "name": "SPF includes",            "state": "ok",            "detail": "9 includes, each with one SPF record: spf.protection.outlook.com, _netblocks.google.com, _netblocks2.google.com, mail.zendesk.com, _spf.salesforce.com, servers.mcsv.net, mktomail.com, sendgrid.net, ab.sendgrid.net.",            "record": null,            "section": "spf",            "category": "spf",            "severity": "info"          },          {            "id": "spf-all",            "fix": "Change ~all to -all once every sender is listed. With a DMARC policy of quarantine or reject, ~all is acceptable.",            "name": "SPF all",            "state": "warn",            "detail": "The record ends in ~all (softfail): unlisted senders are only marked, not rejected.",            "record": {              "name": "github.com",              "type": "TXT",              "value": "v=spf1 ip4:192.30.252.0/22 ip4:172.170.10.240/28 ip4:40.78.162.192/28 ip4:172.170.3.48/28 include:spf.protection.outlook.com include:_netblocks.google.com include:_netblocks2.google.com include:mail.zendesk.com include:_spf.salesforce.com include:servers.mcsv.net include:mktomail.com include:sendgrid.net ip4:62.253.227.114 ip4:166.78.69.169 ip4:166.78.69.170 ip4:166.78.71.131 -all"            },            "section": "spf",            "category": "spf",            "severity": "low"          },          {            "id": "spf-ptr",            "fix": null,            "name": "SPF ptr",            "state": "ok",            "detail": "No ptr mechanism.",            "record": null,            "section": "spf",            "category": "spf",            "severity": "info"          },          {            "id": "dmarc-record",            "fix": null,            "name": "DMARC record",            "state": "ok",            "detail": "v=DMARC1; p=quarantine; sp=reject; pct=100; rua=mailto:dmarc@github.com; ruf=mailto:dmarc@github.com; fo=1",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          },          {            "id": "dmarc-syntax",            "fix": null,            "name": "DMARC syntax",            "state": "ok",            "detail": "Every tag is valid.",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          },          {            "id": "dmarc-policy",            "fix": null,            "name": "DMARC policy",            "state": "ok",            "detail": "p=quarantine: forged mail is sent to spam.",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          },          {            "id": "dmarc-subdomain-policy",            "fix": null,            "name": "DMARC subdomain policy",            "state": "ok",            "detail": "Subdomains get reject.",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          },          {            "id": "dmarc-testing",            "fix": null,            "name": "DMARC testing mode",            "state": "ok",            "detail": "The policy applies in full.",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          },          {            "id": "dmarc-deprecated-tags",            "fix": "Remove pct from the record.",            "name": "DMARC removed tags",            "state": "warn",            "detail": "RFC 9989 removed pct; receivers following it ignore them.",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          },          {            "id": "dmarc-reporting",            "fix": null,            "name": "DMARC reports",            "state": "ok",            "detail": "Aggregate reports go to mailto:dmarc@github.com.",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          },          {            "id": "dmarc-external-reports",            "fix": null,            "name": "DMARC external report authorization",            "state": "not-applicable",            "detail": "Every report address is at the same organization.",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          }        ],        "dnssec": null,        "domain": "github.com",        "mtaSts": null,        "parked": null,        "tlsRpt": null,        "partial": false,        "summary": {          "failed": 0,          "passed": 11,          "warnings": 3,          "notChecked": 0        },        "gradeCaps": [],        "sendsMail": null,        "categories": {          "mx": {            "score": null,            "failed": 0,            "passed": 0,            "warnings": 0,            "notChecked": 0          },          "spf": {            "score": 90,            "failed": 0,            "passed": 5,            "warnings": 2,            "notChecked": 0          },          "dkim": {            "score": null,            "failed": 0,            "passed": 0,            "warnings": 0,            "notChecked": 0          },          "brand": {            "score": null,            "failed": 0,            "passed": 0,            "warnings": 0,            "notChecked": 0          },          "dmarc": {            "score": 100,            "failed": 0,            "passed": 6,            "warnings": 1,            "notChecked": 0          },          "transport": {            "score": null,            "failed": 0,            "passed": 0,            "warnings": 0,            "notChecked": 0          }        },        "acceptsMail": true,        "canBeSpoofed": false,        "mailProvider": "Microsoft 365",        "checksRequested": [          "spf",          "dmarc"        ],        "organizationalDomain": "github.com"      },      "status": 200    },    {      "query": "gmail.com",      "pending": false,      "cached": false,      "errors": [],      "result": {        "mx": null,        "spf": {          "errors": [],          "record": "v=spf1 redirect=_spf.google.com",          "records": 1,          "includes": [            "_spf.google.com"          ],          "dnsLookups": 1,          "lookupLimit": 10,          "voidLookups": 0,          "allQualifier": "~all",          "voidLookupLimit": 2,          "exceedsLookupLimit": false,          "authorizesAddresses": true        },        "bimi": null,        "dane": null,        "dkim": null,        "dmarc": {          "pct": null,          "psd": null,          "rua": [            {              "uri": "mailto:mailauth-reports@google.com",              "domain": "google.com",              "external": true,              "authorized": true            }          ],          "ruf": [],          "errors": [],          "policy": "none",          "record": "v=DMARC1; p=none; sp=quarantine; rua=mailto:mailauth-reports@google.com",          "testing": false,          "alignment": {            "spf": "r",            "dkim": "r"          },          "recordName": "_dmarc.gmail.com",          "removedTags": [],          "appliedPolicy": "none",          "inheritedFrom": null,          "subdomainPolicy": "quarantine",          "nonexistentSubdomainPolicy": "quarantine"        },        "fixes": [          {            "fix": "Move to p=quarantine, then p=reject, once your reports show legitimate mail passing SPF or DKIM in alignment.",            "check": "dmarc-policy",            "record": {              "name": "_dmarc.gmail.com",              "type": "TXT",              "value": "v=DMARC1; p=quarantine; sp=quarantine; rua=mailto:mailauth-reports@google.com"            },            "severity": "high"          },          {            "fix": "Change ~all to -all once every sender is listed. With a DMARC policy of quarantine or reject, ~all is acceptable. The all comes from the redirect target, so change it in _spf.google.com's record.",            "check": "spf-all",            "record": null,            "severity": "low"          }        ],        "grade": "C",        "score": 81,        "checks": [          {            "id": "spf-record",            "fix": null,            "name": "SPF record",            "state": "ok",            "detail": "v=spf1 redirect=_spf.google.com",            "record": null,            "section": "spf",            "category": "spf",            "severity": "info"          },          {            "id": "spf-syntax",            "fix": null,            "name": "SPF syntax",            "state": "ok",            "detail": "Every term parses.",            "record": null,            "section": "spf",            "category": "spf",            "severity": "info"          },          {            "id": "spf-lookups",            "fix": null,            "name": "SPF DNS lookups",            "state": "ok",            "detail": "1 DNS lookup of 10.",            "record": null,            "section": "spf",            "category": "spf",            "severity": "info"          },          {            "id": "spf-void-lookups",            "fix": null,            "name": "SPF void lookups",            "state": "ok",            "detail": "No lookup comes back empty.",            "record": null,            "section": "spf",            "category": "spf",            "severity": "info"          },          {            "id": "spf-includes",            "fix": null,            "name": "SPF includes",            "state": "ok",            "detail": "1 include, each with one SPF record: _spf.google.com.",            "record": null,            "section": "spf",            "category": "spf",            "severity": "info"          },          {            "id": "spf-all",            "fix": "Change ~all to -all once every sender is listed. With a DMARC policy of quarantine or reject, ~all is acceptable. The all comes from the redirect target, so change it in _spf.google.com's record.",            "name": "SPF all",            "state": "warn",            "detail": "The record ends in ~all (softfail): unlisted senders are only marked, not rejected.",            "record": null,            "section": "spf",            "category": "spf",            "severity": "low"          },          {            "id": "spf-ptr",            "fix": null,            "name": "SPF ptr",            "state": "ok",            "detail": "No ptr mechanism.",            "record": null,            "section": "spf",            "category": "spf",            "severity": "info"          },          {            "id": "dmarc-record",            "fix": null,            "name": "DMARC record",            "state": "ok",            "detail": "v=DMARC1; p=none; sp=quarantine; rua=mailto:mailauth-reports@google.com",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          },          {            "id": "dmarc-syntax",            "fix": null,            "name": "DMARC syntax",            "state": "ok",            "detail": "Every tag is valid.",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          },          {            "id": "dmarc-policy",            "fix": "Move to p=quarantine, then p=reject, once your reports show legitimate mail passing SPF or DKIM in alignment.",            "name": "DMARC policy",            "state": "warn",            "detail": "p=none only monitors: forged mail is still delivered.",            "record": {              "name": "_dmarc.gmail.com",              "type": "TXT",              "value": "v=DMARC1; p=quarantine; sp=quarantine; rua=mailto:mailauth-reports@google.com"            },            "section": "dmarc",            "category": "dmarc",            "severity": "high"          },          {            "id": "dmarc-subdomain-policy",            "fix": null,            "name": "DMARC subdomain policy",            "state": "ok",            "detail": "Subdomains get quarantine.",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          },          {            "id": "dmarc-testing",            "fix": null,            "name": "DMARC testing mode",            "state": "ok",            "detail": "The policy applies in full.",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          },          {            "id": "dmarc-deprecated-tags",            "fix": null,            "name": "DMARC removed tags",            "state": "ok",            "detail": "No removed tags.",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          },          {            "id": "dmarc-reporting",            "fix": null,            "name": "DMARC reports",            "state": "ok",            "detail": "Aggregate reports go to mailto:mailauth-reports@google.com.",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          },          {            "id": "dmarc-external-reports",            "fix": null,            "name": "DMARC external report authorization",            "state": "ok",            "detail": "google.com authorized to receive reports.",            "record": null,            "section": "dmarc",            "category": "dmarc",            "severity": "info"          }        ],        "dnssec": null,        "domain": "gmail.com",        "mtaSts": null,        "parked": null,        "tlsRpt": null,        "partial": false,        "summary": {          "failed": 0,          "passed": 13,          "warnings": 2,          "notChecked": 0        },        "gradeCaps": [          "dmarc-not-enforced"        ],        "sendsMail": null,        "categories": {          "mx": {            "score": null,            "failed": 0,            "passed": 0,            "warnings": 0,            "notChecked": 0          },          "spf": {            "score": 95,            "failed": 0,            "passed": 6,            "warnings": 1,            "notChecked": 0          },          "dkim": {            "score": null,            "failed": 0,            "passed": 0,            "warnings": 0,            "notChecked": 0          },          "brand": {            "score": null,            "failed": 0,            "passed": 0,            "warnings": 0,            "notChecked": 0          },          "dmarc": {            "score": 70,            "failed": 0,            "passed": 7,            "warnings": 1,            "notChecked": 0          },          "transport": {            "score": null,            "failed": 0,            "passed": 0,            "warnings": 0,            "notChecked": 0          }        },        "acceptsMail": true,        "canBeSpoofed": true,        "mailProvider": "Google Workspace",        "checksRequested": [          "spf",          "dmarc"        ],        "organizationalDomain": "gmail.com"      },      "status": 200    },    {      "query": "no-such-domain-4821.com",      "pending": false,      "cached": false,      "errors": [        {          "code": "not_found",          "message": "The host does not resolve to any address.",          "retryable": false        }      ],      "result": null,      "status": 404    }  ],  "errors": []}