---
title: "Validate domains' SPF records"
method: GET
path: "/EmailAuth/validate_current_spfs"
tags: ["EmailAuth", "Email DNS Settings"]
---

# Validate domains' SPF records

`GET /EmailAuth/validate_current_spfs`

This function retrieves the the Sender Policy Framework (SPF) records
for one or more domains.

## Query parameters

- `domain` string, domain, required

## Response `200`

HTTP Request was successful.

- object
  - `apiversion` integer — The version of the API.
  - `func` string — The name of the method called.
  - `module` string — The name of the module called.
  - `result` object
    - `data` object[] — A list of information about a domain's SPF records.
      - `domain` string, domain — The queried domain.
      - `error` string — A message that details the reason why the DNS lookup failed. **Note:** The function **only** returns this value when the `state` return is the `ERROR` value.
      - `expected` string — The SPF record for the domain in the DNS.
      - `ip_address` string — The domain's IP address.
      - `ip_version` 4 | 6 — The IP address version. * `4` * `6`
      - `records` object[] — The SPF records of the domain's DNS.
        - `current` string — The SPF record's contents.
        - `reason` string — The reason why the SPF record is **not** correct, if one exists. **Note:** If no errors exist, the function does **not** return this value.
        - `state` 'PASS' | 'NEUTRAL' | 'FAIL' | 'SOFTFAIL' | 'TEMPERROR' | 'PERMERROR' — The SPF record's status: * `PASS` - The `SPF` record confirms that the `ip_address` value is a valid sender. * `NEUTRAL` - The current `SPF` record configuration does not determine the `ip_address` value's validity. * `FAIL` - The `SPF` record states that the `ip_address` value is **not** a valid sender. * `SOFTFAIL` - The `SPF` record states that the `ip_address` value is **not** a valid sender, but does not `FAIL` state it. * `TEMPERROR` - The `SPF` record check resulted in a failure. For example, a network failure. * `PERMERROR` - The domain's `SPF` records are **incorrect** and require manual correction. **Note:** These values correspond with [RFC7208 section 2.6](https://tools.ietf.org/html/rfc7208#section-2.6).
      - `state` 'VALID' | 'MISMATCHED' | 'MULTIPLE' | 'MISSING' | 'ERROR' — The SPF record's status: * `VALID` - A single `SPF TXT` record exists in the domain's DNS with the correct `ip_address` value or redirect mechanism. * `MISMATCHED` - An `SPF TXT` record exists for the domain that does **not** match the `ip_address` value. * `MULTIPLE` - Multiple `SPF TXT` records exist in the domain's DNS. * `MISSING` - No `SPF TXT` record exists for the domain's DNS. * `ERROR` - The record's DNS lookup failed. The function returns the reason in the error return.
    - `errors` string[], nullable — List of errors if the API failed.
    - `messages` string[], nullable — List of messages generated by the API.
    - `metadata` object
    - `status` 0 | 1 — - `1` - Success. - `0` - Failed. Check the `errors` field for more details.
    - `warnings` string[], nullable — List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.

---

[API](https://skmtc.net/cpanel/apis/cpanel-uapi.md) · [All operations](https://skmtc.net/cpanel/apis/cpanel-uapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/cpanel-uapi/revisions/632e2f8e6d04/schema)
