Skip to content
Start here

Get email SPF validation summary

client.Radar.Email.Routing.Summary.SPF(ctx, query) (*EmailRoutingSummarySPFResponse, error)
GET/radar/email/routing/summary/spf

Retrieves the distribution of emails by SPF (Sender Policy Framework) validation.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
User Details WriteUser Details Read
ParametersExpand Collapse
query EmailRoutingSummarySPFParams
ARC param.Field[[]EmailRoutingSummarySPFParamsARC]Optional

Filters results by ARC (Authenticated Received Chain) validation.

const EmailRoutingSummarySPFParamsARCPass EmailRoutingSummarySPFParamsARC = "PASS"
const EmailRoutingSummarySPFParamsARCNone EmailRoutingSummarySPFParamsARC = "NONE"
const EmailRoutingSummarySPFParamsARCFail EmailRoutingSummarySPFParamsARC = "FAIL"
DateEnd param.Field[[]Time]Optional

End of the date range (inclusive).

DateRange param.Field[[]string]Optional

Filters results by date range. For example, use 7d and 7dcontrol to compare this week with the previous week. Use this parameter or set specific start and end dates (dateStart and dateEnd parameters).

DateStart param.Field[[]Time]Optional

Start of the date range.

DKIM param.Field[[]EmailRoutingSummarySPFParamsDKIM]Optional

Filters results by DKIM (DomainKeys Identified Mail) validation status.

const EmailRoutingSummarySPFParamsDKIMPass EmailRoutingSummarySPFParamsDKIM = "PASS"
const EmailRoutingSummarySPFParamsDKIMNone EmailRoutingSummarySPFParamsDKIM = "NONE"
const EmailRoutingSummarySPFParamsDKIMFail EmailRoutingSummarySPFParamsDKIM = "FAIL"
DMARC param.Field[[]EmailRoutingSummarySPFParamsDMARC]Optional

Filters results by DMARC (Domain-based Message Authentication, Reporting and Conformance) validation status.

const EmailRoutingSummarySPFParamsDMARCPass EmailRoutingSummarySPFParamsDMARC = "PASS"
const EmailRoutingSummarySPFParamsDMARCNone EmailRoutingSummarySPFParamsDMARC = "NONE"
const EmailRoutingSummarySPFParamsDMARCFail EmailRoutingSummarySPFParamsDMARC = "FAIL"
Encrypted param.Field[[]EmailRoutingSummarySPFParamsEncrypted]Optional

Filters results by encryption status (encrypted vs. not-encrypted).

const EmailRoutingSummarySPFParamsEncryptedEncrypted EmailRoutingSummarySPFParamsEncrypted = "ENCRYPTED"
const EmailRoutingSummarySPFParamsEncryptedNotEncrypted EmailRoutingSummarySPFParamsEncrypted = "NOT_ENCRYPTED"
Format param.Field[EmailRoutingSummarySPFParamsFormat]Optional

Format in which results will be returned.

const EmailRoutingSummarySPFParamsFormatJson EmailRoutingSummarySPFParamsFormat = "JSON"
const EmailRoutingSummarySPFParamsFormatCsv EmailRoutingSummarySPFParamsFormat = "CSV"
IPVersion param.Field[[]EmailRoutingSummarySPFParamsIPVersion]Optional

Filters results by IP version (Ipv4 vs. IPv6).

const EmailRoutingSummarySPFParamsIPVersionIPv4 EmailRoutingSummarySPFParamsIPVersion = "IPv4"
const EmailRoutingSummarySPFParamsIPVersionIPv6 EmailRoutingSummarySPFParamsIPVersion = "IPv6"
Name param.Field[[]string]Optional

Array of names used to label the series in the response.

ReturnsExpand Collapse
type EmailRoutingSummarySPFResponse struct{…}
Meta EmailRoutingSummarySPFResponseMeta

Metadata for the results.

ConfidenceInfo EmailRoutingSummarySPFResponseMetaConfidenceInfo
Annotations []EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotation
DataSource EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceAll EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceAIBots EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceBGP EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceBots EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceCT EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceDNS EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceDos EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceFw EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceFwPg EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceHTTP EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceIQI EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceNet EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceSpeed EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsEventTypeEvent EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsEventTypeGeneral EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsEventTypeOutage EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsEventTypePipeline EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationsEventType = "TRAFFIC_ANOMALY"
IsInstantaneous bool

