annotationsobject
Optional annotations for the alert rule
conditionstring
The query condition identifier, e.g. 'A', 'B' (required for 'create', 'update')
dataobject[]
Array of alert query objects (required for 'create'/'update'). Each object has: datasourceUid (string, required), model (object with expr for data queries or type/expression/conditions for expressions), refId (string, auto-assigned if omitted), relativeTimeRange ({from, to} in seconds, defaults to {from:600,to:0}). For server-side expressions use datasourceUid '__expr__'. Example: [{datasourceUid: 'prometheus', model: {expr: 'up == 0'}}, {datasourceUid: '__expr__', model: {type: 'threshold', expression: 'A', conditions: [{evaluator: {type: 'gt', params: [0]}}]}}]
datasource_uidstring
Optional: UID of a Prometheus or Loki datasource to query for datasource-managed alert rules (for 'list' operation)
disable_provenanceboolean
If true, the alert remains editable in the Grafana UI (sets X-Disable-Provenance header). Defaults to true.
exec_err_statestring
State on execution error: NoData, Alerting, OK (required for 'create', 'update')
folder_uidstring
The folder UID. For 'list': filter by exact folder UID (mutually exclusive with search_folder). For 'create'/'update': the folder to store the rule in (required).
forstring
Duration before alert fires, e.g. '5m' (required for 'create', 'update')
is_pausedboolean
If true, the alert rule remains inactive, Default is false
keep_firing_forstring
Enables continous firing of alert for specified time even when condition is no longer met. Default is 0 (resolves immediately)
label_selectorsstring[]
Prometheus-style selectors to filter alert rules by labels. Each string is a selector e.g. '{severity="critical", team=~"backend.*"}'. All selectors must match (AND).
labelsobject
Optional labels for the alert rule
limit_alertsinteger
Limit alert instances per rule. For list: 0 omits alerts. For get: <=0 defaults to 200. Max 200.
matchersstring[]
Label matchers to filter alert instances. Each string is a Prometheus-style matcher e.g. 'severity="critical"', 'env!="dev"', 'team=~"backend.*"'. Requires Grafana 12.4+.
missing_series_evals_to_resolveinteger
Consecutive evaluation intervals with no data required to mark the alert as resolved. Default is 2.
no_data_statestring
State when no data: NoData, Alerting, OK (required for 'create', 'update')
notification_settingsobject
Notification settings object. Fields: receiver (string, required), groupBy ([]string), groupWait/groupInterval/repeatInterval (duration strings), muteTimeIntervals/activeTimeIntervals ([]string).
operationenumобязательный
The operation to perform: 'list', 'get', 'versions', 'create', 'update', or 'delete'. To create a rule, use operation 'create' and provide all required fields in a single call. To update a rule, first use 'get' to retrieve its full configuration, then 'update' with all required fields plus your changes.
org_idinteger
The organization ID (required for 'create', 'update')
recordobject
Recording rule config. Fields: from (string, required - ref ID e.g. 'A'), metric (string, required - metric name), targetDatasourceUid (string, optional).
rule_groupstring
The rule group name (required for 'create', 'update')
rule_limitinteger
Maximum number of rules to return (default 200, max 200). Requires Grafana 12.4+ (for 'list' operation)
rule_typeenum
Filter by rule type (for 'list' operation)
rule_uidstring
The UID of the alert rule (required for 'get', 'versions', 'update', 'delete'; optional for 'create')
search_folderstring
Search folders by path using partial matching (for 'list' operation). Requires Grafana 12.4+. Mutually exclusive with folder_uid.
search_rule_namestring
Search alert rule names/titles using partial matching. Requires Grafana 12.4+ (for 'list' operation)
statesstring[]
Filter by alert state: firing, pending, normal, recovering, nodata, error (for 'list' operation)
titlestring
The title of the alert rule (required for 'create', 'update')