Retrieve a Metric Alert Rule for an Organization

GET /api/0/organizations/{organization_slug}/alert-rules/{alert_rule_id}/

Return details on an individual metric alert rule.

A metric alert rule is a configuration that defines the conditions for triggering an alert. It specifies the metric type, function, time interval, and threshold values that determine when an alert should be triggered. Metric alert rules are used to monitor and notify you when certain metrics, like error count, latency, or failure rate, cross a predefined threshold. These rules help you proactively identify and address issues in your project.

Path Parameters

organization_slug (string)
REQUIRED

The slug of the organization the resource belongs to.

alert_rule_id (integer)
REQUIRED

The ID of the rule you'd like to query.

Scopes

<auth_token> requires one of the following scopes:
  • alert_rule:read
  • alerts:read
  • org:admin
  • org:read
  • org:write
curl https://sentry.io/api/0/organizations/{organization_slug}/alert-rules/{alert_rule_id}/ \
 -H 'Authorization: Bearer <auth_token>'
RESPONSESCHEMA
{
  "id": "177412243058",
  "name": "My Metric Alert Rule",
  "organizationId": "4505676595200000",
  "queryType": 0,
  "dataset": "events",
  "query": "",
  "aggregate": "count_unique(user)",
  "thresholdType": 0,
  "resolveThreshold": null,
  "timeWindow": 60,
  "environment": null,
  "triggers": [
    {
      "id": "294385908",
      "alertRuleId": "177412243058",
      "label": "critical",
      "thresholdType": 0,
      "alertThreshold": 31,
      "resolveThreshold": null,
      "dateCreated": "2023-09-26T22:14:17.557579Z",
      "actions": []
    }
  ],
  "projects": [
    "my-coolest-project"
  ],
  "owner": "team:29508397892374892",
  "dateModified": "2023-09-26T22:14:17.522166Z",
  "dateCreated": "2023-09-26T22:14:17.522196Z",
  "createdBy": {
    "id": 2834985497897,
    "name": "Somebody That I Used to Know",
    "email": "anon@sentry.io"
  },
  "eventTypes": [
    "default",
    "error"
  ],
  "monitorType": 0,
  "activations": []
}