Skip to content
Start here

Alerting

AlertingAvailable Alerts

Get Alert Types
client.Alerting.AvailableAlerts.List(ctx, query) (*AvailableAlertListResponse, error)
GET/accounts/{account_id}/alerting/v3/available_alerts

AlertingDestinations

AlertingDestinationsEligible

Get delivery mechanism eligibility
client.Alerting.Destinations.Eligible.Get(ctx, query) (*DestinationEligibleGetResponse, error)
GET/accounts/{account_id}/alerting/v3/destinations/eligible

AlertingDestinationsPagerduty

List PagerDuty services
client.Alerting.Destinations.Pagerduty.Get(ctx, query) (*SinglePage[Pagerduty], error)
GET/accounts/{account_id}/alerting/v3/destinations/pagerduty
Create PagerDuty integration token
client.Alerting.Destinations.Pagerduty.New(ctx, body) (*DestinationPagerdutyNewResponse, error)
POST/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect
Delete PagerDuty Services
client.Alerting.Destinations.Pagerduty.Delete(ctx, body) (*DestinationPagerdutyDeleteResponse, error)
DELETE/accounts/{account_id}/alerting/v3/destinations/pagerduty
Connect PagerDuty
client.Alerting.Destinations.Pagerduty.Link(ctx, tokenID, query) (*DestinationPagerdutyLinkResponse, error)
GET/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect/{token_id}
ModelsExpand Collapse
type Pagerduty struct{…}
ID stringoptional

UUID

maxLength32
Name stringoptional

The name of the pagerduty service.

AlertingDestinationsWebhooks

List webhooks
client.Alerting.Destinations.Webhooks.List(ctx, query) (*SinglePage[Webhooks], error)
GET/accounts/{account_id}/alerting/v3/destinations/webhooks
Get a webhook
client.Alerting.Destinations.Webhooks.Get(ctx, webhookID, query) (*Webhooks, error)
GET/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}
Create a webhook
client.Alerting.Destinations.Webhooks.New(ctx, params) (*DestinationWebhookNewResponse, error)
POST/accounts/{account_id}/alerting/v3/destinations/webhooks
Update a webhook
client.Alerting.Destinations.Webhooks.Update(ctx, webhookID, params) (*DestinationWebhookUpdateResponse, error)
PUT/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}
Delete a webhook
client.Alerting.Destinations.Webhooks.Delete(ctx, webhookID, body) (*DestinationWebhookDeleteResponse, error)
DELETE/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}
ModelsExpand Collapse
type Webhooks struct{…}
ID stringoptional

The unique identifier of a webhook

maxLength32
CreatedAt Timeoptional

Timestamp of when the webhook destination was created.

formatdate-time
LastFailure Timeoptional

Timestamp of the last time an attempt to dispatch a notification to this webhook failed.

formatdate-time
LastSuccess Timeoptional

Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.

formatdate-time
Name stringoptional

The name of the webhook destination. This will be included in the request body when you receive a webhook notification.

Secret stringoptional

Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.

Type WebhooksTypeoptional

Type of webhook endpoint.

One of the following:
const WebhooksTypeDatadog WebhooksType = "datadog"
const WebhooksTypeDiscord WebhooksType = "discord"
const WebhooksTypeFeishu WebhooksType = "feishu"
const WebhooksTypeGchat WebhooksType = "gchat"
const WebhooksTypeGeneric WebhooksType = "generic"
const WebhooksTypeOpsgenie WebhooksType = "opsgenie"
const WebhooksTypeSlack WebhooksType = "slack"
const WebhooksTypeSplunk WebhooksType = "splunk"
URL stringoptional

The POST endpoint to call when dispatching a notification.

AlertingHistory

List History
client.Alerting.History.List(ctx, params) (*V4PagePaginationArray[History], error)
GET/accounts/{account_id}/alerting/v3/history
ModelsExpand Collapse
type History struct{…}
ID stringoptional

UUID

maxLength32
AlertBody stringoptional

Message body included in the notification sent.

AlertType stringoptional

