senapati
Documentation index

DKIM Check

DKIM signs mail with a private key and publishes the public key in DNS under a selector. This check fetches the key record at <selector>._domainkey.<domain>, parses its tags, decodes the key to report its type and size, and flags what would make verifiers reject it. Without a selector it tries the selectors the big providers and ESPs use until one answers.

POST/api/dkim-checkCosts 2 creditsAPI key

Validate a domain's DKIM key record (2 credits)

Selectors

The selector is the s= value of a DKIM-Signature header; a domain can publish any number of keys under different selectors. Pass it when you have a message in hand. Without one, about 150 common selectors are tried in batches of 25 until a batch answers, under a four-second budget; many domains sign with selectors that are dates or random tokens, and those cannot be discovered. The free tool tries the 50 most common.

  • cname_target shows where the key host points when an ESP hosts the key (Microsoft 365 and Google Workspace both do).
  • When every selector tried answers with the same record, the zone has a wildcard and the selector cannot be confirmed (WILDCARD_DKIM_RECORD).

The key

  • key_type is rsa (the default) or ed25519; key_bits comes from decoding p=. RSA keys under 2048 bits draw a warning, under 1024 an error (RFC 8301).
  • An empty p= means the key was revoked (revoked: true); t=y marks it as in testing; h=sha1 alone is flagged because RFC 8301 forbids SHA-1.
  • v=DKIM1 is optional in RFC 6376; its absence is only a note, but a wrong value or a misplaced tag is an error.

Issue codes

codetypeMeans
DKIM_NOT_FOUNDerrorNo key at the selector given, or none of the selectors tried
DISCOVERY_TIMED_OUTinfoDiscovery hit its time budget before a selector answered
DUPLICATE_DKIM_RECORDSerrorMore than one key record at the host
MISSING_P_TAGerrorNo p= tag
PUBLIC_KEY_REVOKEDwarningp= is empty
INVALID_P_TAG_CHARS / PUBLIC_KEY_NOT_VALIDerrorp= is not base64, or not a key of the declared type
WEAK_PUBLIC_KEY_BITSwarning / errorRSA key under 2048 bits / under 1024 bits
SHA1_ONLYwarningh=sha1 restricts the key to SHA-1
TESTING_MODEinfot=y
INVALID_K_TAG_CHARS / INVALID_H_TAG_CHARS / INVALID_S_TAG_CHARS / INVALID_T_TAG_CHARSerrorA tag has a value verifiers do not accept
WILDCARD_DKIM_RECORDinfoEvery selector answers with the same record
DNS_LOOKUP_FAILEDerrorA lookup did not complete; the report is partial

Request

JSON body
FieldTypeDescription
domain*stringSigning domain (the d= of a DKIM-Signature header)
selectorstring | nullSelector (the s= of a DKIM-Signature header). Omit to try common selectors until one answers

Authenticate with API key. Send it as the X-API-Key header.

curl -X POST "https://api.senapati.io/api/dkim-check" \
  -H "X-API-Key: $SENAPATI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain":"microsoft.com"}'

Response

Every success is wrapped in { "data": … } with a request_id; the fields below describe data. See Errors for the failure shape.

response: 200 OKDKIMCheckData
{
"request_id": "req_c41e88aa",
"timestamp": "2026-10-21T09:30:12.418203+00:00",
"data": {
"domain": "microsoft.com",
"selector": "selector2",
"selector_given": false,
"selectors_tried": 25,
"dkim_host": "selector2._domainkey.microsoft.com",
"cname_target": "selector2-microsoft-com._domainkey.microsoft.onmicrosoft.com",
"has_dkim_record": true,
"dkim_record": "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCPkb8bu8RGWeJGk3hJrouZXIdZ+HTp/azRp8IUOHp5wKvPUAi/54PwuLscUjRk4Rh3hjIkMpKRfJJXPxWbrT7eMLric7f/S0h+qF4aqIiQqHFCDAYfMnN6V3Wbke2U5EGm0H/cAUYkaf2AtuHJ/rdY/EXaldAm00PgT9QQMez66QIDAQAB;",
"dkim_records_count": 1,
"version": "DKIM1",
"key_type": "rsa",
"key_bits": 1024,
"hash_algorithms": [],
"service_types": [
"*"
],
"flags": [],
"testing_mode": false,
"revoked": false,
"other_selectors_found": [
"m1",
"s1024"
],
"issues_found": [
{
"code": "WEAK_PUBLIC_KEY_BITS",
"type": "warning",
"message": "1024-bit RSA key; 2048 bits is the recommended minimum"
}
],
"has_issues": true,
"valid": true,
"lookup_failed": false,
"elapsed_ms": 130
}
}

Discovered, not given: selector_given is false and other_selectors_found lists the further selectors that also answered in the same round.

data · DKIMCheckData
FieldTypeDescription
domain*string
selector*string | nullThe selector checked: the one given, or the first one discovered
selector_given*booleanFalse when the selector was discovered
selectors_tried*integerHow many selectors were queried
dkim_host*string | null<selector>._domainkey.<domain>
cname_target*string | nullWhere the key host points when it is an alias (common with ESPs)
has_dkim_record*boolean
dkim_record*string | null
dkim_records_count*integerKey records at the host; more than one is an error
version*string | nullv tag, normally DKIM1; optional in RFC 6376
key_type*string | nullk tag: rsa or ed25519
key_bits*integer | nullPublic key size; 2048 is the recommended RSA minimum
hash_algorithms*string[]h tag, when it restricts hash algorithms
service_types*string[]s tag; * when unrestricted
flags*string[]t tag flags: y (testing), s (strict domain match)
testing_mode*boolean
revoked*booleanTrue when p= is empty: the key was revoked
other_selectors_found*string[]Further selectors that also answered during discovery
issues_found*AuthIssue[]
↳ code*stringStable machine-readable code, e.g. PLUS_ALL_FOUND
↳ type*"error" | "warning" | "info"error: receivers reject or ignore the record; warning: it works but is weaker than it should be; info: a note, not a defect
↳ message*stringWhat was found and why it matters
has_issues*boolean
valid*booleanA key record exists and verifiers can use it
lookup_failed*booleanTrue when a DNS query did not complete; the report is partial
elapsed_msintegerdefault 0

Errors

  • 401missing or invalid API key / token
  • 402not enough credits on the account
  • 422the request body or a parameter failed validation
  • 429plan rate limit exceeded

Nested objects

data.issues_found[] · AuthIssue
FieldTypeDescription
code*stringStable machine-readable code, e.g. PLUS_ALL_FOUND
type*"error" | "warning" | "info"error: receivers reject or ignore the record; warning: it works but is weaker than it should be; info: a note, not a defect
message*stringWhat was found and why it matters

Notes

  • This checks the published key, not a signature: whether a given message was signed correctly needs the message itself.
  • A report with lookup_failed: true is partial, for example when discovery ran out of time; retry it.