Spaces method and path for this operation:
Refer to Spaces for more information.
[Required authorization] Route required privileges: manage_alerting-v2-rules.
Body
-
Artifacts attached to the rule, each shaped as
{ id, type, data }.datais a type-specific object (for example arunbookmay carrycontent, adashboardmay carrydashboardId). Per-type shape is validated by the artifact-type registry when the type is registered; unregistered types pass through with envelope bounds only.Not more than
100elements. -
Grouping configuration.
Additional properties are NOT allowed.
-
Additional properties are NOT allowed.
no_data_strategy
string | null Any of: Holds the last known episode status when no data is present.
Value is
last_known_status.Emits a
no_dataalert event when no_data query returns no rows for the group. "emit" is not currently accepted by the create/update API.Value is
emit.Resolves the alert episode to inactive on the first no-data run.
Value is
recover.No-data situations are ignored (default).
Value is
none.-
Additional properties are NOT allowed.
-
Minimum length is
1, maximum length is128. -
The current version of the rule, used for optimistic concurrency control.
Minimum length is
1, maximum length is256.
Responses
-
Returns the updated rule.
-
Indicates an invalid schema or parameters.
-
Indicates the request was not authenticated.
-
Indicates the user does not have the required privileges to perform the request.
-
Indicates a rule with the given ID does not exist.
-
Indicates the rule was concurrently updated by another caller.
-
Indicates an unexpected server-side error.
-
Indicates the alerting engine is disabled by the
alerting:v2:enabledadvanced setting.
curl \
--request PATCH 'https://localhost:5601/api/alerting/v2/rules/{id}' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '"{\n \"metadata\": {\n \"description\": \"Updated description.\",\n \"name\": \"Host CPU high (updated)\"\n },\n \"version\": \"WzAsMV0=\"\n}"'
{
"metadata": {
"description": "Updated description.",
"name": "Host CPU high (updated)"
},
"version": "WzAsMV0="
}
{
"created_at": "2026-01-15T12:00:00.000Z",
"created_by": "elastic",
"enabled": true,
"grouping": {
"fields": [
"host.name"
]
},
"id": "rule-1",
"kind": "alert",
"metadata": {
"description": "Updated description.",
"name": "Host CPU high (updated)",
"tags": [
"production",
"infra"
],
"version": 1
},
"query": {
"breach": {
"query": "FROM metrics-* | WHERE host.cpu.usage > 0.9 | STATS avg_cpu = AVG(host.cpu.usage) BY host.name"
},
"format": "standalone"
},
"recovery_strategy": "no_breach",
"schedule": {
"every": "1m",
"lookback": "5m"
},
"state_transition": {
"pending_count": 1,
"recovering_count": 1
},
"time_field": "@timestamp",
"updated_at": "2026-01-15T12:00:00.000Z",
"updated_by": "elastic",
"version": "WzAsMV0="
}
{
"code": "BAD_REQUEST",
"details": {
"errors": {
"unknownField": [
"Unrecognized key"
]
}
},
"error": "Bad Request",
"message": "Unrecognized key(s) in object: 'unknownField'"
}
{
"code": "UNAUTHORIZED",
"error": "Unauthorized",
"message": "Authentication required to access this API."
}
{
"code": "FORBIDDEN",
"error": "Forbidden",
"message": "The current user does not have the required privileges for this request."
}
{
"code": "RULE_NOT_FOUND",
"details": {
"rule_id": "rule-1"
},
"error": "Not Found",
"message": "Rule with id \"rule-1\" not found"
}
{
"code": "RULE_VERSION_CONFLICT",
"details": {
"rule_id": "rule-1"
},
"error": "Conflict",
"message": "Rule with id \"rule-1\" has already been updated by another user"
}
{
"code": "INTERNAL_SERVER_ERROR",
"error": "Internal Server Error",
"message": "An unexpected error occurred."
}
{
"code": "ALERTING_DISABLED",
"error": "Service Unavailable",
"message": "Alerting is disabled."
}