---
title: SPF
---

[Skip to content](#%5Ftop) 

[API Reference](https://developers.cloudflare.com/api/typescript)

[Email Auth](https://developers.cloudflare.com/api/typescript/resources/email%5Fauth)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# SPF

#### SPFInspect

##### [Inspect SPF Record](https://developers.cloudflare.com/api/typescript/resources/email%5Fauth/subresources/spf/subresources/inspect/methods/get)

client.emailAuth.spf.inspect.get(InspectGetParams { zone\_id, id } params, RequestOptionsoptions?): [InspectGetResponse](https://developers.cloudflare.com/api/typescript/resources/email%5Fauth#%28resource%29%20email%5Fauth.spf.inspect%20%3E%20%28model%29%20inspect%5Fget%5Fresponse%20%3E%20%28schema%29) { components, domain, record, 2 more } 

GET/zones/{zone\_id}/email/auth/spf/inspect

##### ModelsExpand Collapse 

InspectGetResponse { components, domain, record, 2 more } 

Recursive SPF inspection tree

components: Array<unknown\>

Parsed SPF components (mechanisms)

domain: string

Domain being inspected

record: string

Raw SPF record content

total\_lookups: number

Total number of DNS lookups performed across all includes

errors?: Array<Error\>

All errors encountered during inspection, collected from the entire tree. This includes errors from nested includes at any depth, providing a quick overview of all issues without needing to traverse the nested structure. Each error includes a `domain` field to identify where it occurred. Empty array if no errors (omitted from JSON when empty).

code: string

Error code. Known values:

* `lookup_failed` — DNS TXT lookup failed
* `spf_not_found` — no SPF record found
* `invalid_spf` — record does not start with `v=spf1`
* `invalid_domain` — PSL validation failed
* `loop_detected` — include/redirect cycle detected
* `invalid_mechanism` — unrecognised or malformed mechanism
* `resource_limit_exceeded` — internal resource protection limits exceeded (recursion depth or query budget)
* `max_lookups` — RFC 7208 10-lookup limit exceeded

domain: string

Domain where the error occurred

message: string

Human-readable error message

details?: string

Additional error-specific details (optional).

* For `invalid_domain` errors: the invalid domain string
* For `invalid_mechanism` errors: the invalid mechanism text (e.g., “invalidmech123”)
* For `loop_detected` errors: the domain that caused the loop
* For other error types: not present