Type of notification that has been dispatched.

Description stringoptional

Description of the notification policy (if present).

Mechanism stringoptional

The mechanism to which the notification has been dispatched.

MechanismType HistoryMechanismTypeoptional

The type of mechanism to which the notification has been dispatched. This can be email/pagerduty/webhook based on the mechanism configured.

One of the following:
const HistoryMechanismTypeEmail HistoryMechanismType = "email"
const HistoryMechanismTypePagerduty HistoryMechanismType = "pagerduty"
const HistoryMechanismTypeWebhook HistoryMechanismType = "webhook"
Name stringoptional

Name of the policy.

PolicyID stringoptional

The unique identifier of a notification policy

maxLength32
Sent Timeoptional

Timestamp of when the notification was dispatched in ISO 8601 format.

formatdate-time

AlertingPolicies

List Notification policies
client.Alerting.Policies.List(ctx, query) (*SinglePage[Policy], error)
GET/accounts/{account_id}/alerting/v3/policies
Get a Notification policy
client.Alerting.Policies.Get(ctx, policyID, query) (*Policy, error)
GET/accounts/{account_id}/alerting/v3/policies/{policy_id}
Create a Notification policy
client.Alerting.Policies.New(ctx, params) (*PolicyNewResponse, error)
POST/accounts/{account_id}/alerting/v3/policies
Update a Notification policy
client.Alerting.Policies.Update(ctx, policyID, params) (*PolicyUpdateResponse, error)
PUT/accounts/{account_id}/alerting/v3/policies/{policy_id}
Delete a Notification policy
client.Alerting.Policies.Delete(ctx, policyID, body) (*PolicyDeleteResponse, error)
DELETE/accounts/{account_id}/alerting/v3/policies/{policy_id}
ModelsExpand Collapse
type Mechanism struct{…}

List of IDs that will be used when dispatching a notification. IDs for email type will be the email address.

Email []MechanismEmailoptional
ID stringoptional

The email address

Pagerduty []MechanismPagerdutyoptional
ID stringoptional

UUID

maxLength32
Webhooks []MechanismWebhookoptional
ID stringoptional

UUID

maxLength32
type Policy struct{…}
ID stringoptional

The unique identifier of a notification policy

maxLength32
AlertInterval stringoptional

Optional specification of how often to re-alert from the same incident, not support on all alert types.

AlertType PolicyAlertTypeoptional

Refers to which event will trigger a Notification dispatch. You can use the endpoint to get available alert types which then will give you a list of possible values.

