Version 4.0.24.18
Create a new alert and return details of the newly created object
Required fields: field
, destinations
, comparison_type
, threshold
, cron
Example Request:
Run alert on dashboard element '103' at 5am every day. Send an email to 'test@test.com' if inventory for Los Angeles (using dashboard filter Warehouse Name
) is lower than 1,000
{
"cron": "0 5 * * *",
"custom_title": "Alert when LA inventory is low",
"dashboard_element_id": 103,
"applied_dashboard_filters": [
{
"filter_title": "Warehouse Name",
"field_name": "distribution_centers.name",
"filter_value": "Los Angeles CA",
"filter_description": "is Los Angeles CA"
}
],
"comparison_type": "LESS_THAN",
"destinations": [
{
"destination_type": "EMAIL",
"email_address": "test@test.com"
}
],
"field": {
"title": "Number on Hand",
"name": "inventory_items.number_on_hand"
},
"is_disabled": false,
"is_public": true,
"threshold": 1000
}
Request
POST
/alerts
Datatype
Description
Request
body
Expand HTTP Body definition...
body
Alert
Expand Alert definition...
applied_dashboard_filters
comparison_type
This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://cloud.google.com/looker/docs/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY".
cron
Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals
custom_url_base
Domain for the custom url selected by the alert creator from the admin defined domain allowlist
custom_url_params
Parameters and path for the custom url defined by the alert creator
custom_url_label
Label for the custom url defined by the alert creator
show_custom_url
Boolean to determine if the custom url should be used
custom_title
An optional, user-defined title for the alert
dashboard_element_id
ID of the dashboard element associated with the alert. Refer to [dashboard_element()](#!/Dashboard/DashboardElement)
description
An optional description for the alert. This supplements the title
destinations
field
The field the alert threshold is compared against when determining when to send notifications
followed
lock
Whether or not the user follows this alert.
followable
lock
Whether or not the alert is followable
id
lock
ID of the alert
is_disabled
Whether or not the alert is disabled
disabled_reason
Reason for disabling alert
is_public
Whether or not the alert is public
investigative_content_type
The type of the investigative content Valid values are: "dashboard".
investigative_content_id
The ID of the investigative content. For dashboards, this will be the dashboard ID
investigative_content_title
lock
The title of the investigative content.
lookml_dashboard_id
ID of the LookML dashboard associated with the alert
lookml_link_id
ID of the LookML dashboard element associated with the alert
owner_id
User id of alert owner
owner_display_name
lock
Alert owner's display name
threshold
Value of the alert threshold
time_series_condition_state
(Write-Only) (Optional) Only used when first creating time series alerts. It's used to pick a starting time reference from which alerts will be evaluated again. Without it, alerts be run against all time series data. Refer to [docs](https://cloud.google.com/looker/docs/sharing-and-publishing/creating-alerts) for details. Example `{ latest_time_series_id: '2020-09-17', previous_time_series_id: '2020-09-16' }`.
Response
200: The alert is saved.
Datatype
Description
(object)
applied_dashboard_filters
Expand AlertAppliedDashboardFilter definition...
filter_title
Field Title. Refer to `DashboardFilter.title` in [DashboardFilter](#!/types/DashboardFilter). Example `Name`
field_name
Field Name. Refer to `DashboardFilter.dimension` in [DashboardFilter](#!/types/DashboardFilter). Example `distribution_centers.name`
filter_value
Field Value. [Filter Expressions](https://cloud.google.com/looker/docs/reference/filter-expressions). Example `Los Angeles CA`
filter_description
lock
Human Readable Filter Description. This may be null or auto-generated. Example `is Los Angeles CA`
comparison_type
This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://cloud.google.com/looker/docs/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY".
cron
Vixie-Style crontab specification when to run. At minimum, it has to be longer than 15 minute intervals
custom_url_base
Domain for the custom url selected by the alert creator from the admin defined domain allowlist
custom_url_params
Parameters and path for the custom url defined by the alert creator
custom_url_label
Label for the custom url defined by the alert creator
show_custom_url
Boolean to determine if the custom url should be used
custom_title
An optional, user-defined title for the alert
dashboard_element_id
ID of the dashboard element associated with the alert. Refer to [dashboard_element()](#!/Dashboard/DashboardElement)
description
An optional description for the alert. This supplements the title
destinations
Expand AlertDestination definition...
destination_type
Type of destination that the alert will be sent to Valid values are: "EMAIL", "ACTION_HUB".
email_address
Email address for the 'email' type
action_hub_integration_id
Action hub integration id for the 'action_hub' type. [Integration](#!/types/Integration)
action_hub_form_params_json
Action hub form params json for the 'action_hub' type [IntegrationParam](#!/types/IntegrationParam)
field
The field the alert threshold is compared against when determining when to send notifications
Expand AlertField definition...
title
Field's title. Usually auto-generated to reflect field name and its filters
name
Field's name. Has the format `.` Refer to [docs](https://cloud.google.com/looker/docs/sharing-and-publishing/creating-alerts) for more details
filter
Expand AlertFieldFilter definition...
field_name
Field Name. Has format `.`
field_value
Field Value. Depends on the type of field - numeric or string. For [location](https://cloud.google.com/looker/docs/reference/field-reference/dimension-type-reference#location) type, it's a list of floats. Example `[1.0, 56.0]`
filter_value
Filter Value. Usually null except for [location](https://cloud.google.com/looker/docs/reference/field-reference/dimension-type-reference#location) type. It'll be a string of lat,long ie `'1.0,56.0'`
followed
lock
Whether or not the user follows this alert.
followable
lock
Whether or not the alert is followable
id
lock
ID of the alert
is_disabled
Whether or not the alert is disabled
disabled_reason
Reason for disabling alert
is_public
Whether or not the alert is public
investigative_content_type
The type of the investigative content Valid values are: "dashboard".
investigative_content_id
The ID of the investigative content. For dashboards, this will be the dashboard ID
investigative_content_title
lock
The title of the investigative content.
lookml_dashboard_id
ID of the LookML dashboard associated with the alert
lookml_link_id
ID of the LookML dashboard element associated with the alert
owner_id
User id of alert owner
owner_display_name
lock
Alert owner's display name
threshold
Value of the alert threshold
time_series_condition_state
(Write-Only) (Optional) Only used when first creating time series alerts. It's used to pick a starting time reference from which alerts will be evaluated again. Without it, alerts be run against all time series data. Refer to [docs](https://cloud.google.com/looker/docs/sharing-and-publishing/creating-alerts) for details. Example `{ latest_time_series_id: '2020-09-17', previous_time_series_id: '2020-09-16' }`.
Expand AlertConditionState definition...
previous_time_series_id
(Write-Only) The second latest time string the alert has seen.
latest_time_series_id
(Write-Only) Latest time string the alert has seen.
400: Bad Request
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
404: Not Found
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
405: Resource Can't Be Modified
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
409: Resource Already Exists
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
422: Validation Error
Datatype
Description
(object)
message
lock
Error details
errors
Expand ValidationErrorDetail definition...
field
lock
Field with error
code
lock
Error code
message
lock
Error info message
documentation_url
lock
Documentation link
documentation_url
lock
Documentation link
429: Too Many Requests
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link