DKIM Validator API Reference
Validate the DKIM record of a domain and selector: check that the public key record exists, is correctly formatted, and detect common configuration issues.
Service details and pricing: DKIM Validator API
Request example
Query the endpoint via an HTTPS POST request (replace YOUR_API_KEY_HERE with your API key):
curl -X POST "https://api.apivoid.com/v2/dkim-validator" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-d '{"host": "stripe.com"}'The same request in PHP:
$host = 'stripe.com';
$apiKey = 'YOUR_API_KEY_HERE';
$curl = curl_init('https://api.apivoid.com/v2/dkim-validator');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'X-API-Key: ' . $apiKey]);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode(['host' => $host]));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($httpCode === 200) {
$responseData = json_decode($response, true);
print_r($responseData);
} else {
print_r('An error occurred: '.$response);
}Request parameters
Required
Host to submit, e.g. google.com.
Optional
DKIM selector to check. If omitted, the API tries 500+ known selectors automatically.
Response example
A successful request returns HTTP 200 with a JSON body:
{
"selector": "s2",
"host": "stripe.com",
"dkim_host": "s2._domainkey.stripe.com",
"cname_target": "s2.domainkey.u2680008.wl009.sendgrid.net",
"has_dkim_record": true,
"dkim_record": "k=rsa; t=s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDR/9Km49dOTJZfnn/mL4N3Pv6RDxVq7VmN+/fYUcy3LUv2Vczz7TQFe071srBQWAOCpEQLAXJbRJYp+ltcW8IGECRGYLabp6un7lWDO4TVTXNwe+YKgCwSnNv8fREDXa44KU2zYp3rkaAmm2EaXrZLCupKQ8hR3ZcIJqzmdl1iUwIDAQAB",
"dkim_records_count": 1,
"version": "DKIM1",
"key_type": "rsa",
"issues_found": [
{
"code": "V_TAG_NOT_FOUND",
"type": "warning",
"message": "The v tag is missing"
},
{
"code": "WEAK_PUBLIC_KEY_BITS",
"type": "warning",
"message": "Public key uses weak 1024 bits"
}
],
"valid": true,
"elapsed_ms": 196
}Response fields
The fields returned in the JSON response:
selectorstring
The DKIM selector specified or automatically discovered.
hoststring
Host submitted for the DKIM check.
dkim_hoststring
The full DKIM host name (selector._domainkey.domain).
cname_targetstring
The CNAME target for the DKIM record.
has_dkim_recordboolean
Returns true if DKIM record is found.
dkim_recordstring
DKIM record, e.g. v=DKIM1; k=rsa; t=s; p=MIGfMA0GCSqGSIb...
dkim_records_countinteger
Returns the number of DKIM records found for the same selector (only one is expected).
versionstring
Returns the DKIM version specified in the v= tag, defaulting to DKIM1 when absent.
key_typestring
Returns the DKIM key type from the k= tag (e.g. rsa, ed25519).
issues_foundarray
Array of issues found, the "code" field can be DKIM_NOT_FOUND, DUPLICATE_DKIM_RECORDS, V_TAG_NOT_FOUND, V_TAG_NOT_FIRST, MISSING_P_TAG, NO_DKIM_TAGS_FOUND, INVALID_DKIM_TAG_FOUND, UNKNOWN_DKIM_TAG_FOUND, INVALID_H_TAG_CHARS, INVALID_K_TAG_CHARS, PUBLIC_KEY_REVOKED, INVALID_P_TAG_CHARS, PUBLIC_KEY_NOT_VALID, WEAK_PUBLIC_KEY_BITS, INVALID_S_TAG_CHARS, INVALID_T_TAG_CHARS.
issues_found[n] → codestring
Machine-readable issue code, e.g. WEAK_PUBLIC_KEY_BITS.
issues_found[n] → typestring
Issue severity: error, warning or information.
issues_found[n] → messagestring
Human-readable description of the issue.
validboolean
Returns true if the DKIM record is valid.
elapsed_msinteger
Time taken to process the request, in milliseconds.