APIVoid logo

DMARC Validator API Reference

Validate the DMARC record of a domain: check that the record exists, parse its policy tags, and detect common configuration issues, with detailed explanations.

Service details and pricing: DMARC Validator API

POSThttps://api.apivoid.com/v2/dmarc-validator
5 credits per successful requestPOST · JSON

Request example

Query the endpoint via an HTTPS POST request (replace YOUR_API_KEY_HERE with your API key):

curl
curl -X POST "https://api.apivoid.com/v2/dmarc-validator" \
     -H "Content-Type: application/json" \
     -H "X-API-Key: YOUR_API_KEY_HERE" \
     -d '{"host": "paypal.com"}'

The same request in PHP:

php
$host = 'paypal.com';

$apiKey = 'YOUR_API_KEY_HERE';

$curl = curl_init('https://api.apivoid.com/v2/dmarc-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

hoststringRequired

Host to submit, e.g. google.com.

Response example

A successful request returns HTTP 200 with a JSON body:

json · 200
{
    "host": "paypal.com",
    "dmarc_host": "_dmarc.paypal.com",
    "cname_target": "",
    "has_dmarc_record": true,
    "dmarc_record": "p=reject; rua=mailto:d@rua.agari.com; ruf=mailto:d@ruf.agari.com",
    "dmarc_records_count": 1,
    "domain_policy": "reject",
    "subdomain_policy": "",
    "dmarc_enforced": true,
    "rua_emails": [
        {
            "email": "d@rua.agari.com",
            "domain": "rua.agari.com",
            "has_mx_records": true
        }
    ],
    "ruf_emails": [
        {
            "email": "d@ruf.agari.com",
            "domain": "ruf.agari.com",
            "has_mx_records": true
        }
    ],
    "version": "DMARC1",
    "issues_found": [
        {
            "code": "V_TAG_NOT_FOUND",
            "type": "warning",
            "message": "The v tag is missing"
        }
    ],
    "valid": true,
    "elapsed_ms": 78
}

Response fields

The fields returned in the JSON response:

hoststring

Host submitted for the DMARC check.

dmarc_hoststring

The full DMARC host name (_dmarc.domain).

cname_targetstring

The CNAME target for the DMARC record.

has_dmarc_recordboolean

Returns true if DMARC record is found.

dmarc_recordstring

DMARC record, e.g. v=DMARC1; p=reject; rua=mailto:d@rua.agari.com; ruf=mailto:d@ruf.agari.com.

dmarc_records_countinteger

Returns the number of DMARC records found (there should be only one).

domain_policystring

Returns the DMARC domain policy (from the p= tag), which can be reject, quarantine, or none.

subdomain_policystring

Returns the DMARC subdomain policy (from the sp= tag), which can be reject, quarantine, or none.

dmarc_enforcedboolean

Returns true if the DMARC domain policy is set to reject or quarantine.

rua_emailsarray

Returns an array containing details for each email address specified in the rua= tag.

rua_emails[n] → emailstring

Email address found in the rua tag (aggregate reports recipient).

rua_emails[n] → domainstring

Domain of the rua email address.

rua_emails[n] → has_mx_recordsboolean

Returns true if the email domain has MX records configured to receive reports.

ruf_emailsarray

Returns an array containing details for each email address specified in the ruf= tag.

ruf_emails[n] → emailstring

Email address found in the ruf tag (forensic reports recipient).

ruf_emails[n] → domainstring

Domain of the ruf email address.

ruf_emails[n] → has_mx_recordsboolean

Returns true if the email domain has MX records configured to receive reports.

versionstring

Returns the DMARC version specified in the v= tag, defaulting to DMARC1 when absent.

issues_foundarray

Array of issues found, the "code" field can be DMARC_NOT_FOUND, DUPLICATE_DMARC_RECORDS, V_TAG_NOT_FOUND, V_TAG_NOT_FIRST, MISSING_P_TAG, NO_DMARC_TAGS_FOUND, INVALID_DMARC_TAG_FOUND, UNKNOWN_DMARC_TAG_FOUND, INVALID_P_TAG_CHARS, P_TAG_IS_NONE, INVALID_ADKIM_TAG_CHARS, INVALID_ASPF_TAG_CHARS, INVALID_SP_TAG_CHARS, INVALID_FO_TAG_CHARS, INVALID_RUA_TAG_CHARS, RUA_TAG_INVALID_EMAIL, RUA_TAG_EMAIL_NO_MX, INVALID_RUF_TAG_CHARS, RUF_TAG_INVALID_EMAIL, RUF_TAG_EMAIL_NO_MX, INVALID_RF_TAG_CHARS, INVALID_PCT_TAG_CHARS, INVALID_RI_TAG_CHARS.

issues_found[n] → codestring

Machine-readable issue code, e.g. V_TAG_NOT_FOUND.

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 DMARC record is valid.

elapsed_msinteger

Time taken to process the request, in milliseconds.