Skip to content
Start here

Get latest annotations

client.Radar.Annotations.List(ctx, query) (*AnnotationListResponse, error)
GET/radar/annotations

Retrieves the latest annotations.

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 AnnotationListParams
ASN param.Field[int64]optional

Filters results by Autonomous System. Specify a single Autonomous System Number (ASN) as integer.

DataSource param.Field[AnnotationListParamsDataSource]optional

Filters results by data source.

const AnnotationListParamsDataSourceAll AnnotationListParamsDataSource = "ALL"
const AnnotationListParamsDataSourceAIBots AnnotationListParamsDataSource = "AI_BOTS"
const AnnotationListParamsDataSourceAIGateway AnnotationListParamsDataSource = "AI_GATEWAY"
const AnnotationListParamsDataSourceBGP AnnotationListParamsDataSource = "BGP"
const AnnotationListParamsDataSourceBots AnnotationListParamsDataSource = "BOTS"
const AnnotationListParamsDataSourceConnectionAnomaly AnnotationListParamsDataSource = "CONNECTION_ANOMALY"
const AnnotationListParamsDataSourceCT AnnotationListParamsDataSource = "CT"
const AnnotationListParamsDataSourceDNS AnnotationListParamsDataSource = "DNS"
const AnnotationListParamsDataSourceDNSMagnitude AnnotationListParamsDataSource = "DNS_MAGNITUDE"
const AnnotationListParamsDataSourceDNSAS112 AnnotationListParamsDataSource = "DNS_AS112"
const AnnotationListParamsDataSourceDos AnnotationListParamsDataSource = "DOS"
const AnnotationListParamsDataSourceEmailRouting AnnotationListParamsDataSource = "EMAIL_ROUTING"
const AnnotationListParamsDataSourceEmailSecurity AnnotationListParamsDataSource = "EMAIL_SECURITY"
const AnnotationListParamsDataSourceFw AnnotationListParamsDataSource = "FW"
const AnnotationListParamsDataSourceFwPg AnnotationListParamsDataSource = "FW_PG"
const AnnotationListParamsDataSourceHTTP AnnotationListParamsDataSource = "HTTP"
const AnnotationListParamsDataSourceHTTPControl AnnotationListParamsDataSource = "HTTP_CONTROL"
const AnnotationListParamsDataSourceHTTPCrawlerReferer AnnotationListParamsDataSource = "HTTP_CRAWLER_REFERER"
const AnnotationListParamsDataSourceHTTPOrigins AnnotationListParamsDataSource = "HTTP_ORIGINS"
const AnnotationListParamsDataSourceIQI AnnotationListParamsDataSource = "IQI"
const AnnotationListParamsDataSourceLeakedCredentials AnnotationListParamsDataSource = "LEAKED_CREDENTIALS"
const AnnotationListParamsDataSourceNet AnnotationListParamsDataSource = "NET"
const AnnotationListParamsDataSourceRobotsTXT AnnotationListParamsDataSource = "ROBOTS_TXT"
const AnnotationListParamsDataSourceSpeed AnnotationListParamsDataSource = "SPEED"
const AnnotationListParamsDataSourceWorkersAI AnnotationListParamsDataSource = "WORKERS_AI"
DateEnd param.Field[Time]optional

End of the date range (inclusive).

formatdate-time
DateRange param.Field[string]optional

Filters results by date range.

DateStart param.Field[Time]optional

Start of the date range (inclusive).

formatdate-time
EventType param.Field[AnnotationListParamsEventType]optional

Filters results by event type.

const AnnotationListParamsEventTypeEvent AnnotationListParamsEventType = "EVENT"
const AnnotationListParamsEventTypeGeneral AnnotationListParamsEventType = "GENERAL"
const AnnotationListParamsEventTypeOutage AnnotationListParamsEventType = "OUTAGE"
const AnnotationListParamsEventTypePartialProjection AnnotationListParamsEventType = "PARTIAL_PROJECTION"
const AnnotationListParamsEventTypePipeline AnnotationListParamsEventType = "PIPELINE"
const AnnotationListParamsEventTypeTrafficAnomaly AnnotationListParamsEventType = "TRAFFIC_ANOMALY"
Format param.Field[AnnotationListParamsFormat]optional

