Create an dashboard alert

Creates a new alert for a specific dashboard chart.

POST https://telemetry.betterstack.com/api/v2/dashboards/{dashboard_id}/charts/{chart_id}/alerts

URL parameters

dashboard_id
required integer
chart_id
required integer

Headers

Authorization
required string

Body parameters

name
required string
alert_type
required string
operator
string
value
number
string_value
string
check_period
required integer
confirmation_period
required integer
paused
boolean
escalation_target
object
metadata
object
201

Response body

{
  "data": {
    "id": "790",
    "type": "alert",
    "attributes": {
      "name": "High Error Rate",
      "alert_type": "threshold",
      "operator": "higher_than",
      "value": 100.0,
      "paused": false
    }
  }
}
422

Response body

{
  "errors": "Sorry, some values are incorrect",
  "invalid_values": {
    "chart_type": "Alerts are not supported for chart type 'pie_chart'."
  }
}

Alerts can only be created on charts with compatible types: line_chart, bar_chart, number_chart, tail_chart, or table_chart.

Escalation Targets

The escalation_target object determines where notifications are sent: - To use the current team, provide the string "current_team". - To target another team, use { "team_id": 123 } or { "team_name": "Ops Team" }. - To use an escalation policy, use { "policy_id": 456 } or { "policy_name": "Critical Policy" }.

Example Request

cURL
curl --request POST \
  --url https://telemetry.betterstack.com/api/v2/dashboards/123/charts/456/alerts \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "High Error Rate",
    "alert_type": "threshold",
    "operator": "higher_than",
    "value": 100,
    "check_period": 300,
    "confirmation_period": 0,
    "escalation_target": { "policy_name": "Critical Policy" },
    "metadata": { "runbook": "http://runbook/high-errors" }
  }'