errors.alert-rules.update

Change an alert rule, or turn it on or off

PATCH /errors/api/projects/{id}/alert-rules/{ruleId}IAM errors:PutAlertRuleChanges state

Request syntax

PATCH /errors/api/projects/{id}/alert-rules/{ruleId}
{
  "name": "string",
  "enabled": "boolean",
  "trigger": "object",
  "filters": "object",
  "actions": "array of json",
  "throttleMinutes": "number"
}

Path parameters

  • idRequired

    string

    Constraints: uuid

  • ruleIdRequired

    string

    Constraints: uuid

Request body

  • nameOptional

    string

    New name, 1–120 characters

    Constraints: 1-120 chars

  • enabledOptional

    boolean

    true turns the rule on, false off (kept without firing)

  • triggerOptional

    object

    New trigger, replacing the old one. When the rule fires, by kind: {kind: "issue", events: ["new" | "regression" | "escalating", …]} (at least one); {kind: "frequency", events, windowMinutes} (an issue’s events in the window reach events, 1–10 000 000, window 1–1440 minutes); {kind: "users", users, windowMinutes} (an issue’s distinct users reach users); {kind: "crash_free", belowPercent, minSessions?} (a release’s crash-free sessions over the last hour fall below belowPercent, 1–99.99, with at least minSessions sessions, default 100); {kind: "dropped", events?, windowHours?, outcomes?} (what the project sent that was refused or lost after acceptance reaches events, 1–10 000 000, default 1, within the current hour and the windowHours − 1 before it, 1–24, default 1; outcomes "refused" and/or "lost", default both; the SDK’s own drops and profile milliseconds never count; filters do not apply)

    Constraints: JSON

  • filtersOptional

    object

    New filters, replacing the old ones whole. Which issues the rule applies to; every filter given must match, an empty one matches all (none given on create: all empty): levels (fatal, error, warning, info, debug), environments (up to 20), tags (up to 10 {key, value}, matched against the issue’s latest event), titleContains (up to 200 characters)

    Constraints: JSON

  • actionsOptional

    array of json

    New actions, replacing the old ones whole. What the rule does, 1–10 actions: {kind: "email", admins?, addresses?} (admins, default true, mails the organization’s owners and admins; up to 20 further addresses) or {kind: "webhook", url, format?} (an https URL, else 400; format auto (default, chosen by the URL’s host: Slack, Teams, Discord, else JSON), slack, teams, discord or json)

  • throttleMinutesOptional

    number

    New quiet period, 1–10 080 minutes

    Constraints: integer, 1-10080

Response

200 with the rule as `list` describes it. Fields left out keep their value; trigger, filters and actions are replaced whole. 404 when the project or the rule does not exist.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow errors:PutAlertRule on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud errors alert-rules update id ruleId

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_errors_alert-rules_update.