Preview an alert

Replay an alert over past data to see the incidents it would have opened. Pass alert_id to replay an existing alert, and send any setting you want to try instead of its own. To try an alert that doesn't exist yet, pass dashboard_id with chart_id, or exploration_id, with its settings. Nothing is saved. Use a replay to pick a threshold or a significance before creating an alert, or to check whether an alert is too noisy.

POST https://telemetry.betterstack.com/api/v3/alerts/preview

Query parameters

team_id
string

Headers

Authorization
required string
Content-Type
string

Body parameters

alert_id
string
dashboard_id
string
chart_id
string
exploration_id
string
start_time
string
end_time
string
alert_type
string
operator
string
value
number
string_value
string
anomaly_sensitivity
number
anomaly_trigger
string
confirmation_period
integer
recovery_period
integer
query_period
integer
check_period
integer
aggregation_interval
integer
on_missing_data
string
series_names
array of strings
series_names_except
array of strings
additional_conditions
array of objects
additional_conditions[].alert_type
string
additional_conditions[].operator
string
additional_conditions[].value
number
additional_conditions[].string_value
string
additional_conditions[].series_names
array of strings
additional_conditions[].series_names_except
array of strings
200

Response body

{
  "data": {
    "chart": {
      "id": "456",
      "name": "Errors",
      "chart_type": "line_chart"
    },
    "configuration": {
      "alert_type": "threshold",
      "operator": "higher_than",
      "value": 5000,
      "confirmation_period": 60,
      "recovery_period": 300
    },
    "window": {
      "from": "2026-11-15T10:00:00Z",
      "to": "2026-11-22T10:00:00Z",
      "requested_from": "2026-11-15T10:00:00Z",
      "requested_to": "2026-11-22T10:00:00Z",
      "seconds": 604800,
      "interval_seconds": 60
    },
    "totals": {
      "incidents": 3,
      "incidents_per_day": 0.43,
      "alerting_seconds": 1260,
      "alerting_share": 0.2,
      "alerting_points": 21
    },
    "incidents": [
      {
        "started_at": "2026-11-20T08:12:00Z",
        "ended_at": "2026-11-20T08:31:00Z",
        "duration_seconds": 1140,
        "series_names": [
          "api"
        ],
        "open": false
      }
    ],
    "series": [
      {
        "name": "api",
        "alerting_points": 21
      }
    ],
    "unchecked_series": [],
    "omitted_series": [],
    "warnings": [
      {
        "code": "range_clamped",
        "message": "A replay covers at most 7 days, so the window was cut back to start at 2026-11-15 10:00 UTC."
      }
    ]
  }
}
401

Response body

{
  "errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/logs/api/getting-started/#obtaining-a-logtail-api-token"
}
403

Response body

{
  "errors": "This API token is read-only and cannot be used for write operations."
}
404
422

Response body

{
  "errors": "Tail charts and table charts can't be previewed."
}

Response attributes

chart
object
configuration
object
window
object
totals
object
incidents
array of objects
incidents[].started_at
datetime
incidents[].ended_at
datetime or null
incidents[].duration_seconds
integer
incidents[].series_names
array of strings
incidents[].open
boolean
series
array of objects
series[].name
string
series[].alerting_points
integer
unchecked_series
array of strings
omitted_series
array of strings
warnings
array of objects
warnings[].code
string
warnings[].message
string

Example cURL

Replay an alert Try a threshold on a chart
curl --request POST \
  --url https://telemetry.betterstack.com/api/v3/alerts/preview \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "alert_id": "1234",
  "start_time": "now-7d"
}'
curl --request POST \
  --url https://telemetry.betterstack.com/api/v3/alerts/preview \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "dashboard_id": "1234",
  "chart_id": "18718",
  "alert_type": "threshold",
  "operator": "higher_than",
  "value": 5000,
  "start_time": "now-7d"
}'