Format in which results will be returned.

const AnnotationListParamsFormatJson AnnotationListParamsFormat = "JSON"
const AnnotationListParamsFormatCsv AnnotationListParamsFormat = "CSV"
Limit param.Field[int64]optional

Limits the number of objects returned in the response.

exclusiveMinimum
minimum0
Location param.Field[string]optional

Filters results by location. Specify an alpha-2 location code.

maxLength2
minLength2
Offset param.Field[int64]optional

Skips the specified number of objects before fetching the results.

minimum0
Origin param.Field[string]optional

Filters results by origin.

maxLength100
ReturnsExpand Collapse
type AnnotationListResponse struct{…}
Annotations []AnnotationListResponseAnnotation
ID string
ASNs []int64
ASNsDetails []AnnotationListResponseAnnotationsASNsDetail
ASN string
Name string
Locations AnnotationListResponseAnnotationsASNsDetailsLocationsoptional
Code string
Name string
DataSource string
EventType string
Locations []string
LocationsDetails []AnnotationListResponseAnnotationsLocationsDetail
Code string
Name string
Origins []string
OriginsDetails []AnnotationListResponseAnnotationsOriginsDetail
Name string
Origin string
Outage AnnotationListResponseAnnotationsOutage
OutageCause string
OutageType string
StartDate string
Description stringoptional
EndDate stringoptional
LinkedURL stringoptional
Scope stringoptional

Get latest annotations

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  annotations, err := client.Radar.Annotations.List(context.TODO(), radar.AnnotationListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", annotations.Annotations)
}
{
  "result": {
    "annotations": [
      {
        "id": "550",
        "asns": [
          189
        ],
        "asnsDetails": [
          {
            "asn": "189",
            "name": "LUMEN-LEGACY-L3-PARTITION",
            "locations": {
              "code": "US",
              "name": "United States"
            }
          }
        ],
        "dataSource": "ALL",
        "eventType": "OUTAGE",
        "locations": [
          "US"
        ],
        "locationsDetails": [
          {
            "code": "US",
            "name": "United States"
          }
        ],
        "origins": [
          "amazon-us-east-1"
        ],
        "originsDetails": [
          {
            "name": "us-east-1 Amazon Web Services",
            "origin": "amazon-us-east-1"
          }
        ],
        "outage": {
          "outageCause": "CABLE_CUT",
          "outageType": "NATIONWIDE"
        },
        "startDate": "2022-09-06T10:00:28Z",
        "description": "example",
        "endDate": "2022-09-08T10:00:28Z",
        "linkedUrl": "http://example.com",
        "scope": "Colima, Michoacán, México"
      }
    ]
  },
  "success": true
}
Returns Examples
{
  "result": {
    "annotations": [
      {
        "id": "550",
        "asns": [
          189
        ],
        "asnsDetails": [
          {
            "asn": "189",
            "name": "LUMEN-LEGACY-L3-PARTITION",
            "locations": {
              "code": "US",
              "name": "United States"
            }
          }
        ],
        "dataSource": "ALL",
        "eventType": "OUTAGE",
        "locations": [
          "US"
        ],
        "locationsDetails": [
          {
            "code": "US",
            "name": "United States"
          }
        ],
        "origins": [
          "amazon-us-east-1"
        ],
        "originsDetails": [
          {
            "name": "us-east-1 Amazon Web Services",
            "origin": "amazon-us-east-1"
          }
        ],
        "outage": {
          "outageCause": "CABLE_CUT",
          "outageType": "NATIONWIDE"
        },
        "startDate": "2022-09-06T10:00:28Z",
        "description": "example",
        "endDate": "2022-09-08T10:00:28Z",
        "linkedUrl": "http://example.com",
        "scope": "Colima, Michoacán, México"
      }
    ]
  },
  "success": true
}