One of the following:
const PolicyAlertTypeAbuseReportAlert PolicyAlertType = "abuse_report_alert"
const PolicyAlertTypeAccessCustomCertificateExpirationType PolicyAlertType = "access_custom_certificate_expiration_type"
const PolicyAlertTypeAdvancedDDoSAttackL4Alert PolicyAlertType = "advanced_ddos_attack_l4_alert"
const PolicyAlertTypeAdvancedDDoSAttackL7Alert PolicyAlertType = "advanced_ddos_attack_l7_alert"
const PolicyAlertTypeAdvancedHTTPAlertError PolicyAlertType = "advanced_http_alert_error"
const PolicyAlertTypeBGPHijackNotification PolicyAlertType = "bgp_hijack_notification"
const PolicyAlertTypeBillingUsageAlert PolicyAlertType = "billing_usage_alert"
const PolicyAlertTypeBlockNotificationBlockRemoved PolicyAlertType = "block_notification_block_removed"
const PolicyAlertTypeBlockNotificationNewBlock PolicyAlertType = "block_notification_new_block"
const PolicyAlertTypeBlockNotificationReviewRejected PolicyAlertType = "block_notification_review_rejected"
const PolicyAlertTypeBotTrafficBasicAlert PolicyAlertType = "bot_traffic_basic_alert"
const PolicyAlertTypeBrandProtectionAlert PolicyAlertType = "brand_protection_alert"
const PolicyAlertTypeBrandProtectionDigest PolicyAlertType = "brand_protection_digest"
const PolicyAlertTypeClickhouseAlertFwAnomaly PolicyAlertType = "clickhouse_alert_fw_anomaly"
const PolicyAlertTypeClickhouseAlertFwEntAnomaly PolicyAlertType = "clickhouse_alert_fw_ent_anomaly"
const PolicyAlertTypeCloudforceOneRequestNotification PolicyAlertType = "cloudforce_one_request_notification"
const PolicyAlertTypeCNIMaintenanceNotification PolicyAlertType = "cni_maintenance_notification"
const PolicyAlertTypeCustomAnalytics PolicyAlertType = "custom_analytics"
const PolicyAlertTypeCustomBotDetectionAlert PolicyAlertType = "custom_bot_detection_alert"
const PolicyAlertTypeCustomSSLCertificateEventType PolicyAlertType = "custom_ssl_certificate_event_type"
const PolicyAlertTypeDedicatedSSLCertificateEventType PolicyAlertType = "dedicated_ssl_certificate_event_type"
const PolicyAlertTypeDeviceConnectivityAnomalyAlert PolicyAlertType = "device_connectivity_anomaly_alert"
const PolicyAlertTypeDosAttackL4 PolicyAlertType = "dos_attack_l4"
const PolicyAlertTypeDosAttackL7 PolicyAlertType = "dos_attack_l7"
const PolicyAlertTypeExpiringServiceTokenAlert PolicyAlertType = "expiring_service_token_alert"
const PolicyAlertTypeFailingLogpushJobDisabledAlert PolicyAlertType = "failing_logpush_job_disabled_alert"
const PolicyAlertTypeFbmAutoAdvertisement PolicyAlertType = "fbm_auto_advertisement"
const PolicyAlertTypeFbmDosdAttack PolicyAlertType = "fbm_dosd_attack"
const PolicyAlertTypeFbmVolumetricAttack PolicyAlertType = "fbm_volumetric_attack"
const PolicyAlertTypeHealthCheckStatusNotification PolicyAlertType = "health_check_status_notification"
const PolicyAlertTypeHostnameAopCustomCertificateExpirationType PolicyAlertType = "hostname_aop_custom_certificate_expiration_type"
const PolicyAlertTypeHTTPAlertEdgeError PolicyAlertType = "http_alert_edge_error"
const PolicyAlertTypeHTTPAlertOriginError PolicyAlertType = "http_alert_origin_error"
const PolicyAlertTypeImageNotification PolicyAlertType = "image_notification"
const PolicyAlertTypeImageResizingNotification PolicyAlertType = "image_resizing_notification"
const PolicyAlertTypeIncidentAlert PolicyAlertType = "incident_alert"
const PolicyAlertTypeLoadBalancingHealthAlert PolicyAlertType = "load_balancing_health_alert"
const PolicyAlertTypeLoadBalancingPoolEnablementAlert PolicyAlertType = "load_balancing_pool_enablement_alert"
const PolicyAlertTypeLogoMatchAlert PolicyAlertType = "logo_match_alert"
const PolicyAlertTypeMagicTunnelHealthCheckEvent PolicyAlertType = "magic_tunnel_health_check_event"
const PolicyAlertTypeMagicWANTunnelHealth PolicyAlertType = "magic_wan_tunnel_health"
const PolicyAlertTypeMaintenanceEventNotification PolicyAlertType = "maintenance_event_notification"
const PolicyAlertTypeMTLSCertificateStoreCertificateExpirationType PolicyAlertType = "mtls_certificate_store_certificate_expiration_type"
const PolicyAlertTypePagesEventAlert PolicyAlertType = "pages_event_alert"
const PolicyAlertTypeRadarNotification PolicyAlertType = "radar_notification"
const PolicyAlertTypeRealOriginMonitoring PolicyAlertType = "real_origin_monitoring"
const PolicyAlertTypeScriptmonitorAlertNewCodeChangeDetections PolicyAlertType = "scriptmonitor_alert_new_code_change_detections"
const PolicyAlertTypeScriptmonitorAlertNewHosts PolicyAlertType = "scriptmonitor_alert_new_hosts"
const PolicyAlertTypeScriptmonitorAlertNewMaliciousHosts PolicyAlertType = "scriptmonitor_alert_new_malicious_hosts"
const PolicyAlertTypeScriptmonitorAlertNewMaliciousScripts PolicyAlertType = "scriptmonitor_alert_new_malicious_scripts"
const PolicyAlertTypeScriptmonitorAlertNewMaliciousURL PolicyAlertType = "scriptmonitor_alert_new_malicious_url"
const PolicyAlertTypeScriptmonitorAlertNewMaxLengthResourceURL PolicyAlertType = "scriptmonitor_alert_new_max_length_resource_url"
const PolicyAlertTypeScriptmonitorAlertNewResources PolicyAlertType = "scriptmonitor_alert_new_resources"
const PolicyAlertTypeSecondaryDNSAllPrimariesFailing PolicyAlertType = "secondary_dns_all_primaries_failing"
const PolicyAlertTypeSecondaryDNSPrimariesFailing PolicyAlertType = "secondary_dns_primaries_failing"
const PolicyAlertTypeSecondaryDNSWarning PolicyAlertType = "secondary_dns_warning"
const PolicyAlertTypeSecondaryDNSZoneSuccessfullyUpdated PolicyAlertType = "secondary_dns_zone_successfully_updated"
const PolicyAlertTypeSecondaryDNSZoneValidationWarning PolicyAlertType = "secondary_dns_zone_validation_warning"
const PolicyAlertTypeSecurityInsightsAlert PolicyAlertType = "security_insights_alert"
const PolicyAlertTypeSentinelAlert PolicyAlertType = "sentinel_alert"
const PolicyAlertTypeStreamLiveNotifications PolicyAlertType = "stream_live_notifications"
const PolicyAlertTypeSyntheticTestLatencyAlert PolicyAlertType = "synthetic_test_latency_alert"
const PolicyAlertTypeSyntheticTestLowAvailabilityAlert PolicyAlertType = "synthetic_test_low_availability_alert"
const PolicyAlertTypeTrafficAnomaliesAlert PolicyAlertType = "traffic_anomalies_alert"
const PolicyAlertTypeTunnelHealthEvent PolicyAlertType = "tunnel_health_event"
const PolicyAlertTypeTunnelUpdateEvent PolicyAlertType = "tunnel_update_event"
const PolicyAlertTypeUniversalSSLEventType PolicyAlertType = "universal_ssl_event_type"
const PolicyAlertTypeWebAnalyticsMetricsUpdate PolicyAlertType = "web_analytics_metrics_update"
const PolicyAlertTypeZoneAopCustomCertificateExpirationType PolicyAlertType = "zone_aop_custom_certificate_expiration_type"
Created Timeoptional
formatdate-time
Description stringoptional

