Skip to content
Start here

Get email SPF validation time series

client.Radar.Email.Security.TimeseriesGroups.SPF(ctx, query) (*EmailSecurityTimeseriesGroupSPFResponse, error)
GET/radar/email/security/timeseries_groups/spf

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

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 EmailSecurityTimeseriesGroupSPFParams
AggInterval param.Field[EmailSecurityTimeseriesGroupSPFParamsAggInterval]Optional

Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to Aggregation intervals.

const EmailSecurityTimeseriesGroupSPFParamsAggInterval15m EmailSecurityTimeseriesGroupSPFParamsAggInterval = "15m"
const EmailSecurityTimeseriesGroupSPFParamsAggInterval1h EmailSecurityTimeseriesGroupSPFParamsAggInterval = "1h"
const EmailSecurityTimeseriesGroupSPFParamsAggInterval1d EmailSecurityTimeseriesGroupSPFParamsAggInterval = "1d"
const EmailSecurityTimeseriesGroupSPFParamsAggInterval1w EmailSecurityTimeseriesGroupSPFParamsAggInterval = "1w"
ARC param.Field[[]EmailSecurityTimeseriesGroupSPFParamsARC]Optional

Filters results by ARC (Authenticated Received Chain) validation.

const EmailSecurityTimeseriesGroupSPFParamsARCPass EmailSecurityTimeseriesGroupSPFParamsARC = "PASS"
const EmailSecurityTimeseriesGroupSPFParamsARCNone EmailSecurityTimeseriesGroupSPFParamsARC = "NONE"
const EmailSecurityTimeseriesGroupSPFParamsARCFail EmailSecurityTimeseriesGroupSPFParamsARC = "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[[]EmailSecurityTimeseriesGroupSPFParamsDKIM]Optional

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

const EmailSecurityTimeseriesGroupSPFParamsDKIMPass EmailSecurityTimeseriesGroupSPFParamsDKIM = "PASS"
const EmailSecurityTimeseriesGroupSPFParamsDKIMNone EmailSecurityTimeseriesGroupSPFParamsDKIM = "NONE"
const EmailSecurityTimeseriesGroupSPFParamsDKIMFail EmailSecurityTimeseriesGroupSPFParamsDKIM = "FAIL"
DMARC param.Field[[]EmailSecurityTimeseriesGroupSPFParamsDMARC]Optional

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

const EmailSecurityTimeseriesGroupSPFParamsDMARCPass EmailSecurityTimeseriesGroupSPFParamsDMARC = "PASS"
const EmailSecurityTimeseriesGroupSPFParamsDMARCNone EmailSecurityTimeseriesGroupSPFParamsDMARC = "NONE"
const EmailSecurityTimeseriesGroupSPFParamsDMARCFail EmailSecurityTimeseriesGroupSPFParamsDMARC = "FAIL"

Format in which results will be returned.

const EmailSecurityTimeseriesGroupSPFParamsFormatJson EmailSecurityTimeseriesGroupSPFParamsFormat = "JSON"
const EmailSecurityTimeseriesGroupSPFParamsFormatCsv EmailSecurityTimeseriesGroupSPFParamsFormat = "CSV"
Name param.Field[[]string]Optional

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

TLSVersion param.Field[[]EmailSecurityTimeseriesGroupSPFParamsTLSVersion]Optional

Filters results by TLS version.

const EmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_0 EmailSecurityTimeseriesGroupSPFParamsTLSVersion = "TLSv1_0"
const EmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_1 EmailSecurityTimeseriesGroupSPFParamsTLSVersion = "TLSv1_1"
const EmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_2 EmailSecurityTimeseriesGroupSPFParamsTLSVersion = "TLSv1_2"
const EmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_3 EmailSecurityTimeseriesGroupSPFParamsTLSVersion = "TLSv1_3"
ReturnsExpand Collapse
type EmailSecurityTimeseriesGroupSPFResponse struct{…}
Meta EmailSecurityTimeseriesGroupSPFResponseMeta

Metadata for the results.

AggInterval EmailSecurityTimeseriesGroupSPFResponseMetaAggInterval

Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to Aggregation intervals.

