v1

latestOpenAPI 3.0.42026-08-06124112344.5 KB
Alerts

Updates an existing alert rule.

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.

put/alerts/rules/{id}

Path parameters

idstring required

The alert rule ID to update.

Request body

namestring nullable

The name of the alert rule

rule_setstring 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_enabledboolean 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.

periodinteger 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.

thresholdinteger 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_urlstring nullable

Optional HTTPS webhook URL that is invoked (HTTP POST) when the rule triggers. Leave null to notify only through the associated users.

all_devicesboolean 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_usersboolean 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_idsstring[] nullable

The devices to associate with the rule. Ignored when all_devices is true.

user_idsstring[] nullable

The users to notify (encrypted ids). Ignored when all_users is true.

Example request

{
  "rule_set": "[{\"items\":[{\"type\":\"CpuUsage\",\"op\":\"GTE\",\"value\":[90]},{\"type\":\"MemoryUsage\",\"op\":\"GTE\",\"value\":[95]}]}]"
}

Response

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

idstring nullable

The alert rule id (encrypted)

namestring nullable

The name of the alert rule

rule_setstring nullable

The rule set configuration as a JSON string. See AlertRuleInput.ruleSet for the full schema, supported condition types, operators, and value semantics.

is_enabledboolean nullable

Indicates whether the alert rule is currently enabled and will be evaluated. When false, the rule is stored but never triggers alerts.

periodinteger nullable

The look-back / evaluation period, in minutes, used by time-window based conditions.

thresholdinteger 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_urlstring nullable

Optional HTTPS webhook URL that is invoked (HTTP POST) when the rule triggers.

all_devicesboolean 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_usersboolean 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_onstring date-time nullable

The date and time the alert rule was created

updated_onstring date-time nullable

The date and time the alert rule was last updated

device_idsstring[] nullable

The devices explicitly associated with the rule (encrypted ids). Empty when RevelDigital.Core.PublicApi.Models.AlertRule.AllDevices is true.

user_idsstring[] nullable

The users explicitly notified by the rule (encrypted ids). Empty when RevelDigital.Core.PublicApi.Models.AlertRule.AllUsers is true.