v1
latestOpenAPI 3.0.42026-08-06124112344.5 KBCreates a new alert rule.
Creates an alert rule for the authenticated account and returns the created resource, including its newly assigned ID, with a Location header pointing at the GetAlertRuleById route.
The rule_set field, when provided, must be a JSON string describing the trigger conditions. Its schema and validation rules are documented on RevelDigital.Core.PublicApi.Models.AlertRuleRequest.RuleSet. Invalid rule sets are rejected with 400. Requires the AlertRules_Edit securable.
Request body
The name of the alert rule
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.
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.
The look-back / evaluation period, in minutes, used by time-window based conditions such as NoContent. Ignored by conditions that read the current value.
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.
Optional HTTPS webhook URL that is invoked (HTTP POST) when the rule triggers. Leave null to notify only through the associated users.
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.
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.
The devices to associate with the rule. Ignored when all_devices is true.
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 created; the body contains the created rule.
The alert rule id (encrypted)
The name of the alert rule
The rule set configuration as a JSON string. See AlertRuleInput.ruleSet for the full schema, supported condition types, operators, and value semantics.
Indicates whether the alert rule is currently enabled and will be evaluated. When false, the rule is stored but never triggers alerts.
The look-back / evaluation period, in minutes, used by time-window based conditions.
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.
Optional HTTPS webhook URL that is invoked (HTTP POST) when the rule triggers.
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.
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.
The date and time the alert rule was created
The date and time the alert rule was last updated
The devices explicitly associated with the rule (encrypted ids). Empty when RevelDigital.Core.PublicApi.Models.AlertRule.AllDevices is true.
The users explicitly notified by the rule (encrypted ids). Empty when RevelDigital.Core.PublicApi.Models.AlertRule.AllUsers is true.