Optional description for the Notification policy.

Enabled booloptional

Whether or not the Notification policy is enabled.

Filters PolicyFilteroptional

Optional filters that allow you to be alerted only on a subset of events for that alert type based on some criteria. This is only available for select alert types. See alert type documentation for more details.

Mechanisms Mechanismoptional

List of IDs that will be used when dispatching a notification. IDs for email type will be the email address.

Modified Timeoptional
formatdate-time
Name stringoptional

Name of the policy.

type PolicyFilter struct{…}

Optional filters that allow you to be alerted only on a subset of events for that alert type based on some criteria. This is only available for select alert types. See alert type documentation for more details.

Actions []stringoptional

Usage depends on specific alert type

AffectedASNs []stringoptional

Used for configuring radar_notification

AffectedComponents []stringoptional

Used for configuring incident_alert

AffectedLocations []stringoptional

Used for configuring radar_notification

AirportCode []stringoptional

Used for configuring maintenance_event_notification

AlertTriggerPreferences []stringoptional

Usage depends on specific alert type

AlertTriggerPreferencesValue []stringoptional

Usage depends on specific alert type

Enabled []stringoptional

Used for configuring load_balancing_pool_enablement_alert

Environment []stringoptional

Used for configuring pages_event_alert

Event []stringoptional

