## Create a Notification policy `client.alerting.policies.create(PolicyCreateParamsparams, RequestOptionsoptions?): PolicyCreateResponse` **post** `/accounts/{account_id}/alerting/v3/policies` Creates a new Notification policy. ### Parameters - `params: PolicyCreateParams` - `account_id: string` Path param: The account id - `alert_type: "abuse_report_alert" | "access_custom_certificate_expiration_type" | "advanced_ddos_attack_l4_alert" | 66 more` Body param: 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. - `"abuse_report_alert"` - `"access_custom_certificate_expiration_type"` - `"advanced_ddos_attack_l4_alert"` - `"advanced_ddos_attack_l7_alert"` - `"advanced_http_alert_error"` - `"bgp_hijack_notification"` - `"billing_usage_alert"` - `"block_notification_block_removed"` - `"block_notification_new_block"` - `"block_notification_review_rejected"` - `"bot_traffic_basic_alert"` - `"brand_protection_alert"` - `"brand_protection_digest"` - `"clickhouse_alert_fw_anomaly"` - `"clickhouse_alert_fw_ent_anomaly"` - `"cloudforce_one_request_notification"` - `"cni_maintenance_notification"` - `"custom_analytics"` - `"custom_bot_detection_alert"` - `"custom_ssl_certificate_event_type"` - `"dedicated_ssl_certificate_event_type"` - `"device_connectivity_anomaly_alert"` - `"dos_attack_l4"` - `"dos_attack_l7"` - `"expiring_service_token_alert"` - `"failing_logpush_job_disabled_alert"` - `"fbm_auto_advertisement"` - `"fbm_dosd_attack"` - `"fbm_volumetric_attack"` - `"health_check_status_notification"` - `"hostname_aop_custom_certificate_expiration_type"` - `"http_alert_edge_error"` - `"http_alert_origin_error"` - `"image_notification"` - `"image_resizing_notification"` - `"incident_alert"` - `"load_balancing_health_alert"` - `"load_balancing_pool_enablement_alert"` - `"logo_match_alert"` - `"magic_tunnel_health_check_event"` - `"magic_wan_tunnel_health"` - `"maintenance_event_notification"` - `"mtls_certificate_store_certificate_expiration_type"` - `"pages_event_alert"` - `"radar_notification"` - `"real_origin_monitoring"` - `"scriptmonitor_alert_new_code_change_detections"` - `"scriptmonitor_alert_new_hosts"` - `"scriptmonitor_alert_new_malicious_hosts"` - `"scriptmonitor_alert_new_malicious_scripts"` - `"scriptmonitor_alert_new_malicious_url"` - `"scriptmonitor_alert_new_max_length_resource_url"` - `"scriptmonitor_alert_new_resources"` - `"secondary_dns_all_primaries_failing"` - `"secondary_dns_primaries_failing"` - `"secondary_dns_warning"` - `"secondary_dns_zone_successfully_updated"` - `"secondary_dns_zone_validation_warning"` - `"security_insights_alert"` - `"sentinel_alert"` - `"stream_live_notifications"` - `"synthetic_test_latency_alert"` - `"synthetic_test_low_availability_alert"` - `"traffic_anomalies_alert"` - `"tunnel_health_event"` - `"tunnel_update_event"` - `"universal_ssl_event_type"` - `"web_analytics_metrics_update"` - `"zone_aop_custom_certificate_expiration_type"` - `enabled: boolean` Body param: Whether or not the Notification policy is enabled. - `mechanisms: Mechanism` Body param: List of IDs that will be used when dispatching a notification. IDs for email type will be the email address. - `email?: Array` - `id?: string` The email address - `pagerduty?: Array` - `id?: string` UUID - `webhooks?: Array` - `id?: string` UUID - `name: string` Body param: Name of the policy. - `alert_interval?: string` Body param: Optional specification of how often to re-alert from the same incident, not support on all alert types. - `description?: string` Body param: Optional description for the Notification policy. - `filters?: PolicyFilter` Body param: 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?: Array` Usage depends on specific alert type - `affected_asns?: Array` Used for configuring radar_notification - `affected_components?: Array` Used for configuring incident_alert - `affected_locations?: Array` Used for configuring radar_notification - `airport_code?: Array` Used for configuring maintenance_event_notification - `alert_trigger_preferences?: Array` Usage depends on specific alert type - `alert_trigger_preferences_value?: Array` Usage depends on specific alert type - `enabled?: Array` Used for configuring load_balancing_pool_enablement_alert - `environment?: Array` Used for configuring pages_event_alert - `event?: Array` Used for configuring pages_event_alert - `event_source?: Array` Used for configuring load_balancing_health_alert - `event_type?: Array` Usage depends on specific alert type - `group_by?: Array` Usage depends on specific alert type - `health_check_id?: Array` Used for configuring health_check_status_notification - `incident_impact?: Array<"INCIDENT_IMPACT_NONE" | "INCIDENT_IMPACT_MINOR" | "INCIDENT_IMPACT_MAJOR" | "INCIDENT_IMPACT_CRITICAL">` Used for configuring incident_alert - `"INCIDENT_IMPACT_NONE"` - `"INCIDENT_IMPACT_MINOR"` - `"INCIDENT_IMPACT_MAJOR"` - `"INCIDENT_IMPACT_CRITICAL"` - `input_id?: Array` Used for configuring stream_live_notifications - `insight_class?: Array` Used for configuring security_insights_alert - `limit?: Array` Used for configuring billing_usage_alert - `logo_tag?: Array` Used for configuring logo_match_alert - `megabits_per_second?: Array` Used for configuring advanced_ddos_attack_l4_alert - `new_health?: Array` Used for configuring load_balancing_health_alert - `new_status?: Array` Used for configuring tunnel_health_event - `packets_per_second?: Array` Used for configuring advanced_ddos_attack_l4_alert - `pool_id?: Array` Usage depends on specific alert type - `pop_names?: Array` Usage depends on specific alert type - `product?: Array` Used for configuring billing_usage_alert - `project_id?: Array` Used for configuring pages_event_alert - `protocol?: Array` Used for configuring advanced_ddos_attack_l4_alert - `query_tag?: Array` Usage depends on specific alert type - `requests_per_second?: Array` Used for configuring advanced_ddos_attack_l7_alert - `selectors?: Array` Usage depends on specific alert type - `services?: Array` Used for configuring clickhouse_alert_fw_ent_anomaly - `slo?: Array` Usage depends on specific alert type - `status?: Array` Used for configuring health_check_status_notification - `target_hostname?: Array` Used for configuring advanced_ddos_attack_l7_alert - `target_ip?: Array` Used for configuring advanced_ddos_attack_l4_alert - `target_zone_name?: Array` Used for configuring advanced_ddos_attack_l7_alert - `traffic_exclusions?: Array<"security_events">` Used for configuring traffic_anomalies_alert - `"security_events"` - `tunnel_id?: Array` Used for configuring tunnel_health_event - `tunnel_name?: Array` Usage depends on specific alert type - `type?: Array` Usage depends on specific alert type - `where?: Array` Usage depends on specific alert type - `zones?: Array` Usage depends on specific alert type ### Returns - `PolicyCreateResponse` - `id?: string` UUID ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const policy = await client.alerting.policies.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', alert_type: 'universal_ssl_event_type', enabled: true, mechanisms: {}, name: 'SSL Notification Event Policy', }); console.log(policy.id); ``` #### Response ```json { "errors": [ { "message": "message", "code": 1000 } ], "messages": [ { "message": "message", "code": 1000 } ], "success": true, "result": { "id": "f174e90afafe4643bbbc4a0ed4fc8415" } } ```