v51

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-01206322659.2 KB
alarms

Update a metric alarm

Update alarm thresholds, evaluation settings, or enabled state.

clear_threshold is the one field where null differs from omitting the key: send null to drop the hysteresis, omit it to leave it as is. It is validated against the resulting threshold and comparison, so patching either side of the pair alone can't invert them.

metric_name and denominator_metric_name are not patchable: changing what an alarm watches would leave its state and history describing a different question, so define a new alarm instead.

enabled: true requires at least one attached channel. Channels may be detached freely while an alarm is disabled, so this is what stops that from re-enabling an alarm that evaluates and records transitions with nowhere to notify.

The alarm's owning project is not patchable either, so the permission needed here is fixed for the life of the alarm: alarms.manage when it is org-level, projects.alarms.manage on the owner when it is not.

patch/orgs/{org_id}/alarms/{alarm_id}

Path parameters

org_idstring required
alarm_idstring required

Request body

clear_thresholdnumber double nullable

Double-option so null clears the hysteresis and an absent key leaves it alone — a plain Option can't tell those apart.

comparison'gt' | 'gte' | 'lt' | 'lte'
datapoints_to_alarminteger nullable
enabledboolean nullable
evaluation_periodsinteger nullable
min_sample_countinteger nullable
missing_data'not_breaching' | 'breaching' | 'insufficient' | 'ignore'
namestring nullable
period_secondsinteger nullable
statstring

Aggregation applied to each evaluation period. Percentiles run from p0.1 to p99.9 in tenths; equivalent spellings such as p95.0 are accepted and returned canonically as p95, while a finer value such as p95.05 is rejected rather than rounded. They are exact rather than interpolated from bins, so they are only available on app.run.duration_ms and cannot be used with denominator_metric_name.

thresholdnumber double nullable

Example request

{
  "stat": "p99"
}

Response

Alarm updated

{"stackTrail":"paths:/orgs/{org_id}/alarms/{alarm_id}:patch:responses:204:content:application/json:schema","oasType":"schema","type":"unknown","description":"Successful responses use HTTP 204 and do not include a body."}