Skip to main content
POST
/
check-domain
DKIM, SPF & Domain Lockdown Check
curl --request POST \
  --url https://api.mailchannels.net/tx/v1/check-domain \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <x-api-key>' \
  --data '
{
  "domain": "<string>",
  "dkim_settings": [
    {
      "dkim_domain": "<string>",
      "dkim_private_key": "<string>",
      "dkim_selector": "<string>"
    }
  ],
  "sender_id": "<string>"
}
'
{
  "check_results": {
    "dkim": [
      {
        "dkim_domain": "<string>",
        "dkim_key_status": "<string>",
        "dkim_selector": "<string>",
        "reason": "<string>"
      }
    ],
    "domain_lockdown": {
      "reason": "<string>"
    },
    "sender_domain": {
      "a": {
        "reason": "<string>"
      },
      "mx": {
        "reason": "<string>"
      }
    },
    "spf": {
      "reason": "<string>",
      "spfRecord": "<string>",
      "spfRecordError": "<string>"
    }
  },
  "references": [
    "<string>"
  ]
}

Headers

X-Api-Key
string
required

Body

application/json
domain
string
required

Domain used for sending emails. If dkim_settings are not provided, or dkim_settings are provided with no dkim_domain, the stored dkim settings for this domain will be used.

dkim_settings
object[]

Each item may include DKIM domain, selector and private key. Up to 10 items are allowed. The absence or presence of these fields affects how DKIM settings are validated:

  1. If dkim_domain, dkim_selector, and dkim_private_key are all present, verify using the provided domain, selector, and key.
  2. If dkim_domain and dkim_selector are present, use the stored private key for the given domain and selector.
  3. If only dkim_domain is present, use all stored keys for the given domain.
  4. If none are present, use all stored keys for the domain provided in the domain field of the request.
  5. If dkim_private_key is present, dkim_selector must be present.
  6. If dkim_selector is present and dkim_domain is not, the domain will be taken from the domain field of the request.
Maximum array length: 10
sender_id
string

Used exclusively for Domain Lockdown verification. If you're not using senderid to associate your domain with your account, you can disregard this field. The corresponding value is included in the X-MailChannels-SenderId header of emails sent via MailChannels.

Response

Success.

check_results
object
references
string[]

Link to SPF, Domain Lockdown or DKIM references, displayed if any verdict is not passed.