Alerting

alerting

Alerting

Available Alerts

alerting.available_alerts

Methods

Get Alert Types -> Envelope<Record<string, Array<{ description, display_name, filter_options, 1 more... }>>>
get/accounts/{account_id}/alerting/v3/available_alerts

Gets a list of all alert types for which an account is eligible.

Alerting

Destinations

alerting.destinations

alerting.destinations.eligible

Methods

Get Delivery Mechanism Eligibility -> Envelope<Record<string, Array<{ eligible, ready, type }>>>
get/accounts/{account_id}/alerting/v3/destinations/eligible

Get a list of all delivery mechanism types for which an account is eligible.

alerting.destinations.pagerduty

Methods

List Pager Duty Services -> SinglePage<>
get/accounts/{account_id}/alerting/v3/destinations/pagerduty

Get a list of all configured PagerDuty services.

Create Pager Duty Integration Token -> Envelope<{ id }>
post/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect

Creates a new token for integrating with PagerDuty.

Delete Pager Duty Services -> { errors, messages, success }
delete/accounts/{account_id}/alerting/v3/destinations/pagerduty

Deletes all the PagerDuty Services connected to the account.

Connect Pager Duty -> Envelope<{ id }>
get/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect/{token_id}

Links PagerDuty with the account using the integration token.

Domain types

Pagerduty = { id, name }

alerting.destinations.webhooks

Methods

List Webhooks -> SinglePage<>
get/accounts/{account_id}/alerting/v3/destinations/webhooks

Gets a list of all configured webhook destinations.

Get A Webhook -> Envelope<>
get/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}

Get details for a single webhooks destination.

Create A Webhook -> Envelope<{ id }>
post/accounts/{account_id}/alerting/v3/destinations/webhooks

Creates a new webhook destination.

Update A Webhook -> Envelope<{ id }>
put/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}

Update a webhook destination.

Delete A Webhook -> { errors, messages, success }
delete/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}

Delete a configured webhook destination.

Domain types

Webhooks = { id, created_at, last_failure, 5 more... }
Alerting

History

alerting.history

Methods

List History -> V4PagePaginationArray<>
get/accounts/{account_id}/alerting/v3/history

Gets a list of history records for notifications sent to an account. The records are displayed for last x number of days based on the zone plan (free = 30, pro = 30, biz = 30, ent = 90).

Security

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

Example: Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY

Accepted Permissions (at least one required)

Zero Trust: PII Read Notifications Write Notifications Read Account Settings Write Account Settings Read

path Parameters
account_id: string
(maxLength: 32)

The account id

query Parameters
before: string
Optional
(format: date-time)

Limit the returned results to history records older than the specified date. This must be a timestamp that conforms to RFC3339.

page: number
Optional
(minimum: 1, default: 1)

Page number of paginated results.

per_page: number
Optional
(maximum: 1000, minimum: 5, default: 25)

Number of items per page.

since: string
Optional
(format: date-time)

Limit the returned results to history records newer than the specified date. This must be a timestamp that conforms to RFC3339.

Response fields
errors: Array<{ message, code }>
messages: Array<{ message, code }>
success: true

Whether the API call was successful

result: Array<>
Optional
result_info: { count, page, per_page, 1 more... }
Optional
Request example
200Example

Domain types

History = { id, alert_body, alert_type, 6 more... }
Alerting

Policies

alerting.policies

Methods

List Notification Policies -> SinglePage<>
get/accounts/{account_id}/alerting/v3/policies

Get a list of all Notification policies.

Get A Notification Policy -> Envelope<>
get/accounts/{account_id}/alerting/v3/policies/{policy_id}

Get details for a single policy.

Create A Notification Policy -> Envelope<{ id }>
post/accounts/{account_id}/alerting/v3/policies

Creates a new Notification policy.

Update A Notification Policy -> Envelope<{ id }>
put/accounts/{account_id}/alerting/v3/policies/{policy_id}

Update a Notification policy.

Delete A Notification Policy -> { errors, messages, success, 1 more... }
delete/accounts/{account_id}/alerting/v3/policies/{policy_id}

Delete a Notification policy.

Domain types

Mechanism = { email, pagerduty, webhooks }

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

Policy = { id, alert_interval, alert_type, 7 more... }
PolicyFilter = { actions, affected_asns, affected_components, 40 more... }

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.

Alerting

Silences

alerting.silences

Methods

List Silences -> SinglePage<{ id, created_at, end_time, 3 more... }>
get/accounts/{account_id}/alerting/v3/silences

Gets a list of silences for an account.

Get Silence -> Envelope<{ id, created_at, end_time, 3 more... }>
get/accounts/{account_id}/alerting/v3/silences/{silence_id}

Gets a specific silence for an account.

Create Silences -> { errors, messages, success }
post/accounts/{account_id}/alerting/v3/silences

Creates a new silence for an account.

Update Silences -> SinglePage<{ id, created_at, end_time, 3 more... }>
put/accounts/{account_id}/alerting/v3/silences

Updates existing silences for an account.

Delete Silence -> { errors, messages, success }
delete/accounts/{account_id}/alerting/v3/silences/{silence_id}

Deletes an existing silence for an account.