List action policies
- Base URL
-
https://{kibana_url}
- GET /api/alerting/v2/action_policies
- GET /s/{space_id}/api/alerting/v2/action_policies
Get a paginated list of action policies with optional filtering and sorting.
Required authorization
- Privileges read_alerting-v2-action-policies
Path parameters
-
space_idstringoptional -
An identifier for the space. If
space_idis not provided in the URL, the default space is used. Refer to Spaces for more information.
Query parameters
-
per_pageinteger · min: 1 · max: 100 -
The number of action policies to return per page. Defaults to 20.
-
filterstring · min length: 1 · max length: 4096 -
A KQL filter to apply to the action policies. Supported fields: id, name, description, enabled. Cannot be empty. Omit it to list every action policy.
Responses
Returns a paginated list of action policies.
-
itemsobject[]required -
The list of action policies.
-
created_atstring · format: date-time · max length: 64required -
The ISO datetime when the action policy was created.
-
groupingunion oneOf -
One of:
(determined by
mode) -
matcherobject -
Selects the alerts this policy applies to. Set
tagsto match alerts from rules with those routing tags. Setexpressionto a KQL query, which will be evaluated against each alert.
If you set bothtagsandexpression, an alert must match the tags and the expression for the policy to apply. At least one oftagsandexpressionmust be set, so an emptymatcheris rejected. Omitmatcherentirely for a catch-all policy that applies to all alerts. -
expressionstring · min length: 1 · max length: 4096 -
A KQL query that's evaluated against each alert. Supported fields are:
alert_id,alert_status,group_hash,last_event_timestamp,severity, and your rule's query output columns underdata.*(for example,data.host.name). Referencing other fields won't work. Omitmatcher.expressionto match ontagsalone. -
snoozed_untilstring -
The ISO datetime until which the policy is snoozed. Omitted when the policy is not snoozed.
-
throttleunion oneOf -
One of:
(determined by
strategy)
mode: per_alert
one notification per alert lifecycle (default).
strategy: on_status_change
notify only on alert status transitions (default for per_alert).
strategy: per_status_interval
notify on transitions and at regular intervals.
strategy: time_interval
notify at regular intervals regardless of status (default for all/per_field).
Indicates an invalid schema or parameters.
-
codestringrequired -
Stable error code you can branch on, for example
INVALID_SCHEDULEorRULE_ALREADY_EXISTS. -
detailsmap string to object -
Optional structured context whose keys depend on
code. Identifier keys such asrule_id,action_policy_idandgroup_hashare stable, permanent public identifiers. On a 400 request-validation error,details.source(params,query, orbody) names the failing part and is the only guaranteed key. The siblingdetails.errorsmay change. Do not branch on it.
Indicates the request was not authenticated.
-
codestringrequired -
Stable error code you can branch on, for example
INVALID_SCHEDULEorRULE_ALREADY_EXISTS. -
detailsmap string to object -
Optional structured context whose keys depend on
code. Identifier keys such asrule_id,action_policy_idandgroup_hashare stable, permanent public identifiers. On a 400 request-validation error,details.source(params,query, orbody) names the failing part and is the only guaranteed key. The siblingdetails.errorsmay change. Do not branch on it.
Indicates the user does not have the required privileges to perform the request.
-
codestringrequired -
Stable error code you can branch on, for example
INVALID_SCHEDULEorRULE_ALREADY_EXISTS. -
detailsmap string to object -
Optional structured context whose keys depend on
code. Identifier keys such asrule_id,action_policy_idandgroup_hashare stable, permanent public identifiers. On a 400 request-validation error,details.source(params,query, orbody) names the failing part and is the only guaranteed key. The siblingdetails.errorsmay change. Do not branch on it.
Indicates an unexpected server-side error.
-
codestringrequired -
Stable error code you can branch on, for example
INVALID_SCHEDULEorRULE_ALREADY_EXISTS. -
detailsmap string to object -
Optional structured context whose keys depend on
code. Identifier keys such asrule_id,action_policy_idandgroup_hashare stable, permanent public identifiers. On a 400 request-validation error,details.source(params,query, orbody) names the failing part and is the only guaranteed key. The siblingdetails.errorsmay change. Do not branch on it.
Indicates the alerting engine is disabled by the alerting:v2:enabled advanced setting.
-
codestringrequired -
Stable error code you can branch on, for example
INVALID_SCHEDULEorRULE_ALREADY_EXISTS. -
detailsmap string to object -
Optional structured context whose keys depend on
code. Identifier keys such asrule_id,action_policy_idandgroup_hashare stable, permanent public identifiers. On a 400 request-validation error,details.source(params,query, orbody) names the failing part and is the only guaranteed key. The siblingdetails.errorsmay change. Do not branch on it.