Create or replace an action policy
- Base URL
-
https://{kibana_url}
- PUT /api/alerting/v2/action_policies/{id}
Creates an action policy with the given identifier, or fully replaces it if one already exists.
Required authorization
- Privileges manage_alerting-v2-action-policies and read_alerting-v2-rules
Request body
-
destinationsoneOf · min items: 1 · max items: 10required -
The list of destinations. At least one is required.
-
grouping_modeanyOf -
The grouping mode: per_episode groups by episode lifecycle, all sends a single notification for all alerts, per_field groups by the specified fields.
-
Values:
per_episodeallper_field -
matcherobject -
Selects the alerts this policy applies to. Set
tagsto match alerts from rules with those 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. Whenmatcherisnull, or when bothtagsandexpressionare empty, the policy applies to all alerts. -
expressionstring · max length: 4096nullable -
A KQL query that's evaluated against each alert. Supported fields are:
episode_id,episode_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.expressionor set it tonullto match ontagsalone. -
Rule tags this policy should match. The policy applies to alerts from any rule that has at least one of these tags. Omit
matcher.tagsor set it tonullto match onmatcher.expressionalone.
Responses
Returns the replaced action policy.
-
grouping_modeunionrequired -
The grouping mode for alert notifications.
-
Values:
per_episodeallper_field -
matcherobjectrequired nullable -
Selects the alerts this policy applies to. Set
tagsto match alerts from rules with those 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. Whenmatcherisnull, or when bothtagsandexpressionare empty, the policy applies to all alerts. -
expressionstring · max length: 4096nullable -
A KQL query that's evaluated against each alert. Supported fields are:
episode_id,episode_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.expressionor set it tonullto match ontagsalone. -
Rule tags this policy should match. The policy applies to alerts from any rule that has at least one of these tags. Omit
matcher.tagsor set it tonullto match onmatcher.expressionalone. -
snoozed_untilstringrequired nullable -
The ISO datetime until which the policy is snoozed, or null if not snoozed.
Returns the newly created action policy.
-
grouping_modeunionrequired -
The grouping mode for alert notifications.
-
Values:
per_episodeallper_field -
matcherobjectrequired nullable -
Selects the alerts this policy applies to. Set
tagsto match alerts from rules with those 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. Whenmatcherisnull, or when bothtagsandexpressionare empty, the policy applies to all alerts. -
expressionstring · max length: 4096nullable -
A KQL query that's evaluated against each alert. Supported fields are:
episode_id,episode_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.expressionor set it tonullto match ontagsalone. -
Rule tags this policy should match. The policy applies to alerts from any rule that has at least one of these tags. Omit
matcher.tagsor set it tonullto match onmatcher.expressionalone. -
snoozed_untilstringrequired nullable -
The ISO datetime until which the policy is snoozed, or null if not snoozed.
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 the action policy was created or updated concurrently by another caller.
Indicates an unexpected server-side error.
Indicates the alerting engine is disabled by the alerting:v2:enabled advanced setting.