Whether event is a single point in time or a time range.

LinkedURL string
formaturi
StartDate Time
formatdate-time
Tags []stringOptional
Level int64

Provides an indication of how much confidence Cloudflare has in the data.

DateRange []EmailRoutingSummarySPFResponseMetaDateRange
EndTime Time

Adjusted end of date range.

formatdate-time
StartTime Time

Adjusted start of date range.

formatdate-time
LastUpdated Time

Timestamp of the last dataset update.

formatdate-time
Normalization EmailRoutingSummarySPFResponseMetaNormalization

Normalization method applied to the results. Refer to Normalization methods.

One of the following:
const EmailRoutingSummarySPFResponseMetaNormalizationPercentage EmailRoutingSummarySPFResponseMetaNormalization = "PERCENTAGE"
const EmailRoutingSummarySPFResponseMetaNormalizationMin0Max EmailRoutingSummarySPFResponseMetaNormalization = "MIN0_MAX"
const EmailRoutingSummarySPFResponseMetaNormalizationMinMax EmailRoutingSummarySPFResponseMetaNormalization = "MIN_MAX"
const EmailRoutingSummarySPFResponseMetaNormalizationRawValues EmailRoutingSummarySPFResponseMetaNormalization = "RAW_VALUES"
const EmailRoutingSummarySPFResponseMetaNormalizationPercentageChange EmailRoutingSummarySPFResponseMetaNormalization = "PERCENTAGE_CHANGE"
const EmailRoutingSummarySPFResponseMetaNormalizationRollingAverage EmailRoutingSummarySPFResponseMetaNormalization = "ROLLING_AVERAGE"
const EmailRoutingSummarySPFResponseMetaNormalizationOverlappedPercentage EmailRoutingSummarySPFResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const EmailRoutingSummarySPFResponseMetaNormalizationRatio EmailRoutingSummarySPFResponseMetaNormalization = "RATIO"
Units []EmailRoutingSummarySPFResponseMetaUnit

Measurement units for the results.

Name string
Value string
Fail string

A numeric string.

None string

A numeric string.

Pass string

A numeric string.

Get email SPF validation summary

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/radar"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.Radar.Email.Routing.Summary.SPF(context.TODO(), radar.EmailRoutingSummarySPFParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "result": {
    "meta": {
      "confidenceInfo": {
        "annotations": [
          {
            "dataSource": "ALL",
            "description": "Cable cut in Tonga",
            "endDate": "2019-12-27T18:11:19.117Z",
            "eventType": "EVENT",
            "isInstantaneous": true,
            "linkedUrl": "https://example.com",
            "startDate": "2019-12-27T18:11:19.117Z",
            "tags": [
              "BOT_CLASS"
            ]
          }
        ],
        "level": 0
      },
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ],
      "lastUpdated": "2019-12-27T18:11:19.117Z",
      "normalization": "PERCENTAGE",
      "units": [
        {
          "name": "*",
          "value": "requests"
        }
      ]
    },
    "summary_0": {
      "FAIL": "10",
      "NONE": "10",
      "PASS": "10"
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "meta": {
      "confidenceInfo": {
        "annotations": [
          {
            "dataSource": "ALL",
            "description": "Cable cut in Tonga",
            "endDate": "2019-12-27T18:11:19.117Z",
            "eventType": "EVENT",
            "isInstantaneous": true,
            "linkedUrl": "https://example.com",
            "startDate": "2019-12-27T18:11:19.117Z",
            "tags": [
              "BOT_CLASS"
            ]
          }
        ],
        "level": 0
      },
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ],
      "lastUpdated": "2019-12-27T18:11:19.117Z",
      "normalization": "PERCENTAGE",
      "units": [
        {
          "name": "*",
          "value": "requests"
        }
      ]
    },
    "summary_0": {
      "FAIL": "10",
      "NONE": "10",
      "PASS": "10"
    }
  },
  "success": true
}