One of the following:
const EmailSecurityTimeseriesGroupSPFResponseMetaAggIntervalFifteenMinutes EmailSecurityTimeseriesGroupSPFResponseMetaAggInterval = "FIFTEEN_MINUTES"
const EmailSecurityTimeseriesGroupSPFResponseMetaAggIntervalOneHour EmailSecurityTimeseriesGroupSPFResponseMetaAggInterval = "ONE_HOUR"
const EmailSecurityTimeseriesGroupSPFResponseMetaAggIntervalOneDay EmailSecurityTimeseriesGroupSPFResponseMetaAggInterval = "ONE_DAY"
const EmailSecurityTimeseriesGroupSPFResponseMetaAggIntervalOneWeek EmailSecurityTimeseriesGroupSPFResponseMetaAggInterval = "ONE_WEEK"
const EmailSecurityTimeseriesGroupSPFResponseMetaAggIntervalOneMonth EmailSecurityTimeseriesGroupSPFResponseMetaAggInterval = "ONE_MONTH"
ConfidenceInfo EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfo
Annotations []EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotation
DataSource EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceAll EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceAIBots EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceBGP EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceBots EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceCT EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceDNS EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceDos EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceFw EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceFwPg EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceHTTP EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceIQI EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceNet EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceSpeed EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsEventTypeEvent EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsEventTypeGeneral EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsEventTypeOutage EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsEventTypePipeline EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly EmailSecurityTimeseriesGroupSPFResponseMetaConfidenceInfoAnnotationsEventType = "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 []EmailSecurityTimeseriesGroupSPFResponseMetaDateRange
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 EmailSecurityTimeseriesGroupSPFResponseMetaNormalization

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

One of the following:
const EmailSecurityTimeseriesGroupSPFResponseMetaNormalizationPercentage EmailSecurityTimeseriesGroupSPFResponseMetaNormalization = "PERCENTAGE"
const EmailSecurityTimeseriesGroupSPFResponseMetaNormalizationMin0Max EmailSecurityTimeseriesGroupSPFResponseMetaNormalization = "MIN0_MAX"
const EmailSecurityTimeseriesGroupSPFResponseMetaNormalizationMinMax EmailSecurityTimeseriesGroupSPFResponseMetaNormalization = "MIN_MAX"
const EmailSecurityTimeseriesGroupSPFResponseMetaNormalizationRawValues EmailSecurityTimeseriesGroupSPFResponseMetaNormalization = "RAW_VALUES"
const EmailSecurityTimeseriesGroupSPFResponseMetaNormalizationPercentageChange EmailSecurityTimeseriesGroupSPFResponseMetaNormalization = "PERCENTAGE_CHANGE"
const EmailSecurityTimeseriesGroupSPFResponseMetaNormalizationRollingAverage EmailSecurityTimeseriesGroupSPFResponseMetaNormalization = "ROLLING_AVERAGE"
const EmailSecurityTimeseriesGroupSPFResponseMetaNormalizationOverlappedPercentage EmailSecurityTimeseriesGroupSPFResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const EmailSecurityTimeseriesGroupSPFResponseMetaNormalizationRatio EmailSecurityTimeseriesGroupSPFResponseMetaNormalization = "RATIO"
Units []EmailSecurityTimeseriesGroupSPFResponseMetaUnit

Measurement units for the results.

Name string
Value string
Fail []string
None []string
Pass []string

Get email SPF validation time series

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.Security.TimeseriesGroups.SPF(context.TODO(), radar.EmailSecurityTimeseriesGroupSPFParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "result": {
    "meta": {
      "aggInterval": "FIFTEEN_MINUTES",
      "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"
        }
      ]
    },
    "serie_0": {
      "FAIL": [
        "10"
      ],
      "NONE": [
        "10"
      ],
      "PASS": [
        "10"
      ]
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "meta": {
      "aggInterval": "FIFTEEN_MINUTES",
      "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"
        }
      ]
    },
    "serie_0": {
      "FAIL": [
        "10"
      ],
      "NONE": [
        "10"
      ],
      "PASS": [
        "10"
      ]
    }
  },
  "success": true
}