Create Org Alert Policy Rule

Create a rule on an alert policy. Rules are evaluated in ascending rank order and the first matching rule decides the alert action. Provide at most one of position, rank, before_rule_id, or after_rule_id; the rule is placed first when no position is provided. Requires a token with org-wide repository access; repo-restricted tokens receive 403.

This endpoint consumes 1 unit of your quota.

This endpoint requires the following org token scopes:

  • alert-policy:create
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

The slug of the organization

string
required

The ID of the alert policy: a UUID, or default for the default policy

Body Params
string
required

The rule name (1-128 characters).

vigil_selector
object
required

Selector describing which alerts the rule applies to. Fields must all be under finding., location., or artifact.* (e.g. {"finding.alertType": "criticalCVE", "artifact.name": "lodash"}).

string
required

The action applied to matching alerts. One of: error, warn, monitor, ignore.

string | null

Operator-provided note (up to 256 characters).

string

Where to place the rule within the policy: first or last. Mutually exclusive with rank, before_rule_id, and after_rule_id; when no position is provided a created rule is placed first.

string

Explicit rank, as a fractional-indexing base62 order key (e.g. a0, a0V). Prefer position, before_rule_id, or after_rule_id; a rank that is not a valid order key is rejected.

string | null

Place the rule immediately before this rule UUID.

string | null

Place the rule immediately after this rule UUID.

Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json