# DKIM Validator API

> DKIM Validator checks the DomainKeys Identified Mail (DKIM) DNS records for a domain to verify that they are present and correctly formatted.

**Endpoint:** `GET https://api.apiverve.com/v1/dkimvalidator`  
**Category:** Domain Data  
**Cost:** 10 credits per call  
**Canonical page:** https://apiverve.com/marketplace/dkimvalidator

## Overview

This tool inspects the DKIM record by performing DNS lookups for common selectors. It validates the syntax, surfaces the public-key length in bits, flags testing mode, and derives a composite email-signing posture score so you can tell at a glance whether a domain's DKIM key actually protects its mail. Run it as a DKIM test or DKIM lookup, and pair it with the SPF and DMARC validators to cover all three email authentication records.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/dkimvalidator?domain=github.com&selector=s1" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | Yes | The domain to validate the DKIM record for. domain |
| `selector` | string | No | The DKIM selector to look up (the label before ._domainkey). When omitted, a list of common selectors is tried |

## Response fields

- `selector` — string · DKIM selector used for DNS record lookup
- `host` — string · Domain name being validated
- `dkim_host` — string · Full DKIM DNS record hostname with selector
- `cname_target` — object · CNAME target if present in DNS record
- `has_dkim_record` — boolean · Whether DKIM record exists in domain DNS
- `dkim_record` — string · Complete DKIM record value and public key
- `dkim_records_count` — number · Number of DKIM records found for domain
- `key_type` — string · Public key algorithm type used
  - `issues_found.0.code` — string · Error code identifying the specific issue · (premium)
  - `issues_found.0.type` — string · Severity level of the issue · (premium)
  - `issues_found.0.message` — string · Human-readable description of the issue · (premium)
- `valid` — boolean · Overall DKIM record validity status
- `key_bits` — number · Length of the DKIM public key in bits. 2048 or higher is the current recommendation; below 1024 is dangerously weak. 0 indicates a revoked key (empty p= value), and null means no decodable key is present
- `is_test_mode` — boolean · Whether the record sets t=y (testing mode). In testing mode receivers are told to treat mail as if DKIM were not deployed, so signatures carry no enforcement weight
- `risk_score` — number · Composite 0-100 email-signing weakness score derived from the key length, testing mode and hash algorithm — higher means the deployed DKIM key offers less real protection (a revoked or sub-1024-bit key scores high; a 2048-bit enforced key scores low) · (premium)
- `risk_level` — string · Risk band derived from the score: low, medium or high · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "selector": "s1",
    "host": "github.com",
    "dkim_host": "s1._domainkey.github.com",
    "cname_target": null,
    "has_dkim_record": true,
    "dkim_record": "k=rsa; t=s; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyn3fMCVpb7ryIRKOGXhXVGYmsWUitNlSckqGHOwNFZgFadplOrD+Qzf1XQkP7MH/VB/97DsAAJGtEXW1Uq71Hjnfr/DuBN/YfjF/gU70qEFb7q1sdIiNtjFL2TkOpoW+X/bhhPNheW/fYwyFb6ZHFM6LTgXyuimWRHTOUP3VjZzhNVda79nt+2WZYbS4l8HdMgWpTNHjpVw5PtXESA9KBg/evSRk5fIaXIX5eRXW3baoV9yVzD8O29/IL/DiSk+yNvaO0EHL5c4yGuZJhGzvpiznb2IDVdemJK4Dqzdy5FTN/SGYZhAEr7MguG3Z314hMS2scgMsOMgB64uj/6+6UwIDAQAB",
    "dkim_records_count": 1,
    "key_type": "rsa",
    "issues_found": [
      {
        "code": "V_TAG_NOT_FOUND",
        "type": "warning",
        "message": "The v tag is missing"
      },
      {
        "code": "STRICT_MODE",
        "type": "info",
        "message": "Strict flag set (t=s): the i= identity domain must exactly match d= (no subdomains)"
      }
    ],
    "valid": true,
    "key_bits": 2048,
    "is_test_mode": false,
    "risk_score": 0,
    "risk_level": "low"
  }
}
```

## Use cases

- **Email Service Onboarding** — When a new customer connects a sending domain, verify their public key length and check whether testing mode is active before sending campaigns.
- **Mail Security Auditing** — To prevent spoofing across corporate domains, security analysts inspect DNS selectors to confirm valid DKIM records and flag keys shorter than 2048 bits.
- **Sender Deliverability Diagnostics** — Deliverability consultants check whether outbound domains publish valid DKIM public keys or point to unresolved CNAME targets when diagnosing inbox placement drops.
- **Tenant Domain Verification** — Flag missing or misconfigured DKIM records during custom domain setup so software platforms can alert workspace admins before outgoing notifications fail authentication.

## SDKs

- **npm** — `npm install @apiverve/dkimvalidator` (https://www.npmjs.com/package/@apiverve/dkimvalidator)
- **NuGet** — `dotnet add package APIVerve.API.DKIMValidator` (https://www.nuget.org/packages/APIVerve.API.DKIMValidator)
- **Source** — https://github.com/apiverve/dkimvalidator-api

## More

- Full reference: https://docs.apiverve.com/ref/dkimvalidator
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