Used for configuring pages_event_alert

EventSource []stringoptional

Used for configuring load_balancing_health_alert

EventType []stringoptional

Usage depends on specific alert type

GroupBy []stringoptional

Usage depends on specific alert type

HealthCheckID []stringoptional

Used for configuring health_check_status_notification

IncidentImpact []PolicyFilterIncidentImpactoptional

Used for configuring incident_alert

One of the following:
const PolicyFilterIncidentImpactIncidentImpactNone PolicyFilterIncidentImpact = "INCIDENT_IMPACT_NONE"
const PolicyFilterIncidentImpactIncidentImpactMinor PolicyFilterIncidentImpact = "INCIDENT_IMPACT_MINOR"
const PolicyFilterIncidentImpactIncidentImpactMajor PolicyFilterIncidentImpact = "INCIDENT_IMPACT_MAJOR"
const PolicyFilterIncidentImpactIncidentImpactCritical PolicyFilterIncidentImpact = "INCIDENT_IMPACT_CRITICAL"
InputID []stringoptional

Used for configuring stream_live_notifications

InsightClass []stringoptional

Used for configuring security_insights_alert

Limit []stringoptional

Used for configuring billing_usage_alert

LogoTag []stringoptional

Used for configuring logo_match_alert

MegabitsPerSecond []stringoptional

Used for configuring advanced_ddos_attack_l4_alert

NewHealth []stringoptional

Used for configuring load_balancing_health_alert

NewStatus []stringoptional

Used for configuring tunnel_health_event

PacketsPerSecond []stringoptional

Used for configuring advanced_ddos_attack_l4_alert

PoolID []stringoptional

Usage depends on specific alert type

POPNames []stringoptional

Usage depends on specific alert type

Product []stringoptional

Used for configuring billing_usage_alert

ProjectID []stringoptional

Used for configuring pages_event_alert

Protocol []stringoptional

Used for configuring advanced_ddos_attack_l4_alert

QueryTag []stringoptional

Usage depends on specific alert type

RequestsPerSecond []stringoptional

Used for configuring advanced_ddos_attack_l7_alert

Selectors []stringoptional

Usage depends on specific alert type

Services []stringoptional

Used for configuring clickhouse_alert_fw_ent_anomaly

Slo []stringoptional

Usage depends on specific alert type

Status []stringoptional

Used for configuring health_check_status_notification

TargetHostname []stringoptional

Used for configuring advanced_ddos_attack_l7_alert

TargetIP []stringoptional

Used for configuring advanced_ddos_attack_l4_alert

TargetZoneName []stringoptional

Used for configuring advanced_ddos_attack_l7_alert

TrafficExclusions []PolicyFilterTrafficExclusionoptional

Used for configuring traffic_anomalies_alert

TunnelID []stringoptional

Used for configuring tunnel_health_event

TunnelName []stringoptional

Usage depends on specific alert type

Type []stringoptional

Usage depends on specific alert type

Where []stringoptional

Usage depends on specific alert type

Zones []stringoptional

Usage depends on specific alert type

AlertingSilences

List Silences
client.Alerting.Silences.List(ctx, query) (*SinglePage[SilenceListResponse], error)
GET/accounts/{account_id}/alerting/v3/silences
Get Silence
client.Alerting.Silences.Get(ctx, silenceID, query) (*SilenceGetResponse, error)
GET/accounts/{account_id}/alerting/v3/silences/{silence_id}
Create Silences
client.Alerting.Silences.New(ctx, params) (*SilenceNewResponse, error)
POST/accounts/{account_id}/alerting/v3/silences
Update Silences
client.Alerting.Silences.Update(ctx, params) (*SinglePage[SilenceUpdateResponse], error)
PUT/accounts/{account_id}/alerting/v3/silences
Delete Silence
client.Alerting.Silences.Delete(ctx, silenceID, body) (*SilenceDeleteResponse, error)
DELETE/accounts/{account_id}/alerting/v3/silences/{silence_id}