Update an Issue Alert Rule

PUT /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/{rule_id}/

Updates an issue alert rule.

Warning: Calling this endpoint fully overwrites the specified issue alert.

An issue alert rule triggers whenever a new event is received for any issue in a project that matches the specified alert conditions. These conditions can include a resolved issue re-appearing or an issue affecting many users. Alert conditions have three parts:

  • Triggers - specify what type of activity you'd like monitored or when an alert should be triggered.
  • Filters - help control noise by triggering an alert only if the issue matches the specified criteria.
  • Actions - specify what should happen when the trigger conditions are met and the filters match.

Path Parameters

organization_id_or_slug (string)
REQUIRED

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

project_id_or_slug (string)
REQUIRED

The id or slug of the project the resource belongs to.

rule_id (integer)
REQUIRED

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

Body Parameters

name (string)
REQUIRED

The name for the rule.

actionMatch (string)
REQUIRED

A string determining which of the conditions need to be true before any filters are evaluated.

  • all - All conditions must evaluate to true.
  • any - At least one of the conditions must evaluate to true.
  • none - All conditions must evaluate to false.
conditions (array(object))
REQUIRED

A list of triggers that determine when the rule fires. See Create an Issue Alert Rule for valid conditions.

actions (array(object))
REQUIRED

A list of actions that take place when all required conditions and filters for the rule are met. See Create an Issue Alert Rule for valid actions.

frequency (integer)
REQUIRED

How often to perform the actions once for an issue, in minutes. The valid range is 5 to 43200.

environment (string)

The name of the environment to filter by.

filterMatch (string)

A string determining which filters need to be true before any actions take place.

  • all - All filters must evaluate to true.
  • any - At least one of the filters must evaluate to true.
  • none - All filters must evaluate to false.
filters (array(object))

A list of filters that determine if a rule fires after the necessary conditions have been met. See Create an Issue Alert Rule for valid filters.

owner (string)

The ID of the team or user that owns the rule.

Scopes

<auth_token> requires one of the following scopes:
  • alerts:write
  • project:admin
  • project:write
curl https://sentry.io/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/rules/{rule_id}/ \
 -H 'Authorization: Bearer <auth_token>' \
 -X PUT \
 -H 'Content-Type: application/json' \
 -d '{}'
RESPONSESCHEMA
{
  "id": "7",
  "conditions": [
    {
      "id": "sentry.rules.conditions.regression_event.RegressionEventCondition"
    }
  ],
  "filters": [
    {
      "id": "sentry.rules.filters.age_comparison.AgeComparisonFilter",
      "comparison_type": "older",
      "value": 4,
      "time": "week"
    },
    {
      "id": "sentry.rules.filters.issue_occurrences.IssueOccurrencesFilter",
      "value": 1000
    },
    {
      "id": "sentry.rules.filters.level.LevelFilter",
      "match": "gte",
      "level": "40"
    }
  ],
  "actions": [
    {
      "id": "sentry.integrations.slack.notify_action.SlackNotifyServiceAction",
      "workspace": 976462356,
      "channel": "#fatal",
      "tags": "browser,release"
    }
  ],
  "actionMatch": "all",
  "filterMatch": "all",
  "frequency": 60,
  "name": "Many Old Regressions!",
  "dateCreated": "2023-02-17T18:31:14.246012Z",
  "owner": "user:635623",
  "createdBy": {
    "id": 635623,
    "name": "John Doe",
    "email": "john.doe@email.com"
  },
  "environment": null,
  "projects": [
    "javascript"
  ],
  "status": "active",
  "snooze": false
}