Alerts

Model

Fields

Field

Type

Description

object
"alert"
id
string Unique identifier, prefixed with alr_.
slug
string URL-safe identifier for the alert.
team_id
string
project_id
string
metric_id
string The metric the monitor was watching.
metric_name
string | null
monitor_id
string The monitor that raised the alert.
monitor_name
string | null
created_at
When the condition first held. The start of the firing period.
ended_at
| null When the condition stopped holding. Null while the alert is still firing.
series_hash
string Identifies which series of the metric fired, when the monitor watches series separately.
series_label
string | null
trigger_value
number The metric value at the moment the alert opened.
threshold_value
number The value the metric had to cross for the monitor to fire.
condition_description
string The condition in words, for example above 500 for 10 minutes.

List Alerts

Endpoint

List the alerts a metric's monitors have raised.

GET
/v1/projects/:project_id/metrics/:metric_id/alerts

Path Parameters

Field

Type

Description

project_id
string Unique identifier of the project.
metric_id
string Unique identifier of the metric.

Query Parameters

Field

Type

Description

order_by
string Field the results are sorted by. Alerts sort by when their period opened. Defaults to "created_at". Accepted values: "created_at".
metric_id
string Return only alerts raised on this metric.
monitor_id
string Return only alerts raised by this monitor.
is_open
string Set true for periods still firing, false for periods that have ended. Accepted values: "true","false","1","0".
time_range
Window to search, relative to now. Ignored when start_at and end_at are sent.
timezone
string IANA timezone the time range is anchored to. Defaults to UTC.
page_id
string Resolve the time range from this page's setting instead of the metric's.
start_at
Start of the window to search, as an ISO 8601 value.
end_at
End of the window to search, as an ISO 8601 value.
limit
number Maximum number of items to return. Defaults to 25. Minimum: 1. Maximum: 200.
after
string Cursor from pagination.next_cursor of a previous response. Returns the resources after that page.
before
string Cursor from pagination.prev_cursor of a previous response. Returns the resources before that page.
sort
string Sort direction for the result set. Defaults to "desc". Accepted values: "asc","desc".

Comments

  • An alert is a firing PERIOD, not a single notification. created_at is when the condition started holding and ended_at is when it stopped, so one incident is one row for its whole duration.
  • Results cover a time window. Send start_at and end_at, or a time_range; with neither, the metric's own configured chart range is used.
  • An alert is returned when its period OVERLAPS the window, so a period that opened before the window and is still firing is included.
  • Use is_open=true to see only what is currently firing.
  • before and after are mutually exclusive. Send one or neither.
  • timezone must be a valid IANA timezone name, or UTC.
  • after and before are mutually exclusive.

Response

200
{
  message: string;
  data: Alert[];
  status: 200;
  error: null;
  pagination: Pagination;
  endpoint: string;
}

Retrieve Alert

Endpoint

Retrieve a single alert.

GET
/v1/projects/:project_id/alerts/:alert_id

Path Parameters

Field

Type

Description

project_id
string Unique identifier of the project.
alert_id
string Unique identifier of the alert.

Comments

  • A null ended_at means the condition still holds and the period is still open.

Response

200
{
  message: string;
  data: Alert;
  status: 200;
  error: null;
  pagination: null;
  endpoint: string;
}

Referenced Types

ISODateString

An ISO 8601 date-time string returned at the JSON API boundary.