Skip to content

Update alarm rules
Stable

Request

⚠️ Android only.

Fully updates an existing alarm rule identified by its UUID alarm_id. This is a full replacement operation — all required fields must be included in the request body and any optional fields not included may be cleared. To change only one or two fields without resending the full rule object, use PATCH /v1/enterprise/{enterprise_id}/alarmrules/{alarm_id}/ instead.

Request body fields (UpdateAlarmRule)

Required

enterprise — UUID of the enterprise

name — Display name for the rule

metric — The device metric to monitor

conditions — Threshold definition object containing value, unit, comparator, and toggle_state

realert_interval — Interval in minutes before re-alerting if the condition persists

Optional

description — Human-readable description of the rule's purpose

devices — Array of specific device UUIDs to monitor

groups — Array of device group UUIDs to monitor

alert_channels — Array of alert channel UUIDs to notify when the rule fires

action_emails — Array of email addresses to notify directly

actions — Array of actions to perform when the rule fires

is_active — Whether the rule is enabled

repeat_times — Number of times to repeat the alert

Common use cases

Updating the target devices or groups after a fleet restructure

Changing the threshold condition or metric as monitoring requirements evolve

Adding or swapping alert channels when notification routing changes

Enabling or disabling a rule by toggling is_active

Best practices

Always retrieve the current rule state with GET /v1/enterprise/{enterprise_id}/alarmrules/{alarm_id}/ before updating — this is a full replacement and omitting optional fields that were previously set may clear them unintentionally

Prefer PATCH over PUT for single-field changes to reduce payload size and risk of accidental data loss

Note that alarm_id is a UUID, unlike the integer alert_id used by alert channels — use GET /alarmrules/ to look it up if needed

Updating alert_channels replaces the existing channel associations entirely — include all desired channel IDs in the updated body, not just the new ones

Security
esper_cloud_api_apiKey
Path
enterprise_idstringrequired

A UUID string identifying this enterprise.

alarm_idstringrequired

A UUID string identifying the alarm ruleset.

Bodyapplication/jsonrequired
idstring, (uuid)
enterprisestring, (uuid)required
devicesArray of any, (string)
groupsArray of strings
namestringrequired
descriptionstring
metricstringrequired
conditionsobjectrequired
action_emailsArray of strings, (email)
actionsArray of strings
alert_channelsArray of strings
created_onstring, (date-time)
updated_onstring, (date-time)
is_activeboolean
realert_intervalintegerrequired
repeat_timesinteger
trigger_countinteger
daily_trigger_countinteger
cURL
curl -i -X PUT \
  'https://api.esper.io/_mock/openapi/v1/enterprise/{enterprise_id}/alarmrules/{alarm_id}/' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "enterprise": "796caaf9-a7de-4817-9ffa-39d04bf83de9",
    "devices": [
      null
    ],
    "groups": [
      "string"
    ],
    "name": "string",
    "description": "string",
    "metric": "string",
    "conditions": {
      "value": 0.1,
      "unit": "string",
      "comparator": "string",
      "toggle_state": true
    },
    "action_emails": [
      "user@example.com"
    ],
    "actions": [
      "string"
    ],
    "alert_channels": [
      "string"
    ],
    "created_on": "2019-08-24T14:15:22Z",
    "updated_on": "2019-08-24T14:15:22Z",
    "is_active": true,
    "realert_interval": 0,
    "repeat_times": 0,
    "trigger_count": 0,
    "daily_trigger_count": 0
  }'

Responses

successful operation

Bodyapplication/json
idstring, (uuid)
enterprisestring, (uuid)
devicesobject
groupsArray of strings
namestring
descriptionstring
metricstring
conditionsobject
action_emailsArray of strings, (email)
actionsArray of strings
alert_channelsArray of strings
created_onstring, (date-time)
updated_onstring, (date-time)
is_activeboolean
realert_intervalinteger
repeat_timesinteger
trigger_countinteger
daily_trigger_countinteger
Response
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "enterprise": "796caaf9-a7de-4817-9ffa-39d04bf83de9", "devices": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "device_name": "string", "alias_name": "string" }, "groups": [ "string" ], "name": "string", "description": "string", "metric": "string", "conditions": { "value": 0.1, "unit": "string", "comparator": "string", "toggle_state": true }, "action_emails": [ "user@example.com" ], "actions": [ "string" ], "alert_channels": [ "string" ], "created_on": "2019-08-24T14:15:22Z", "updated_on": "2019-08-24T14:15:22Z", "is_active": true, "realert_interval": 0, "repeat_times": 0, "trigger_count": 0, "daily_trigger_count": 0 }