---
title: "Updates an existing alert rule."
method: PUT
path: "/alerts/rules/{id}"
tags: ["Alerts"]
---

# Updates an existing alert rule.

`PUT /alerts/rules/{id}`

Replaces the mutable fields of an existing alert rule with the supplied values and
returns the updated resource. The rule must belong to the authenticated account.
            
The `rule_set` field, when provided, must be a valid JSON rule set as documented
on RevelDigital.Core.PublicApi.Models.AlertRuleRequest.RuleSet; invalid rule sets are rejected with 400.
Requires the `AlertRules_Edit` securable.

## Path parameters

- `id` string, required

## Request body

- AlertRuleRequest — Request model used for creating or updating an alert rule (REST). All fields except RevelDigital.Core.PublicApi.Models.AlertRuleRequest.Name are optional; omitted fields are treated as unset. The RevelDigital.Core.PublicApi.Models.AlertRuleRequest.RuleSet property documents the full rule set JSON schema.
  - `name` string, nullable — The name of the alert rule
  - `rule_set` string, nullable — The rule set configuration, supplied as a JSON string (the value is serialized JSON, not a nested JSON object). A rule set is an array of condition groups; groups are combined with logical AND, and the items within each group are combined with logical OR. A rule triggers when every group is satisfied. Shape: an array of objects, each with an "items" array of { "type", "op", "value" } entries. For example: [ { "items": [ { "type": "CpuUsage", "op": "GTE", "value": [90] } ] } ]. Item fields: "type" (required, case-sensitive) is one of the supported condition types below; "op" (optional) is the comparison operator EQ, NE, GT, LT, GTE, or LTE and defaults to EQ; "value" (required) is a non-empty array of numbers whose first element is the comparison value. Supported "type" values: TimeOffline (minutes offline), LastUpdate (minutes since last check-in), MemoryUsage, CpuUsage, DiskUsage (utilization percentage), NoContent (active content count over the period), BytesTxDay, BytesRxDay, BytesTotalDay (bytes transmitted/received/total for the current day), BytesTxPeriod, BytesRxPeriod, BytesTotalPeriod (bytes over the period), ClockSkew (clock drift), DisplayDetected (display presence), BatteryVoltage, BatteryPercentage, and SystemTemperature (hardware sensor readings). The rule set is validated on create and update: a malformed JSON string, an empty group, an empty items array, an unknown "type", an unsupported "op", or a missing/empty "value" is rejected with HTTP 400. Null or empty is allowed, in which case the rule is simply not evaluated.
  - `is_enabled` boolean, nullable — Indicates whether the alert rule is enabled and will be evaluated. When false, the rule is stored but never triggers alerts. Defaults to enabled when omitted.
  - `period` integer, nullable — The look-back / evaluation period, in minutes, used by time-window based conditions such as `NoContent`. Ignored by conditions that read the current value.
  - `threshold` integer, nullable — A legacy scalar threshold value retained for backward compatibility. New rules should express thresholds inside RevelDigital.Core.PublicApi.Models.AlertRuleRequest.RuleSet via each item's `value` instead.
  - `webhook_url` string, nullable — Optional HTTPS webhook URL that is invoked (HTTP POST) when the rule triggers. Leave null to notify only through the associated users.
  - `all_devices` boolean, nullable — When true, the rule is evaluated against every device in the account and RevelDigital.Core.PublicApi.Models.AlertRuleRequest.DeviceIds is ignored. When false, only the devices in RevelDigital.Core.PublicApi.Models.AlertRuleRequest.DeviceIds are evaluated.
  - `all_users` boolean, nullable — When true, all users in the account are notified and RevelDigital.Core.PublicApi.Models.AlertRuleRequest.UserIds is ignored. When false, only the users in RevelDigital.Core.PublicApi.Models.AlertRuleRequest.UserIds are notified.
  - `device_ids` string[], nullable — The devices to associate with the rule. Ignored when all_devices is true.
  - `user_ids` string[], nullable — The users to notify (encrypted ids). Ignored when all_users is true.

## Response `200`

The alert rule was updated; the body contains the updated rule.

- AlertRule — Full alert rule model. An alert rule defines the conditions that trigger alerts.
  - `id` string, nullable — The alert rule id (encrypted)
  - `name` string, nullable — The name of the alert rule
  - `rule_set` string, nullable — The rule set configuration as a JSON string. See AlertRuleInput.ruleSet for the full schema, supported condition types, operators, and value semantics.
  - `is_enabled` boolean, nullable — Indicates whether the alert rule is currently enabled and will be evaluated. When false, the rule is stored but never triggers alerts.
  - `period` integer, nullable — The look-back / evaluation period, in minutes, used by time-window based conditions.
  - `threshold` integer, nullable — A legacy scalar threshold value retained for backward compatibility. Thresholds for new rules are expressed inside the rule set (AlertRuleInput.ruleSet) via each item's "value" instead.
  - `webhook_url` string, nullable — Optional HTTPS webhook URL that is invoked (HTTP POST) when the rule triggers.
  - `all_devices` boolean, nullable — When true, the rule is evaluated against every device in the account and RevelDigital.Core.PublicApi.Models.AlertRule.DeviceIds is empty. When false, only RevelDigital.Core.PublicApi.Models.AlertRule.DeviceIds are evaluated.
  - `all_users` boolean, nullable — When true, all users in the account are notified and RevelDigital.Core.PublicApi.Models.AlertRule.UserIds is empty. When false, only the users in RevelDigital.Core.PublicApi.Models.AlertRule.UserIds are notified.
  - `created_on` string, date-time, nullable — The date and time the alert rule was created
  - `updated_on` string, date-time, nullable — The date and time the alert rule was last updated
  - `device_ids` string[], nullable — The devices explicitly associated with the rule (encrypted ids). Empty when RevelDigital.Core.PublicApi.Models.AlertRule.AllDevices is true.
  - `user_ids` string[], nullable — The users explicitly notified by the rule (encrypted ids). Empty when RevelDigital.Core.PublicApi.Models.AlertRule.AllUsers is true.

## Other responses

- `400` — The request body is invalid (for example, a malformed or semantically invalid rule_set).
- `401` — The API key is missing or invalid.
- `403` — The caller lacks the AlertRules_Edit securable.
- `404` — No alert rule with the given ID exists for this account.

---

[API](https://skmtc.net/reveldigital/apis/revel-digital-rest-api.md) · [All operations](https://skmtc.net/reveldigital/apis/revel-digital-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/reveldigital/revel-digital-rest-api/versions/f23a94aea621/schema)
