List an Organization's Metric Alert Rules

GET /api/0/organizations/{organization_id_or_slug}/alert-rules/

Return a list of active metric alert rules bound to an organization.

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_id_or_slug (string)
REQUIRED

The ID or slug of the organization the resource belongs to.

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_id_or_slug}/alert-rules/ \
 -H 'Authorization: Bearer <auth_token>'
RESPONSESCHEMA
[
  {
    "id": "7",
    "name": "Counting Bad Request and Unauthorized Errors in Prod",
    "organizationId": "237655244234",
    "queryType": 0,
    "dataset": "events",
    "query": "tags[http.status_code]:[400, 401]",
    "aggregate": "count()",
    "thresholdType": 0,
    "resolveThreshold": null,
    "timeWindow": 1440,
    "environment": "prod",
    "triggers": [
      {
        "id": "394289",
        "alertRuleId": "17723",
        "label": "critical",
        "thresholdType": 0,
        "alertThreshold": 100,
        "resolveThreshold": null,
        "dateCreated": "2023-09-25T22:15:26.375126Z",
        "actions": [
          {
            "id": "394280",
            "alertRuleTriggerId": "92481",
            "type": "slack",
            "targetType": "specific",
            "targetIdentifier": "30489048931789",
            "inputChannelId": "#my-channel",
            "integrationId": "8753467",
            "sentryAppId": null,
            "dateCreated": "2023-09-25T22:15:26.375126Z"
          }
        ]
      }
    ],
    "projects": [
      "super-cool-project"
    ],
    "owner": "user:53256",
    "originalAlertRuleId": null,
    "comparisonDelta": null,
    "dateModified": "2023-09-25T22:15:26.375126Z",
    "dateCreated": "2023-09-25T22:15:26.375126Z",
    "createdBy": {
      "id": 983948,
      "name": "John Doe",
      "email": "john.doe@sentry.io"
    },
    "monitorType": 0,
    "activations": [],
    "activationCondition": null
  }
]