Email Authentication Check
Grade a domain's MX, SPF, DKIM and DMARC setup from 0 to 100.
curl -X POST https://api.1lookup.dev/v1/email-authentication-check \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domain":"example.com"}'{
"success": true,
"data": {
"domain": "example.com",
"score": 62,
"mx": {
"found": true,
"records": [
{
"host": "mx1.example.com",
"priority": 10
},
{
"host": "mx2.example.com",
"priority": 20
}
]
},
"spf": {
"found": true,
"record": "v=spf1 include:_spf.example.com include:mail.example.com ~all",
"dns_lookups": 11,
"valid": false
},
"dkim": {
"found": true,
"selectors": [
"s1",
"default"
]
},
"dmarc": {
"found": true,
"record": "v=DMARC1; p=none; rua=mailto:dmarc@example.com",
"policy": "none"
},
"issues": [
{
"code": "spf_too_many_lookups",
"severity": "high",
"message": "SPF needs 11 DNS lookups. The limit is 10.",
"fix": "Remove unused include mechanisms or replace them with ip4 and ip6 entries."
},
{
"code": "dmarc_policy_none",
"severity": "medium",
"message": "DMARC is published with p=none, so mail that fails authentication is still delivered.",
"fix": "Review your aggregate reports, then move to p=quarantine."
}
]
},
"meta": {
"credits_used": 2,
"credits_remaining": 999,
"cached": false,
"request_id": "req_8f3a2c1e9b7d"
}
}Authorization
Authorizationstring<bearer>requiredYour API key as a Bearer token. Live keys start with 1lk_live_. Test keys start with 1lk_test_ and return this endpoint's sample response without spending credits. See authentication.
Body
Send the fields as a JSON object with Content-Type: application/json.
domainstring<domain>requiredDomain. The sending domain, without a protocol. Example: example.com
freshbooleanSkip the 7-day cache and run a new lookup. Charged as a normal lookup.
referencestringYour own identifier, echoed back in meta and shown in lookup history.
Response
A 200 response carries the result in data and the cost of the call in meta. These are the fields most integrations read.
successbooleantrue when the lookup ran.
data.scorenumberA grade from 0 to 100 for the domain's overall authentication setup.
data.mx.foundbooleanWhether the domain publishes MX records, with the hosts listed next to it.
data.spf.recordstringThe SPF TXT record exactly as published.
data.spf.dns_lookupsnumberHow many DNS lookups the record triggers. More than 10 breaks SPF.
data.dkim.selectorsarrayThe common selectors that returned a public key for this domain.
data.dmarc.policystringnone, quarantine or reject, taken from the published DMARC record.
data.issuesarrayEach problem found, with a severity, a description and the fix.
meta.credits_usednumberCredits charged for this call.
meta.credits_remainingnumberYour balance after the call.
meta.cachedbooleantrue when the result came from the 7-day cache.
meta.request_idstringQuote this when you contact support.
Errors
A failed request returns success: false with an error object, and is never charged. The full list is on the errors page.
| HTTP | Code | Meaning |
|---|---|---|
| 401 | unauthorized | The key is missing, malformed or revoked. |
| 402 | insufficient_credits | Your credits are used up and pay as you go is off or at its limit. |
| 422 | invalid_input | A field is missing or malformed. The field property names it. |
| 429 | rate_limited | Too many requests for this key. Wait for the Retry-After interval. |
| 500 | internal_error | Something failed on our side. Safe to retry. |
| 503 | source_unavailable | An upstream source did not answer in time. Safe to retry. |
Billing
2 credits. Charged when the lookup runs and returns a result. Errors are never charged, and repeating the same input within 7 days is served from cache at no charge.
Product overview and use cases