Spaces method and path for this operation:
get /s/{space_id}/api/alerting/v2/rules/{id}
Refer to Spaces for more information.
[Required authorization] Route required privileges: read_alerting-v2-rules.
Responses
-
Returns the requested rule.
-
Indicates the request failed schema validation.
-
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 an unexpected server-side error.
-
Indicates the alerting engine is disabled by the
alerting:v2:enabledadvanced setting.
GET
/api/alerting/v2/rules/{id}
curl \
--request GET 'https://localhost:5601/api/alerting/v2/rules/{id}' \
--header "Authorization: $API_KEY"
Response examples (200)
{
"created_at": "2026-01-15T12:00:00.000Z",
"created_by": "elastic",
"enabled": true,
"grouping": {
"fields": [
"host.name"
]
},
"id": "rule-1",
"kind": "alert",
"metadata": {
"description": "Alerts when average CPU usage exceeds a threshold.",
"name": "Host CPU high",
"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="
}
Response examples (400)
{
"code": "BAD_REQUEST",
"details": {
"errors": {
"errors": [],
"properties": {
"page": {
"errors": [
"Too small: expected number to be >=1"
]
}
}
}
},
"error": "Bad Request",
"message": "page: Too small: expected number to be >=1"
}
Response examples (401)
{
"code": "UNAUTHORIZED",
"error": "Unauthorized",
"message": "Authentication required to access this API."
}
Response examples (403)
{
"code": "FORBIDDEN",
"error": "Forbidden",
"message": "The current user does not have the required privileges for this request."
}
Response examples (404)
{
"code": "RULE_NOT_FOUND",
"details": {
"rule_id": "rule-1"
},
"error": "Not Found",
"message": "Rule with id \"rule-1\" not found"
}
Response examples (500)
{
"code": "INTERNAL_SERVER_ERROR",
"error": "Internal Server Error",
"message": "An unexpected error occurred."
}
Response examples (503)
{
"code": "ALERTING_DISABLED",
"error": "Service Unavailable",
"message": "Alerting is disabled."
}