Skip to main content

Alerts

View as Markdown

Manage Databricks SQL assets, including warehouses, dashboards, queries and query history, and alerts

List Alerts GA

GET /api/2.0/sql/alerts

Gets a list of alerts accessible to the user, ordered by creation time. Warning: Calling this API concurrently 10 or more times could result in throttling, service degradation, or a temporary ban.

API scopes: sql

Parameters

page_tokenstringquery
page_sizeint32query

Default: 20

Constraints: <= 100

Response

resultsarray of object
Show child attributesHide child attributes
idstring

UUID identifying the alert.

Example: fe25e731-92f2-4838-9fb2-1ca364320a3d

display_namestring

The display name of the alert.

Example: Example alert

query_idstring

UUID of the query attached to the alert.

Example: dee5cca8-1c79-4b5e-a711-e7f9d241bdf6

statestring

Current state of the alert's trigger status. This field is set to UNKNOWN if the alert has not yet been evaluated or ran into an error during the last evaluation.

Values: UNKNOWN, OK, TRIGGERED

Example: UNKNOWN

seconds_to_retriggerint32

Number of seconds an alert must wait after being triggered to rearm itself. After rearming, it can be triggered again. If 0 or not specified, the alert will not be triggered again.

Example: 0

lifecycle_statestring

The workspace state of the alert. Used for tracking trashed status.

Values: ACTIVE, TRASHED

Example: ACTIVE

trigger_timestring

Timestamp when the alert was last triggered, if the alert has been triggered before.

custom_bodystring

Custom body of alert notification, if it exists. See here for custom templating instructions.

Example: custom body

custom_subjectstring

Custom subject of alert notification, if it exists. This can include email subject entries and Slack notification headers, for example. See here for custom templating instructions.

Example: custom subject

conditionobject

Trigger conditions of the alert.

Show child attributesHide child attributes
opstring

Operator used for comparison in alert evaluation.

Values: GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, EQUAL, NOT_EQUAL, IS_NULL

operandobject

Name of the column from the query result to use for comparison in alert evaluation.

Show child attributesHide child attributes
valueobjectRequired
columnobjectRequired
thresholdobject

Threshold value used for comparison in alert evaluation.

Show child attributesHide child attributes
valueobjectRequired
columnobjectRequired
empty_result_statestring

Alert state if result is empty.

Values: UNKNOWN, OK, TRIGGERED

owner_user_namestring

The owner's username. This field is set to "Unavailable" if the user has been deleted.

Example: user@acme.com

parent_pathstring

The workspace path of the folder containing the alert.

Example: /Users/user@acme.com

create_timestring

The timestamp indicating when the alert was created.

update_timestring

The timestamp indicating when the alert was updated.

notify_on_okboolean

Whether to notify alert subscribers when alert returns back to normal.

next_page_tokenstring