---
type: api
title: Apply a bulk action to detection rules
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-performrulesbulkaction
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-performrulesbulkaction
products:
  - Kibana
---

# Apply a bulk action to detection rules

- Server: `https://{kibana_url}`

## Paths

- `POST` `/api/detection_engine/rules/_bulk_action`
- `POST` `/s/{space_id}/api/detection_engine/rules/_bulk_action`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#basicauth)

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Apply a bulk action, such as bulk edit, duplicate, or delete, to multiple detection rules. The bulk action is applied to all rules that match the query or to the rules listed by their IDs.

The edit action allows you to add, delete, or set tags, index patterns, investigation fields, rule actions and schedules for multiple rules at once. 
The edit action is idempotent, meaning that if you add a tag to a rule that already has that tag, no changes are made. The same is true for other edit actions, for example removing an index pattern that is not specified in a rule will not result in any changes. The only exception is the `add_rule_actions` and `set_rule_actions` action, which is non-idempotent. This means that if you add or set a rule action to a rule that already has that action, a new action is created with a new unique ID.
> warn
> When used with [API key](https://www.elastic.co/docs/deploy-manage/api-keys) authentication, the user's key gets assigned to the affected rules. If the user's key gets deleted or the user becomes inactive, the rules will stop running.

> If the API key that is used for authorization has different privileges than the key that created or most recently updated the rule, the rule behavior might change.

## Query String Parameters

- `dry_run` (boolean)
  Enables dry run mode for the request call.

Enable dry run mode to verify that bulk actions can be applied to specified rules. Certain rules, such as prebuilt Elastic rules on a Basic subscription, can’t be edited and will return errors in the request response. Error details will contain an explanation, the rule name and/or ID, and additional troubleshooting information.

To enable dry run mode on a request, add the query parameter `dry_run=true` to the end of the request URL. Rules specified in the request will be temporarily updated. These updates won’t be written to Elasticsearch.
> info
> Dry run mode is not supported for the `export` bulk action. A 400 error will be returned in the request response.

## Request Body

`application/json`

One of:
- **BulkDeleteRules**
  - `action` (enum) — required
    Values: `delete`
  - `gap_auto_fill_scheduler_id` (string) — optional
    Gap auto fill scheduler ID used to determine gap fill status for rules
  - `gap_fill_statuses` ([] enum) — optional
    Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
    Values: `unfilled`, `in_progress`, `filled`, `error`
  - `gaps_range_end` (string) — optional
    Gaps range end, valid only when query is provided
  - `gaps_range_start` (string) — optional
    Gaps range start, valid only when query is provided
  - `ids` ([] string · min: 1) — optional
    Array of rule `id`s to which a bulk action will be applied. Do not use rule's `rule_id` here.
Only valid when query property is undefined.
  - `query` (string) — optional
    Query to filter rules.
- **BulkDisableRules**
  - `action` (enum) — required
    Values: `disable`
  - `gap_auto_fill_scheduler_id` (string) — optional
    Gap auto fill scheduler ID used to determine gap fill status for rules
  - `gap_fill_statuses` ([] enum) — optional
    Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
    Values: `unfilled`, `in_progress`, `filled`, `error`
  - `gaps_range_end` (string) — optional
    Gaps range end, valid only when query is provided
  - `gaps_range_start` (string) — optional
    Gaps range start, valid only when query is provided
  - `ids` ([] string · min: 1) — optional
    Array of rule `id`s to which a bulk action will be applied. Do not use rule's `rule_id` here.
Only valid when query property is undefined.
  - `query` (string) — optional
    Query to filter rules.
- **BulkEnableRules**
  - `action` (enum) — required
    Values: `enable`
  - `gap_auto_fill_scheduler_id` (string) — optional
    Gap auto fill scheduler ID used to determine gap fill status for rules
  - `gap_fill_statuses` ([] enum) — optional
    Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
    Values: `unfilled`, `in_progress`, `filled`, `error`
  - `gaps_range_end` (string) — optional
    Gaps range end, valid only when query is provided
  - `gaps_range_start` (string) — optional
    Gaps range start, valid only when query is provided
  - `ids` ([] string · min: 1) — optional
    Array of rule `id`s to which a bulk action will be applied. Do not use rule's `rule_id` here.
Only valid when query property is undefined.
  - `query` (string) — optional
    Query to filter rules.
- **BulkExportRules**
  - `action` (enum) — required
    Values: `export`
  - `gap_auto_fill_scheduler_id` (string) — optional
    Gap auto fill scheduler ID used to determine gap fill status for rules
  - `gap_fill_statuses` ([] enum) — optional
    Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
    Values: `unfilled`, `in_progress`, `filled`, `error`
  - `gaps_range_end` (string) — optional
    Gaps range end, valid only when query is provided
  - `gaps_range_start` (string) — optional
    Gaps range start, valid only when query is provided
  - `ids` ([] string · min: 1) — optional
    Array of rule `id`s to which a bulk action will be applied. Do not use rule's `rule_id` here.
Only valid when query property is undefined.
  - `query` (string) — optional
    Query to filter rules.
- **BulkDuplicateRules**
  - `action` (enum) — required
    Values: `duplicate`
  - `duplicate` (object) — optional
    Duplicate object that describes applying an update action.
    - `include_exceptions` (boolean) — required
      Whether to copy exceptions from the original rule
    - `include_expired_exceptions` (boolean) — required
      Whether to copy expired exceptions from the original rule
  - `gap_auto_fill_scheduler_id` (string) — optional
    Gap auto fill scheduler ID used to determine gap fill status for rules
  - `gap_fill_statuses` ([] enum) — optional
    Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
    Values: `unfilled`, `in_progress`, `filled`, `error`
  - `gaps_range_end` (string) — optional
    Gaps range end, valid only when query is provided
  - `gaps_range_start` (string) — optional
    Gaps range start, valid only when query is provided
  - `ids` ([] string · min: 1) — optional
    Array of rule `id`s to which a bulk action will be applied. Do not use rule's `rule_id` here.
Only valid when query property is undefined.
  - `query` (string) — optional
    Query to filter rules.
- **BulkManualRuleRun**
  - `action` (enum) — required
    Values: `run`
  - `gap_auto_fill_scheduler_id` (string) — optional
    Gap auto fill scheduler ID used to determine gap fill status for rules
  - `gap_fill_statuses` ([] enum) — optional
    Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
    Values: `unfilled`, `in_progress`, `filled`, `error`
  - `gaps_range_end` (string) — optional
    Gaps range end, valid only when query is provided
  - `gaps_range_start` (string) — optional
    Gaps range start, valid only when query is provided
  - `ids` ([] string · min: 1) — optional
    Array of rule `id`s to which a bulk action will be applied. Do not use rule's `rule_id` here.
Only valid when query property is undefined.
  - `query` (string) — optional
    Query to filter rules.
  - `run` (object) — required
    Object that describes applying a manual rule run action.
    - `end_date` (string) — required
      End date of the manual rule run
    - `start_date` (string) — required
      Start date of the manual rule run
- **BulkManualRuleFillGaps**
  - `action` (enum) — required
    Values: `fill_gaps`
  - `fill_gaps` (object) — required
    Object that describes applying a manual gap fill action for the specified time range.
    - `end_date` (string) — required
      End date of the manual gap fill
    - `start_date` (string) — required
      Start date of the manual gap fill
  - `gap_auto_fill_scheduler_id` (string) — optional
    Gap auto fill scheduler ID used to determine gap fill status for rules
  - `gap_fill_statuses` ([] enum) — optional
    Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
    Values: `unfilled`, `in_progress`, `filled`, `error`
  - `gaps_range_end` (string) — optional
    Gaps range end, valid only when query is provided
  - `gaps_range_start` (string) — optional
    Gaps range start, valid only when query is provided
  - `ids` ([] string · min: 1) — optional
    Array of rule `id`s to which a bulk action will be applied. Do not use rule's `rule_id` here.
Only valid when query property is undefined.
  - `query` (string) — optional
    Query to filter rules.
- **BulkEditRules**
  - `action` (enum) — required
    Values: `edit`
  - `edit` ([] union  · min: 1) — required
    Array of objects containing the edit operations
    - **BulkActionEditPayloadTags**
      Edits tags of rules.
      - `type` (enum) — required
        Values: `add_tags`, `delete_tags`, `set_tags`
      - `value` ([] object) — required
        String array containing words and phrases to help categorize, filter, and search rules. Defaults to an empty array.
    - **BulkActionEditPayloadIndexPatterns**
      Edits index patterns of rulesClient.
      - `overwrite_data_views` (boolean) — optional
        Resets the data view for the rule.
      - `type` (enum) — required
        Values: `add_index_patterns`, `delete_index_patterns`, `set_index_patterns`
      - `value` ([] object) — required
        Indices on which the rule functions. Defaults to the Security Solution indices defined on the Kibana Advanced Settings page (Kibana → Stack Management → Advanced Settings → `securitySolution:defaultIndex`).
> info
> This field is not supported for ES|QL rules.
    - **BulkActionEditPayloadInvestigationFields**
      Edits investigation fields of rules.
      - `type` (enum) — required
        Values: `add_investigation_fields`, `delete_investigation_fields`, `set_investigation_fields`
      - `value` ({}) — required
        Schema for fields relating to investigation fields. These are user defined fields we use to highlight
in various features in the UI such as alert details flyout and exceptions auto-population from alert.
        - `field_names` ([] string · min: 1) — required
    - **BulkActionEditPayloadTimeline**
      Edits timeline of rules.
      - `type` (enum) — required
        Values: `set_timeline`
      - `value` (object) — required
        - `timeline_id` (string) — required
          Timeline template ID
        - `timeline_title` (string) — required
          Timeline template title
    - **BulkActionEditPayloadRuleActions**
      Edits rule actions of rules.
      - `type` (enum) — required
        Values: `add_rule_actions`, `set_rule_actions`
      - `value` (object) — required
        - `actions` ([] object) — required
          - `alerts_filter` (object) — optional
            Object containing an action’s conditional filters.

- `timeframe` (object, optional): Object containing the time frame for when this action can be run.
    - `days` (array of integers, required): List of days of the week on which this action will be run. Days of the week are expressed as numbers between `1-7`, where `1` is Monday and `7` is Sunday. To select all days of the week, enter an empty array.
    - `hours` (object, required): The hours of the day during which this action will run. Hours of the day are expressed as two strings in the format `hh:mm` in `24` hour time. A start of `00:00` and an end of `24:00` means the action can run all day.
        - start (string, required): Start time in `hh:mm` format.
        - end (string, required): End time in `hh:mm` format.
    - `timezone` (string, required): An ISO timezone name, such as `Europe/Madrid` or `America/New_York`. Specific offsets such as `UTC` or `UTC+1` will also work, but lack built-in DST.
- `query` (object, optional): Object containing a query filter which gets applied to an action and determines whether the action should run.
    - `kql` (string, required): A KQL string.
    - `filters` (array of objects, required): Array of filter objects, as defined in the `kbn-es-query` package.
          - `frequency` ({}) — optional
            The action frequency defines when the action runs (for example, only on rule execution or at specific time intervals).
            - `notifyWhen` (enum) — required
              Defines how often rules run actions.
              Values: `onActiveAlert`, `onThrottleInterval`, `onActionGroupChange`
            - `summary` (boolean) — required
              Action summary indicates whether we will send a summary notification about all the generate alerts or notification per individual alert
            - `throttle` (union) — required
              Defines how often rule actions are taken.
              Values: `no_actions`, `rule`
          - `group` (string) — optional
            Optionally groups actions by use cases. Use `default` for alert notifications.
          - `id` (string) — required
            The connector ID.
          - `params` (object) — required
            Object containing the allowed connector fields, which varies according to the connector type.

For Slack:

  - `message` (string, required): The notification message.

For email:

  - `to`, `cc`, `bcc` (string): Email addresses to which the notifications are sent. At least one field must have a value.
  - `subject` (string, optional): Email subject line.
  - `message` (string, required): Email body text.

For Webhook:

  - `body` (string, required): JSON payload.

For PagerDuty:

  - `severity` (string, required): Severity of on the alert notification, can be: `Critical`, `Error`, `Warning` or `Info`.
  - `eventAction` (string, required): Event [action type](https://v2.developer.pagerduty.com/docs/events-api-v2#event-action), which can be `trigger`, `resolve`, or `acknowledge`.
  - `dedupKey` (string, optional): Groups alert notifications with the same PagerDuty alert.
  - `timestamp` (DateTime, optional): ISO-8601 format [timestamp](https://v2.developer.pagerduty.com/docs/types#datetime).
  - `component` (string, optional): Source machine component responsible for the event, for example `security-solution`.
  - `group` (string, optional): Enables logical grouping of service components.
  - `source` (string, optional): The affected system. Defaults to the Kibana saved object ID of the action.
  - `summary` (string, options): Summary of the event. Defaults to `No summary provided`. Maximum length is 1024 characters.
  - `class` (string, optional): Value indicating the class/type of the event.
        - `throttle` (enum) — optional
          Defines the maximum interval in which a rule’s actions are executed.
> info
> The rule level `throttle` field is deprecated in Elastic Security 8.8 and will remain active for at least the next 12 months.
> In Elastic Security 8.8 and later, you can use the `frequency` field to define frequencies for individual actions. Actions without frequencies will acquire a converted version of the rule’s `throttle` field. In the response, the converted `throttle` setting appears in the individual actions' `frequency` field.
          Values: `rule`, `1h`, `1d`, `7d`
    - **BulkActionEditPayloadSchedule**
      Overwrites schedule of rules.
      - `type` (enum) — required
        Values: `set_schedule`
      - `value` (object) — required
        - `interval` (string · pattern: ^[1-9]\d*[smh]$) — required
          Interval in which the rule runs. For example, `"1h"` means the rule runs every hour.
        - `lookback` (string · pattern: ^[1-9]\d*[smh]$) — required
          Lookback time for the rules.

Additional look-back time that the rule analyzes. For example, "10m" means the rule analyzes the last 10 minutes of data in addition to the frequency interval.
    - **BulkActionEditPayloadAlertSuppression**
  - `gap_auto_fill_scheduler_id` (string) — optional
    Gap auto fill scheduler ID used to determine gap fill status for rules
  - `gap_fill_statuses` ([] enum) — optional
    Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
    Values: `unfilled`, `in_progress`, `filled`, `error`
  - `gaps_range_end` (string) — optional
    Gaps range end, valid only when query is provided
  - `gaps_range_start` (string) — optional
    Gaps range start, valid only when query is provided
  - `ids` ([] string · min: 1) — optional
    Array of rule `id`s to which a bulk action will be applied. Do not use rule's `rule_id` here.
Only valid when query property is undefined.
  - `query` (string) — optional
    Query to filter rules.

## Response

OK

`application/json`

One of:
- **BulkEditActionResponse**
  - `attributes` (object)
    - `errors` ([] object)
      - `err_code` (enum)
        Values: `IMMUTABLE`, `PREBUILT_CUSTOMIZATION_LICENSE`, `MACHINE_LEARNING_AUTH`, `MACHINE_LEARNING_INDEX_PATTERN`, `ESQL_INDEX_PATTERN`, `MANUAL_RULE_RUN_FEATURE`, `MANUAL_RULE_RUN_DISABLED_RULE`, `THRESHOLD_RULE_TYPE_IN_SUPPRESSION`, `UNSUPPORTED_RULE_IN_SUPPRESSION_FOR_THRESHOLD`, `RULE_FILL_GAPS_DISABLED_RULE`, `USER_INSUFFICIENT_RULE_PRIVILEGES`
      - `message` (string)
      - `rules` ([] object)
        - `id` (string)
        - `name` (string)
      - `status_code` (integer)
    - `results` ({})
      - `created` ([] union)
        - **EqlRule**
          - `actions` ([] object)
            Array defining the automated actions (notifications) taken when alerts are generated.
            - `action_type_id` (string)
              The action type used for sending notifications, can be:

  - `.slack`
  - `.slack_api`
  - `.email`
  - `.index`
  - `.pagerduty`
  - `.swimlane`
  - `.webhook`
  - `.servicenow`
  - `.servicenow-itom`
  - `.servicenow-sir`
  - `.jira`
  - `.resilient`
  - `.opsgenie`
  - `.teams`
  - `.torq`
  - `.tines`
  - `.d3security`
            - `alerts_filter` (object)
              Object containing an action’s conditional filters.

- `timeframe` (object, optional): Object containing the time frame for when this action can be run.
    - `days` (array of integers, required): List of days of the week on which this action will be run. Days of the week are expressed as numbers between `1-7`, where `1` is Monday and `7` is Sunday. To select all days of the week, enter an empty array.
    - `hours` (object, required): The hours of the day during which this action will run. Hours of the day are expressed as two strings in the format `hh:mm` in `24` hour time. A start of `00:00` and an end of `24:00` means the action can run all day.
        - start (string, required): Start time in `hh:mm` format.
        - end (string, required): End time in `hh:mm` format.
    - `timezone` (string, required): An ISO timezone name, such as `Europe/Madrid` or `America/New_York`. Specific offsets such as `UTC` or `UTC+1` will also work, but lack built-in DST.
- `query` (object, optional): Object containing a query filter which gets applied to an action and determines whether the action should run.
    - `kql` (string, required): A KQL string.
    - `filters` (array of objects, required): Array of filter objects, as defined in the `kbn-es-query` package.
            - `frequency` ({})
              The action frequency defines when the action runs (for example, only on rule execution or at specific time intervals).
              - `notifyWhen` (enum)
                Defines how often rules run actions.
                Values: `onActiveAlert`, `onThrottleInterval`, `onActionGroupChange`
              - `summary` (boolean)
                Action summary indicates whether we will send a summary notification about all the generate alerts or notification per individual alert
              - `throttle` (union)
                Defines how often rule actions are taken.
                Values: `no_actions`, `rule`
            - `group` (string)
              Optionally groups actions by use cases. Use `default` for alert notifications.
            - `id` (string)
              The connector ID.
            - `params` (object)
              Object containing the allowed connector fields, which varies according to the connector type.

For Slack:

  - `message` (string, required): The notification message.

For email:

  - `to`, `cc`, `bcc` (string): Email addresses to which the notifications are sent. At least one field must have a value.
  - `subject` (string, optional): Email subject line.
  - `message` (string, required): Email body text.

For Webhook:

  - `body` (string, required): JSON payload.

For PagerDuty:

  - `severity` (string, required): Severity of on the alert notification, can be: `Critical`, `Error`, `Warning` or `Info`.
  - `eventAction` (string, required): Event [action type](https://v2.developer.pagerduty.com/docs/events-api-v2#event-action), which can be `trigger`, `resolve`, or `acknowledge`.
  - `dedupKey` (string, optional): Groups alert notifications with the same PagerDuty alert.
  - `timestamp` (DateTime, optional): ISO-8601 format [timestamp](https://v2.developer.pagerduty.com/docs/types#datetime).
  - `component` (string, optional): Source machine component responsible for the event, for example `security-solution`.
  - `group` (string, optional): Enables logical grouping of service components.
  - `source` (string, optional): The affected system. Defaults to the Kibana saved object ID of the action.
  - `summary` (string, options): Summary of the event. Defaults to `No summary provided`. Maximum length is 1024 characters.
  - `class` (string, optional): Value indicating the class/type of the event.
            - `uuid` (string · min: 1)
              A string that does not contain only whitespace characters
          - `alias_purpose` (enum)
            Values: `savedObjectConversion`, `savedObjectImport`
          - `alias_target_id` (string)
          - `author` ([] object)
            The rule’s author.
          - `building_block_type` (string)
            Determines if the rule acts as a building block. If yes, the value must be `default`.
By default, building-block alerts are not displayed in the UI. These rules are used as a foundation for other rules that do generate alerts.
For more information, refer to [About building block rules](https://www.elastic.co/docs/solutions/security/detect-and-alert/about-building-block-rules).
          - `description` (string · min: 1)
            The rule’s description.
          - `enabled` (boolean)
            Determines whether the rule is enabled. Defaults to true.
          - `exceptions_list` ([] object)
            - `id` (string · min: 1)
              ID of the exception container
            - `list_id` (string · min: 1)
              List ID of the exception container
            - `namespace_type` (enum)
              Determines the exceptions validity in rule's Kibana space
              Values: `agnostic`, `single`
            - `type` (enum)
              The exception type
              Values: `detection`, `rule_default`, `endpoint`, `endpoint_trusted_apps`, `endpoint_trusted_devices`, `endpoint_events`, `endpoint_host_isolation_exceptions`, `endpoint_blocklists`
          - `false_positives` ([] object)
            String array used to describe common reasons why the rule may issue false-positive alerts. Defaults to an empty array.
          - `from` (string)
            Time from which data is analyzed each time the rule runs, using a date math range. For example, now-4200s means the rule analyzes data from 70 minutes before its start time. Defaults to now-6m (analyzes data from 6 minutes before the start time).
          - `interval` (string)
            Frequency of rule execution, using a date math range. For example, "1h" means the rule runs every hour. Defaults to 5m (5 minutes).
          - `investigation_fields` ({})
            Schema for fields relating to investigation fields. These are user defined fields we use to highlight
in various features in the UI such as alert details flyout and exceptions auto-population from alert.
            - `field_names` ([] string · min: 1)
          - `license` (string)
            The rule's license.
          - `max_signals` (integer · min: 1)
            Maximum number of alerts the rule can create during a single run (the rule’s Max alerts per run [advanced setting](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#rule-ui-advanced-params) value). Defaults to `100`.
> info
> This setting can be superseded by the [Kibana configuration setting](https://www.elastic.co/docs/reference/kibana/configuration-reference/alerting-settings) `xpack.alerting.rules.run.alerts.max`, which determines the maximum alerts generated by any rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, the rule can generate no more than 1000 alerts even if `max_signals` is set higher.
          - `meta` (object)
            Placeholder for metadata about the rule.
> info
> This field is overwritten when you save changes to the rule’s settings.
          - `name` (string · min: 1)
            A human-readable name for the rule.
          - `namespace` (string)
            Has no effect.
          - `note` (string)
            Notes to help investigate alerts produced by the rule.
          - `outcome` (enum)
            Values: `exactMatch`, `aliasMatch`, `conflict`
          - `output_index` (string) — deprecated
            (deprecated) Has no effect.
          - `references` ([] object)
            Array containing notes about or references to relevant information about the rule. Defaults to an empty array.
          - `related_integrations` ([] object)
            - `integration` (string · min: 1)
              A string that does not contain only whitespace characters
            - `package` (string · min: 1)
              A string that does not contain only whitespace characters
            - `version` (string · min: 1)
              A string that does not contain only whitespace characters
          - `required_fields` ([] object)
            Elasticsearch fields and their types that need to be present for the rule to function.
> info
> The value of `required_fields` does not affect the rule’s behavior, and specifying it incorrectly won’t cause the rule to fail. Use `required_fields` as an informational property to document the fields that the rule expects to be present in the data.
            - `name` (string · min: 1)
              Name of an Elasticsearch field
            - `type` (string · min: 1)
              Type of the Elasticsearch field
          - `response_actions` ([] union)
            - **OsqueryResponseAction**
              - `action_type_id` (enum)
                Values: `.osquery`
              - `params` ({})
                - `ecs_mapping` (object)
                  Map Osquery results columns or static values to Elastic Common Schema (ECS) fields. Example: "ecs_mapping": {"process.pid": {"field": "pid"}}
                - `pack_id` (string)
                  To specify a query pack, use the packId field. Example: "packId": "processes_elastic"
                - `queries` ([] object)
                  - `ecs_mapping` (object)
                    Map Osquery results columns or static values to Elastic Common Schema (ECS) fields. Example: "ecs_mapping": {"process.pid": {"field": "pid"}}
                  - `id` (string)
                    Query ID
                  - `platform` (string)
                  - `query` (string)
                    Query to run
                  - `removed` (boolean)
                  - `snapshot` (boolean)
                  - `version` (string)
                    Query version
                - `query` (string)
                  To run a single query, use the query field and enter a SQL query. Example: "query": "SELECT * FROM processes;"
                - `saved_query_id` (string)
                  To run a saved query, use the saved_query_id field and specify the saved query ID. Example: "saved_query_id": "processes_elastic"
                - `timeout` (number)
                  A timeout period, in seconds, after which the query will stop running. Overwriting the default timeout allows you to support queries that require more time to complete. The default and minimum supported value is 60. The maximum supported value is 900. Example: "timeout": 120.
            - **EndpointResponseAction**
              - `action_type_id` (enum)
                Values: `.endpoint`
              - `params` (union oneOf)
                - **DefaultParams**
                  - `command` (enum)
                    Values: `isolate`
                  - `comment` (string)
                - **ProcessesParams**
                  - `command` (enum)
                    To run an endpoint response action, specify a value for the command field. Example: "command": "isolate"
                    Values: `kill-process`, `suspend-process`
                  - `comment` (string)
                    Add a note that explains or describes the action. You can find your comment in the response actions history log. Example: "comment": "Check processes"
                  - `config` (object)
                    - `field` (string)
                      Field to use instead of process.pid
                    - `overwrite` (boolean · default: true)
                      Whether to overwrite field with process.pid
                - **RunscriptParams**
                  Run a script on the Elastic Defend host that triggered the alert.
                  - `command` (enum)
                    Values: `runscript`
                  - `comment` (string)
                    Add a note that explains or describes the action. You can find your comment in the response actions history log
                  - `config` (object)
                    - `linux` ({})
                      - `scriptId` (string)
                        The ID of the script to run (from the Kibana Script library)
                      - `scriptInput` (string)
                        The arguments to pass to the script (if any)
                      - `timeout` (integer)
                        Specify the timeout in seconds for the script execution
                    - `macos` ({})
                      - `scriptId` (string)
                        The ID of the script to run (from the Kibana Script library)
                      - `scriptInput` (string)
                        The arguments to pass to the script (if any)
                      - `timeout` (integer)
                        Specify the timeout in seconds for the script execution
                    - `windows` ({})
                      - `scriptId` (string)
                        The ID of the script to run (from the Kibana Script library)
                      - `scriptInput` (string)
                        The arguments to pass to the script (if any)
                      - `timeout` (integer)
                        Specify the timeout in seconds for the script execution
          - `risk_score` (integer · min: 0 · max: 100)
            A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
          - `risk_score_mapping` ([] object)
            Overrides generated alerts' risk_score with a value from the source event
            - `field` (string)
              Source event field used to override the default `risk_score`.
            - `operator` (enum)
              Values: `equals`
            - `risk_score` (integer · min: 0 · max: 100)
              A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
            - `value` (string)
          - `rule_name_override` (string)
            Sets which field in the source event is used to populate the alert's `signal.rule.name` value (in the UI, this value is displayed on the Rules page in the Rule column). When unspecified, the rule’s `name` value is used. The source field must be a string data type.
          - `setup` (string)
            Populates the rule’s setup guide with instructions on rule prerequisites such as required integrations, configuration steps, and anything else needed for the rule to work correctly.
          - `severity` (enum)
            Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
            Values: `low`, `medium`, `high`, `critical`
          - `severity_mapping` ([] object)
            Overrides generated alerts' severity with values from the source event
            - `field` (string)
              Source event field used to override the default `severity`.
            - `operator` (enum)
              Values: `equals`
            - `severity` (enum)
              Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
              Values: `low`, `medium`, `high`, `critical`
            - `value` (string)
          - `tags` ([] object)
            String array containing words and phrases to help categorize, filter, and search rules. Defaults to an empty array.
          - `threat` ([] object)
            - `framework` (string)
              Relevant attack framework
            - `tactic` ({})
              Object containing information on the attack type
              - `id` (string)
                Tactic ID
              - `name` (string)
                Tactic name
              - `reference` (string)
                Tactic reference
            - `technique` ([] object)
              Array containing information on the attack techniques (optional)
              - `id` (string)
                Technique ID
              - `name` (string)
                Technique name
              - `reference` (string)
                Technique reference
              - `subtechnique` ([] object)
                Array containing more specific information on the attack technique.
                - `id` (string)
                  Subtechnique ID
                - `name` (string)
                  Subtechnique name
                - `reference` (string)
                  Subtechnique reference
          - `throttle` (union)
            Defines how often rule actions are taken.
            Values: `no_actions`, `rule`
          - `timeline_id` (string)
            Timeline template ID
          - `timeline_title` (string)
            Timeline template title
          - `timestamp_override` (string)
            Sets the time field used to query indices. When unspecified, rules query the `@timestamp` field. The source field must be an Elasticsearch date data type.
          - `timestamp_override_fallback_disabled` (boolean)
            Disables the fallback to the event's @timestamp field
          - `to` (string)
          - `version` (integer · min: 1)
            The rule's version number.

- For prebuilt rules it represents the version of the rule's content in the source [detection-rules](https://github.com/elastic/detection-rules) repository (and the corresponding `security_detection_engine` Fleet package that is used for distributing prebuilt rules). 
- For custom rules it is set to `1` when the rule is created. 
> info
> It is not incremented on each update. Compare this to the `revision` field.
          - `created_at` (string)
          - `created_by` (string)
          - `execution_summary` ({})
            Summary of the last execution of a rule.
> info
> This field is under development and its usage or schema may change
            - `last_execution` (object)
              - `date` (string)
                Date of the last execution
              - `message` (string)
              - `metrics` ({})
                - `execution_gap_duration_s` (integer · min: 0)
                  Duration in seconds of execution gap
                - `frozen_indices_queried_count` (integer · min: 0)
                  Count of frozen indices queried during the rule execution. These indices could not be entirely excluded after applying the time range filter.
                - `gap_range` (object)
                  Range of the execution gap
                  - `gte` (string)
                    Start date of the execution gap
                  - `lte` (string)
                    End date of the execution gap
                - `gap_reason` (object)
                  Detected reason for the execution gap
                  - `type` (enum)
                    The type of reason for the gap (rule_disabled or rule_did_not_run)
                    Values: `rule_disabled`, `rule_did_not_run`
                - `total_enrichment_duration_ms` (integer · min: 0)
                  Total time spent enriching documents during current rule execution cycle
                - `total_indexing_duration_ms` (integer · min: 0)
                  Total time spent indexing documents during current rule execution cycle
                - `total_search_duration_ms` (integer · min: 0)
                  Total time spent performing ES searches as measured by Kibana; includes network latency and time spent serializing/deserializing request/response
              - `status` (enum)
                Custom execution status of Security rules that is different from the status used in the Alerting Framework. We merge our custom status with the Framework's status to determine the resulting status of a rule.
- going to run - @deprecated Replaced by the 'running' status but left for backwards compatibility with rule execution events already written to Event Log in the prior versions of Kibana. Don't use when writing rule status changes.
- running - Rule execution started but not reached any intermediate or final status.
- partial failure - Rule can partially fail for various reasons either in the middle of an execution (in this case we update its status right away) or in the end of it. So currently this status can be both intermediate and final at the same time. A typical reason for a partial failure: not all the indices that the rule searches over actually exist.
- failed - Rule failed to execute due to unhandled exception or a reason defined in the business logic of its executor function.
- succeeded - Rule executed successfully without any issues. Note: this status is just an indication of a rule's "health". The rule might or might not generate any alerts despite of it.
                Values: `going to run`, `running`, `partial failure`, `failed`, `succeeded`
              - `status_order` (integer)
          - `id` (string)
            A universally unique identifier
          - `immutable` (boolean) — deprecated
            This field determines whether the rule is a prebuilt Elastic rule. It will be replaced with the `rule_source` field.
          - `revision` (integer · min: 0)
            The rule's revision number.

It represents the version of rule's object in Kibana. It is set to `0` when the rule is installed or created and then gets incremented on each update.
> info
> Not all updates to any rule fields will increment the revision. Only those fields that are considered static `rule parameters` can trigger revision increments. For example, an update to a rule's query or index fields will increment the rule's revision by `1`. However, changes to dynamic or technical fields like enabled or execution_summary will not cause revision increments.
          - `rule_id` (string)
            A stable unique identifier for the rule object. It can be assigned during rule creation. It can be any string, but often is a UUID. It should be unique not only within a given Kibana space, but also across spaces and Elastic environments. The same prebuilt Elastic rule, when installed in two different Kibana spaces or two different Elastic environments, will have the same `rule_id`s.
          - `rule_source` (union)
            Discriminated union that determines whether the rule is internally sourced (created within the Kibana app) or has an external source, such as the Elastic Prebuilt rules repo.
            - **ExternalRuleSource** (`type: external`)
              Type of rule source for externally sourced rules, i.e. rules that have an external source, such as the Elastic Prebuilt rules repo.
              - `customized_fields` ([] object)
                An array of customized field names — that is, fields that the user has modified from their base value. Defaults to an empty array.
                - `field_name` (string)
                  Name of a user-modified field in the rule object.
              - `has_base_version` (boolean)
                Determines whether an external/prebuilt rule has its original, unmodified version present when the calculation of its customization status is performed (`rule_source.is_customized` and `rule_source.customized_fields`).
              - `is_customized` (boolean)
                Determines whether an external/prebuilt rule has been customized by the user (i.e. any of its fields have been modified and diverged from the base value).
              - `type` (enum)
                Values: `external`
            - **InternalRuleSource** (`type: internal`)
              Type of rule source for internally sourced rules, i.e. created within the Kibana apps.
              - `type` (enum)
                Values: `internal`
          - `updated_at` (string)
          - `updated_by` (string)
          - `language` (enum)
            Values: `eql`
          - `query` (string)
            [Query](https://www.elastic.co/docs/explore-analyze/query-filter) used by the rule to create alerts.

- For indicator match rules, only the query’s results are used to determine whether an alert is generated.
- ES|QL rules have additional query requirements. Refer to [Create ES|QL](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#create-esql-rule) rules for more information.
          - `type` (enum)
            Rule type
            Values: `eql`
          - `alert_suppression` ({})
            Defines alert suppression configuration.
            - `duration` ({})
              - `unit` (enum)
                Time unit
                Values: `s`, `m`, `h`
              - `value` (integer · min: 1)
            - `group_by` ([] object · min: 1 · max: 3)
            - `missing_fields_strategy` (enum)
              Describes how alerts will be generated for documents with missing suppress by fields:
doNotSuppress - per each document a separate alert will be created
suppress - only alert will be created per suppress by bucket
              Values: `doNotSuppress`, `suppress`
          - `data_view_id` (string)
          - `event_category_override` (string)
          - `filters` ([] object)
            The query and filter context array used to define the conditions for when alerts are created from events. Defaults to an empty array.
> info
> This field is not supported for ES|QL rules.
          - `index` ([] object)
            Indices on which the rule functions. Defaults to the Security Solution indices defined on the Kibana Advanced Settings page (Kibana → Stack Management → Advanced Settings → `securitySolution:defaultIndex`).
> info
> This field is not supported for ES|QL rules.
          - `tiebreaker_field` (string)
            Sets a secondary field for sorting events
          - `timestamp_field` (string)
            Specifies the name of the event timestamp field used for sorting a sequence of events. Not to be confused with `timestamp_override`, which specifies the more general field used for querying events within a range. Defaults to the @timestamp ECS field.
        - **QueryRule**
          - `actions` ([] object)
            Array defining the automated actions (notifications) taken when alerts are generated.
            Same fields as `actions` in `EqlRule`
          - `alias_purpose` (enum)
            Values: `savedObjectConversion`, `savedObjectImport`
          - `alias_target_id` (string)
          - `author` ([] object)
            The rule’s author.
          - `building_block_type` (string)
            Determines if the rule acts as a building block. If yes, the value must be `default`.
By default, building-block alerts are not displayed in the UI. These rules are used as a foundation for other rules that do generate alerts.
For more information, refer to [About building block rules](https://www.elastic.co/docs/solutions/security/detect-and-alert/about-building-block-rules).
          - `description` (string · min: 1)
            The rule’s description.
          - `enabled` (boolean)
            Determines whether the rule is enabled. Defaults to true.
          - `exceptions_list` ([] object)
            - `id` (string · min: 1)
              ID of the exception container
            - `list_id` (string · min: 1)
              List ID of the exception container
            - `namespace_type` (enum)
              Determines the exceptions validity in rule's Kibana space
              Values: `agnostic`, `single`
            - `type` (enum)
              The exception type
              Values: `detection`, `rule_default`, `endpoint`, `endpoint_trusted_apps`, `endpoint_trusted_devices`, `endpoint_events`, `endpoint_host_isolation_exceptions`, `endpoint_blocklists`
          - `false_positives` ([] object)
            String array used to describe common reasons why the rule may issue false-positive alerts. Defaults to an empty array.
          - `from` (string)
            Time from which data is analyzed each time the rule runs, using a date math range. For example, now-4200s means the rule analyzes data from 70 minutes before its start time. Defaults to now-6m (analyzes data from 6 minutes before the start time).
          - `interval` (string)
            Frequency of rule execution, using a date math range. For example, "1h" means the rule runs every hour. Defaults to 5m (5 minutes).
          - `investigation_fields` ({})
            Schema for fields relating to investigation fields. These are user defined fields we use to highlight
in various features in the UI such as alert details flyout and exceptions auto-population from alert.
            - `field_names` ([] string · min: 1)
          - `license` (string)
            The rule's license.
          - `max_signals` (integer · min: 1)
            Maximum number of alerts the rule can create during a single run (the rule’s Max alerts per run [advanced setting](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#rule-ui-advanced-params) value). Defaults to `100`.
> info
> This setting can be superseded by the [Kibana configuration setting](https://www.elastic.co/docs/reference/kibana/configuration-reference/alerting-settings) `xpack.alerting.rules.run.alerts.max`, which determines the maximum alerts generated by any rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, the rule can generate no more than 1000 alerts even if `max_signals` is set higher.
          - `meta` (object)
            Placeholder for metadata about the rule.
> info
> This field is overwritten when you save changes to the rule’s settings.
          - `name` (string · min: 1)
            A human-readable name for the rule.
          - `namespace` (string)
            Has no effect.
          - `note` (string)
            Notes to help investigate alerts produced by the rule.
          - `outcome` (enum)
            Values: `exactMatch`, `aliasMatch`, `conflict`
          - `output_index` (string) — deprecated
            (deprecated) Has no effect.
          - `references` ([] object)
            Array containing notes about or references to relevant information about the rule. Defaults to an empty array.
          - `related_integrations` ([] object)
            - `integration` (string · min: 1)
              A string that does not contain only whitespace characters
            - `package` (string · min: 1)
              A string that does not contain only whitespace characters
            - `version` (string · min: 1)
              A string that does not contain only whitespace characters
          - `required_fields` ([] object)
            Elasticsearch fields and their types that need to be present for the rule to function.
> info
> The value of `required_fields` does not affect the rule’s behavior, and specifying it incorrectly won’t cause the rule to fail. Use `required_fields` as an informational property to document the fields that the rule expects to be present in the data.
            - `name` (string · min: 1)
              Name of an Elasticsearch field
            - `type` (string · min: 1)
              Type of the Elasticsearch field
          - `response_actions` ([] union)
            Same options as `response_actions` in `EqlRule`
          - `risk_score` (integer · min: 0 · max: 100)
            A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
          - `risk_score_mapping` ([] object)
            Overrides generated alerts' risk_score with a value from the source event
            - `field` (string)
              Source event field used to override the default `risk_score`.
            - `operator` (enum)
              Values: `equals`
            - `risk_score` (integer · min: 0 · max: 100)
              A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
            - `value` (string)
          - `rule_name_override` (string)
            Sets which field in the source event is used to populate the alert's `signal.rule.name` value (in the UI, this value is displayed on the Rules page in the Rule column). When unspecified, the rule’s `name` value is used. The source field must be a string data type.
          - `setup` (string)
            Populates the rule’s setup guide with instructions on rule prerequisites such as required integrations, configuration steps, and anything else needed for the rule to work correctly.
          - `severity` (enum)
            Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
            Values: `low`, `medium`, `high`, `critical`
          - `severity_mapping` ([] object)
            Overrides generated alerts' severity with values from the source event
            - `field` (string)
              Source event field used to override the default `severity`.
            - `operator` (enum)
              Values: `equals`
            - `severity` (enum)
              Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
              Values: `low`, `medium`, `high`, `critical`
            - `value` (string)
          - `tags` ([] object)
            String array containing words and phrases to help categorize, filter, and search rules. Defaults to an empty array.
          - `threat` ([] object)
            Same fields as `threat` in `EqlRule`
          - `throttle` (union)
            Defines how often rule actions are taken.
            Values: `no_actions`, `rule`
          - `timeline_id` (string)
            Timeline template ID
          - `timeline_title` (string)
            Timeline template title
          - `timestamp_override` (string)
            Sets the time field used to query indices. When unspecified, rules query the `@timestamp` field. The source field must be an Elasticsearch date data type.
          - `timestamp_override_fallback_disabled` (boolean)
            Disables the fallback to the event's @timestamp field
          - `to` (string)
          - `version` (integer · min: 1)
            The rule's version number.

- For prebuilt rules it represents the version of the rule's content in the source [detection-rules](https://github.com/elastic/detection-rules) repository (and the corresponding `security_detection_engine` Fleet package that is used for distributing prebuilt rules). 
- For custom rules it is set to `1` when the rule is created. 
> info
> It is not incremented on each update. Compare this to the `revision` field.
          - `created_at` (string)
          - `created_by` (string)
          - `execution_summary` ({})
            Summary of the last execution of a rule.
> info
> This field is under development and its usage or schema may change
            Same fields as `execution_summary` in `EqlRule`
          - `id` (string)
            A universally unique identifier
          - `immutable` (boolean) — deprecated
            This field determines whether the rule is a prebuilt Elastic rule. It will be replaced with the `rule_source` field.
          - `revision` (integer · min: 0)
            The rule's revision number.

It represents the version of rule's object in Kibana. It is set to `0` when the rule is installed or created and then gets incremented on each update.
> info
> Not all updates to any rule fields will increment the revision. Only those fields that are considered static `rule parameters` can trigger revision increments. For example, an update to a rule's query or index fields will increment the rule's revision by `1`. However, changes to dynamic or technical fields like enabled or execution_summary will not cause revision increments.
          - `rule_id` (string)
            A stable unique identifier for the rule object. It can be assigned during rule creation. It can be any string, but often is a UUID. It should be unique not only within a given Kibana space, but also across spaces and Elastic environments. The same prebuilt Elastic rule, when installed in two different Kibana spaces or two different Elastic environments, will have the same `rule_id`s.
          - `rule_source` (union)
            Discriminated union that determines whether the rule is internally sourced (created within the Kibana app) or has an external source, such as the Elastic Prebuilt rules repo.
            - **ExternalRuleSource** (`type: external`)
              Type of rule source for externally sourced rules, i.e. rules that have an external source, such as the Elastic Prebuilt rules repo.
              - `customized_fields` ([] object)
                An array of customized field names — that is, fields that the user has modified from their base value. Defaults to an empty array.
                - `field_name` (string)
                  Name of a user-modified field in the rule object.
              - `has_base_version` (boolean)
                Determines whether an external/prebuilt rule has its original, unmodified version present when the calculation of its customization status is performed (`rule_source.is_customized` and `rule_source.customized_fields`).
              - `is_customized` (boolean)
                Determines whether an external/prebuilt rule has been customized by the user (i.e. any of its fields have been modified and diverged from the base value).
              - `type` (enum)
                Values: `external`
            - **InternalRuleSource** (`type: internal`)
              Type of rule source for internally sourced rules, i.e. created within the Kibana apps.
              - `type` (enum)
                Values: `internal`
          - `updated_at` (string)
          - `updated_by` (string)
          - `type` (enum)
            Rule type
            Values: `query`
          - `alert_suppression` ({})
            Defines alert suppression configuration.
            - `duration` ({})
              - `unit` (enum)
                Time unit
                Values: `s`, `m`, `h`
              - `value` (integer · min: 1)
            - `group_by` ([] object · min: 1 · max: 3)
            - `missing_fields_strategy` (enum)
              Describes how alerts will be generated for documents with missing suppress by fields:
doNotSuppress - per each document a separate alert will be created
suppress - only alert will be created per suppress by bucket
              Values: `doNotSuppress`, `suppress`
          - `data_view_id` (string)
          - `filters` ([] object)
            The query and filter context array used to define the conditions for when alerts are created from events. Defaults to an empty array.
> info
> This field is not supported for ES|QL rules.
          - `index` ([] object)
            Indices on which the rule functions. Defaults to the Security Solution indices defined on the Kibana Advanced Settings page (Kibana → Stack Management → Advanced Settings → `securitySolution:defaultIndex`).
> info
> This field is not supported for ES|QL rules.
          - `saved_id` (string)
            Kibana [saved search](https://www.elastic.co/docs/explore-analyze/discover/search-sessions) used by the rule to create alerts.
          - `language` (enum)
            Values: `kuery`, `lucene`
          - `query` (string)
            [Query](https://www.elastic.co/docs/explore-analyze/query-filter) used by the rule to create alerts.

- For indicator match rules, only the query’s results are used to determine whether an alert is generated.
- ES|QL rules have additional query requirements. Refer to [Create ES|QL](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#create-esql-rule) rules for more information.
        - **SavedQueryRule**
          - `actions` ([] object)
            Array defining the automated actions (notifications) taken when alerts are generated.
            Same fields as `actions` in `EqlRule`
          - `alias_purpose` (enum)
            Values: `savedObjectConversion`, `savedObjectImport`
          - `alias_target_id` (string)
          - `author` ([] object)
            The rule’s author.
          - `building_block_type` (string)
            Determines if the rule acts as a building block. If yes, the value must be `default`.
By default, building-block alerts are not displayed in the UI. These rules are used as a foundation for other rules that do generate alerts.
For more information, refer to [About building block rules](https://www.elastic.co/docs/solutions/security/detect-and-alert/about-building-block-rules).
          - `description` (string · min: 1)
            The rule’s description.
          - `enabled` (boolean)
            Determines whether the rule is enabled. Defaults to true.
          - `exceptions_list` ([] object)
            - `id` (string · min: 1)
              ID of the exception container
            - `list_id` (string · min: 1)
              List ID of the exception container
            - `namespace_type` (enum)
              Determines the exceptions validity in rule's Kibana space
              Values: `agnostic`, `single`
            - `type` (enum)
              The exception type
              Values: `detection`, `rule_default`, `endpoint`, `endpoint_trusted_apps`, `endpoint_trusted_devices`, `endpoint_events`, `endpoint_host_isolation_exceptions`, `endpoint_blocklists`
          - `false_positives` ([] object)
            String array used to describe common reasons why the rule may issue false-positive alerts. Defaults to an empty array.
          - `from` (string)
            Time from which data is analyzed each time the rule runs, using a date math range. For example, now-4200s means the rule analyzes data from 70 minutes before its start time. Defaults to now-6m (analyzes data from 6 minutes before the start time).
          - `interval` (string)
            Frequency of rule execution, using a date math range. For example, "1h" means the rule runs every hour. Defaults to 5m (5 minutes).
          - `investigation_fields` ({})
            Schema for fields relating to investigation fields. These are user defined fields we use to highlight
in various features in the UI such as alert details flyout and exceptions auto-population from alert.
            - `field_names` ([] string · min: 1)
          - `license` (string)
            The rule's license.
          - `max_signals` (integer · min: 1)
            Maximum number of alerts the rule can create during a single run (the rule’s Max alerts per run [advanced setting](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#rule-ui-advanced-params) value). Defaults to `100`.
> info
> This setting can be superseded by the [Kibana configuration setting](https://www.elastic.co/docs/reference/kibana/configuration-reference/alerting-settings) `xpack.alerting.rules.run.alerts.max`, which determines the maximum alerts generated by any rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, the rule can generate no more than 1000 alerts even if `max_signals` is set higher.
          - `meta` (object)
            Placeholder for metadata about the rule.
> info
> This field is overwritten when you save changes to the rule’s settings.
          - `name` (string · min: 1)
            A human-readable name for the rule.
          - `namespace` (string)
            Has no effect.
          - `note` (string)
            Notes to help investigate alerts produced by the rule.
          - `outcome` (enum)
            Values: `exactMatch`, `aliasMatch`, `conflict`
          - `output_index` (string) — deprecated
            (deprecated) Has no effect.
          - `references` ([] object)
            Array containing notes about or references to relevant information about the rule. Defaults to an empty array.
          - `related_integrations` ([] object)
            - `integration` (string · min: 1)
              A string that does not contain only whitespace characters
            - `package` (string · min: 1)
              A string that does not contain only whitespace characters
            - `version` (string · min: 1)
              A string that does not contain only whitespace characters
          - `required_fields` ([] object)
            Elasticsearch fields and their types that need to be present for the rule to function.
> info
> The value of `required_fields` does not affect the rule’s behavior, and specifying it incorrectly won’t cause the rule to fail. Use `required_fields` as an informational property to document the fields that the rule expects to be present in the data.
            - `name` (string · min: 1)
              Name of an Elasticsearch field
            - `type` (string · min: 1)
              Type of the Elasticsearch field
          - `response_actions` ([] union)
            Same options as `response_actions` in `EqlRule`
          - `risk_score` (integer · min: 0 · max: 100)
            A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
          - `risk_score_mapping` ([] object)
            Overrides generated alerts' risk_score with a value from the source event
            - `field` (string)
              Source event field used to override the default `risk_score`.
            - `operator` (enum)
              Values: `equals`
            - `risk_score` (integer · min: 0 · max: 100)
              A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
            - `value` (string)
          - `rule_name_override` (string)
            Sets which field in the source event is used to populate the alert's `signal.rule.name` value (in the UI, this value is displayed on the Rules page in the Rule column). When unspecified, the rule’s `name` value is used. The source field must be a string data type.
          - `setup` (string)
            Populates the rule’s setup guide with instructions on rule prerequisites such as required integrations, configuration steps, and anything else needed for the rule to work correctly.
          - `severity` (enum)
            Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
            Values: `low`, `medium`, `high`, `critical`
          - `severity_mapping` ([] object)
            Overrides generated alerts' severity with values from the source event
            - `field` (string)
              Source event field used to override the default `severity`.
            - `operator` (enum)
              Values: `equals`
            - `severity` (enum)
              Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
              Values: `low`, `medium`, `high`, `critical`
            - `value` (string)
          - `tags` ([] object)
            String array containing words and phrases to help categorize, filter, and search rules. Defaults to an empty array.
          - `threat` ([] object)
            Same fields as `threat` in `EqlRule`
          - `throttle` (union)
            Defines how often rule actions are taken.
            Values: `no_actions`, `rule`
          - `timeline_id` (string)
            Timeline template ID
          - `timeline_title` (string)
            Timeline template title
          - `timestamp_override` (string)
            Sets the time field used to query indices. When unspecified, rules query the `@timestamp` field. The source field must be an Elasticsearch date data type.
          - `timestamp_override_fallback_disabled` (boolean)
            Disables the fallback to the event's @timestamp field
          - `to` (string)
          - `version` (integer · min: 1)
            The rule's version number.

- For prebuilt rules it represents the version of the rule's content in the source [detection-rules](https://github.com/elastic/detection-rules) repository (and the corresponding `security_detection_engine` Fleet package that is used for distributing prebuilt rules). 
- For custom rules it is set to `1` when the rule is created. 
> info
> It is not incremented on each update. Compare this to the `revision` field.
          - `created_at` (string)
          - `created_by` (string)
          - `execution_summary` ({})
            Summary of the last execution of a rule.
> info
> This field is under development and its usage or schema may change
            Same fields as `execution_summary` in `EqlRule`
          - `id` (string)
            A universally unique identifier
          - `immutable` (boolean) — deprecated
            This field determines whether the rule is a prebuilt Elastic rule. It will be replaced with the `rule_source` field.
          - `revision` (integer · min: 0)
            The rule's revision number.

It represents the version of rule's object in Kibana. It is set to `0` when the rule is installed or created and then gets incremented on each update.
> info
> Not all updates to any rule fields will increment the revision. Only those fields that are considered static `rule parameters` can trigger revision increments. For example, an update to a rule's query or index fields will increment the rule's revision by `1`. However, changes to dynamic or technical fields like enabled or execution_summary will not cause revision increments.
          - `rule_id` (string)
            A stable unique identifier for the rule object. It can be assigned during rule creation. It can be any string, but often is a UUID. It should be unique not only within a given Kibana space, but also across spaces and Elastic environments. The same prebuilt Elastic rule, when installed in two different Kibana spaces or two different Elastic environments, will have the same `rule_id`s.
          - `rule_source` (union)
            Discriminated union that determines whether the rule is internally sourced (created within the Kibana app) or has an external source, such as the Elastic Prebuilt rules repo.
            - **ExternalRuleSource** (`type: external`)
              Type of rule source for externally sourced rules, i.e. rules that have an external source, such as the Elastic Prebuilt rules repo.
              - `customized_fields` ([] object)
                An array of customized field names — that is, fields that the user has modified from their base value. Defaults to an empty array.
                - `field_name` (string)
                  Name of a user-modified field in the rule object.
              - `has_base_version` (boolean)
                Determines whether an external/prebuilt rule has its original, unmodified version present when the calculation of its customization status is performed (`rule_source.is_customized` and `rule_source.customized_fields`).
              - `is_customized` (boolean)
                Determines whether an external/prebuilt rule has been customized by the user (i.e. any of its fields have been modified and diverged from the base value).
              - `type` (enum)
                Values: `external`
            - **InternalRuleSource** (`type: internal`)
              Type of rule source for internally sourced rules, i.e. created within the Kibana apps.
              - `type` (enum)
                Values: `internal`
          - `updated_at` (string)
          - `updated_by` (string)
          - `saved_id` (string)
            Kibana [saved search](https://www.elastic.co/docs/explore-analyze/discover/search-sessions) used by the rule to create alerts.
          - `type` (enum)
            Rule type
            Values: `saved_query`
          - `alert_suppression` ({})
            Defines alert suppression configuration.
            - `duration` ({})
              - `unit` (enum)
                Time unit
                Values: `s`, `m`, `h`
              - `value` (integer · min: 1)
            - `group_by` ([] object · min: 1 · max: 3)
            - `missing_fields_strategy` (enum)
              Describes how alerts will be generated for documents with missing suppress by fields:
doNotSuppress - per each document a separate alert will be created
suppress - only alert will be created per suppress by bucket
              Values: `doNotSuppress`, `suppress`
          - `data_view_id` (string)
          - `filters` ([] object)
            The query and filter context array used to define the conditions for when alerts are created from events. Defaults to an empty array.
> info
> This field is not supported for ES|QL rules.
          - `index` ([] object)
            Indices on which the rule functions. Defaults to the Security Solution indices defined on the Kibana Advanced Settings page (Kibana → Stack Management → Advanced Settings → `securitySolution:defaultIndex`).
> info
> This field is not supported for ES|QL rules.
          - `query` (string)
            [Query](https://www.elastic.co/docs/explore-analyze/query-filter) used by the rule to create alerts.

- For indicator match rules, only the query’s results are used to determine whether an alert is generated.
- ES|QL rules have additional query requirements. Refer to [Create ES|QL](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#create-esql-rule) rules for more information.
          - `language` (enum)
            Values: `kuery`, `lucene`
        - **ThresholdRule**
          - `actions` ([] object)
            Array defining the automated actions (notifications) taken when alerts are generated.
            Same fields as `actions` in `EqlRule`
          - `alias_purpose` (enum)
            Values: `savedObjectConversion`, `savedObjectImport`
          - `alias_target_id` (string)
          - `author` ([] object)
            The rule’s author.
          - `building_block_type` (string)
            Determines if the rule acts as a building block. If yes, the value must be `default`.
By default, building-block alerts are not displayed in the UI. These rules are used as a foundation for other rules that do generate alerts.
For more information, refer to [About building block rules](https://www.elastic.co/docs/solutions/security/detect-and-alert/about-building-block-rules).
          - `description` (string · min: 1)
            The rule’s description.
          - `enabled` (boolean)
            Determines whether the rule is enabled. Defaults to true.
          - `exceptions_list` ([] object)
            - `id` (string · min: 1)
              ID of the exception container
            - `list_id` (string · min: 1)
              List ID of the exception container
            - `namespace_type` (enum)
              Determines the exceptions validity in rule's Kibana space
              Values: `agnostic`, `single`
            - `type` (enum)
              The exception type
              Values: `detection`, `rule_default`, `endpoint`, `endpoint_trusted_apps`, `endpoint_trusted_devices`, `endpoint_events`, `endpoint_host_isolation_exceptions`, `endpoint_blocklists`
          - `false_positives` ([] object)
            String array used to describe common reasons why the rule may issue false-positive alerts. Defaults to an empty array.
          - `from` (string)
            Time from which data is analyzed each time the rule runs, using a date math range. For example, now-4200s means the rule analyzes data from 70 minutes before its start time. Defaults to now-6m (analyzes data from 6 minutes before the start time).
          - `interval` (string)
            Frequency of rule execution, using a date math range. For example, "1h" means the rule runs every hour. Defaults to 5m (5 minutes).
          - `investigation_fields` ({})
            Schema for fields relating to investigation fields. These are user defined fields we use to highlight
in various features in the UI such as alert details flyout and exceptions auto-population from alert.
            - `field_names` ([] string · min: 1)
          - `license` (string)
            The rule's license.
          - `max_signals` (integer · min: 1)
            Maximum number of alerts the rule can create during a single run (the rule’s Max alerts per run [advanced setting](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#rule-ui-advanced-params) value). Defaults to `100`.
> info
> This setting can be superseded by the [Kibana configuration setting](https://www.elastic.co/docs/reference/kibana/configuration-reference/alerting-settings) `xpack.alerting.rules.run.alerts.max`, which determines the maximum alerts generated by any rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, the rule can generate no more than 1000 alerts even if `max_signals` is set higher.
          - `meta` (object)
            Placeholder for metadata about the rule.
> info
> This field is overwritten when you save changes to the rule’s settings.
          - `name` (string · min: 1)
            A human-readable name for the rule.
          - `namespace` (string)
            Has no effect.
          - `note` (string)
            Notes to help investigate alerts produced by the rule.
          - `outcome` (enum)
            Values: `exactMatch`, `aliasMatch`, `conflict`
          - `output_index` (string) — deprecated
            (deprecated) Has no effect.
          - `references` ([] object)
            Array containing notes about or references to relevant information about the rule. Defaults to an empty array.
          - `related_integrations` ([] object)
            - `integration` (string · min: 1)
              A string that does not contain only whitespace characters
            - `package` (string · min: 1)
              A string that does not contain only whitespace characters
            - `version` (string · min: 1)
              A string that does not contain only whitespace characters
          - `required_fields` ([] object)
            Elasticsearch fields and their types that need to be present for the rule to function.
> info
> The value of `required_fields` does not affect the rule’s behavior, and specifying it incorrectly won’t cause the rule to fail. Use `required_fields` as an informational property to document the fields that the rule expects to be present in the data.
            - `name` (string · min: 1)
              Name of an Elasticsearch field
            - `type` (string · min: 1)
              Type of the Elasticsearch field
          - `response_actions` ([] union)
            Same options as `response_actions` in `EqlRule`
          - `risk_score` (integer · min: 0 · max: 100)
            A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
          - `risk_score_mapping` ([] object)
            Overrides generated alerts' risk_score with a value from the source event
            - `field` (string)
              Source event field used to override the default `risk_score`.
            - `operator` (enum)
              Values: `equals`
            - `risk_score` (integer · min: 0 · max: 100)
              A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
            - `value` (string)
          - `rule_name_override` (string)
            Sets which field in the source event is used to populate the alert's `signal.rule.name` value (in the UI, this value is displayed on the Rules page in the Rule column). When unspecified, the rule’s `name` value is used. The source field must be a string data type.
          - `setup` (string)
            Populates the rule’s setup guide with instructions on rule prerequisites such as required integrations, configuration steps, and anything else needed for the rule to work correctly.
          - `severity` (enum)
            Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
            Values: `low`, `medium`, `high`, `critical`
          - `severity_mapping` ([] object)
            Overrides generated alerts' severity with values from the source event
            - `field` (string)
              Source event field used to override the default `severity`.
            - `operator` (enum)
              Values: `equals`
            - `severity` (enum)
              Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
              Values: `low`, `medium`, `high`, `critical`
            - `value` (string)
          - `tags` ([] object)
            String array containing words and phrases to help categorize, filter, and search rules. Defaults to an empty array.
          - `threat` ([] object)
            Same fields as `threat` in `EqlRule`
          - `throttle` (union)
            Defines how often rule actions are taken.
            Values: `no_actions`, `rule`
          - `timeline_id` (string)
            Timeline template ID
          - `timeline_title` (string)
            Timeline template title
          - `timestamp_override` (string)
            Sets the time field used to query indices. When unspecified, rules query the `@timestamp` field. The source field must be an Elasticsearch date data type.
          - `timestamp_override_fallback_disabled` (boolean)
            Disables the fallback to the event's @timestamp field
          - `to` (string)
          - `version` (integer · min: 1)
            The rule's version number.

- For prebuilt rules it represents the version of the rule's content in the source [detection-rules](https://github.com/elastic/detection-rules) repository (and the corresponding `security_detection_engine` Fleet package that is used for distributing prebuilt rules). 
- For custom rules it is set to `1` when the rule is created. 
> info
> It is not incremented on each update. Compare this to the `revision` field.
          - `created_at` (string)
          - `created_by` (string)
          - `execution_summary` ({})
            Summary of the last execution of a rule.
> info
> This field is under development and its usage or schema may change
            Same fields as `execution_summary` in `EqlRule`
          - `id` (string)
            A universally unique identifier
          - `immutable` (boolean) — deprecated
            This field determines whether the rule is a prebuilt Elastic rule. It will be replaced with the `rule_source` field.
          - `revision` (integer · min: 0)
            The rule's revision number.

It represents the version of rule's object in Kibana. It is set to `0` when the rule is installed or created and then gets incremented on each update.
> info
> Not all updates to any rule fields will increment the revision. Only those fields that are considered static `rule parameters` can trigger revision increments. For example, an update to a rule's query or index fields will increment the rule's revision by `1`. However, changes to dynamic or technical fields like enabled or execution_summary will not cause revision increments.
          - `rule_id` (string)
            A stable unique identifier for the rule object. It can be assigned during rule creation. It can be any string, but often is a UUID. It should be unique not only within a given Kibana space, but also across spaces and Elastic environments. The same prebuilt Elastic rule, when installed in two different Kibana spaces or two different Elastic environments, will have the same `rule_id`s.
          - `rule_source` (union)
            Discriminated union that determines whether the rule is internally sourced (created within the Kibana app) or has an external source, such as the Elastic Prebuilt rules repo.
            - **ExternalRuleSource** (`type: external`)
              Type of rule source for externally sourced rules, i.e. rules that have an external source, such as the Elastic Prebuilt rules repo.
              - `customized_fields` ([] object)
                An array of customized field names — that is, fields that the user has modified from their base value. Defaults to an empty array.
                - `field_name` (string)
                  Name of a user-modified field in the rule object.
              - `has_base_version` (boolean)
                Determines whether an external/prebuilt rule has its original, unmodified version present when the calculation of its customization status is performed (`rule_source.is_customized` and `rule_source.customized_fields`).
              - `is_customized` (boolean)
                Determines whether an external/prebuilt rule has been customized by the user (i.e. any of its fields have been modified and diverged from the base value).
              - `type` (enum)
                Values: `external`
            - **InternalRuleSource** (`type: internal`)
              Type of rule source for internally sourced rules, i.e. created within the Kibana apps.
              - `type` (enum)
                Values: `internal`
          - `updated_at` (string)
          - `updated_by` (string)
          - `query` (string)
            [Query](https://www.elastic.co/docs/explore-analyze/query-filter) used by the rule to create alerts.

- For indicator match rules, only the query’s results are used to determine whether an alert is generated.
- ES|QL rules have additional query requirements. Refer to [Create ES|QL](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#create-esql-rule) rules for more information.
          - `threshold` ({})
            - `cardinality` ([] object)
              The field on which the cardinality is applied.
              - `field` (string)
                The field on which to calculate and compare the cardinality.
              - `value` (integer · min: 0)
                The threshold value from which an alert is generated based on unique number of values of cardinality.field.
            - `field` (union)
              The field on which the threshold is applied. If you specify an empty array ([]), alerts are generated when the query returns at least the number of results specified in the value field.
              One of: `string[]` or `string`
            - `value` (integer · min: 1)
              The threshold value from which an alert is generated.
          - `type` (enum)
            Rule type
            Values: `threshold`
          - `alert_suppression` ({})
            Defines alert suppression configuration.
            - `duration` ({})
              - `unit` (enum)
                Time unit
                Values: `s`, `m`, `h`
              - `value` (integer · min: 1)
          - `data_view_id` (string)
          - `filters` ([] object)
            The query and filter context array used to define the conditions for when alerts are created from events. Defaults to an empty array.
> info
> This field is not supported for ES|QL rules.
          - `index` ([] object)
            Indices on which the rule functions. Defaults to the Security Solution indices defined on the Kibana Advanced Settings page (Kibana → Stack Management → Advanced Settings → `securitySolution:defaultIndex`).
> info
> This field is not supported for ES|QL rules.
          - `saved_id` (string)
            Kibana [saved search](https://www.elastic.co/docs/explore-analyze/discover/search-sessions) used by the rule to create alerts.
          - `language` (enum)
            Values: `kuery`, `lucene`
        - **ThreatMatchRule**
          - `actions` ([] object)
            Array defining the automated actions (notifications) taken when alerts are generated.
            Same fields as `actions` in `EqlRule`
          - `alias_purpose` (enum)
            Values: `savedObjectConversion`, `savedObjectImport`
          - `alias_target_id` (string)
          - `author` ([] object)
            The rule’s author.
          - `building_block_type` (string)
            Determines if the rule acts as a building block. If yes, the value must be `default`.
By default, building-block alerts are not displayed in the UI. These rules are used as a foundation for other rules that do generate alerts.
For more information, refer to [About building block rules](https://www.elastic.co/docs/solutions/security/detect-and-alert/about-building-block-rules).
          - `description` (string · min: 1)
            The rule’s description.
          - `enabled` (boolean)
            Determines whether the rule is enabled. Defaults to true.
          - `exceptions_list` ([] object)
            - `id` (string · min: 1)
              ID of the exception container
            - `list_id` (string · min: 1)
              List ID of the exception container
            - `namespace_type` (enum)
              Determines the exceptions validity in rule's Kibana space
              Values: `agnostic`, `single`
            - `type` (enum)
              The exception type
              Values: `detection`, `rule_default`, `endpoint`, `endpoint_trusted_apps`, `endpoint_trusted_devices`, `endpoint_events`, `endpoint_host_isolation_exceptions`, `endpoint_blocklists`
          - `false_positives` ([] object)
            String array used to describe common reasons why the rule may issue false-positive alerts. Defaults to an empty array.
          - `from` (string)
            Time from which data is analyzed each time the rule runs, using a date math range. For example, now-4200s means the rule analyzes data from 70 minutes before its start time. Defaults to now-6m (analyzes data from 6 minutes before the start time).
          - `interval` (string)
            Frequency of rule execution, using a date math range. For example, "1h" means the rule runs every hour. Defaults to 5m (5 minutes).
          - `investigation_fields` ({})
            Schema for fields relating to investigation fields. These are user defined fields we use to highlight
in various features in the UI such as alert details flyout and exceptions auto-population from alert.
            - `field_names` ([] string · min: 1)
          - `license` (string)
            The rule's license.
          - `max_signals` (integer · min: 1)
            Maximum number of alerts the rule can create during a single run (the rule’s Max alerts per run [advanced setting](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#rule-ui-advanced-params) value). Defaults to `100`.
> info
> This setting can be superseded by the [Kibana configuration setting](https://www.elastic.co/docs/reference/kibana/configuration-reference/alerting-settings) `xpack.alerting.rules.run.alerts.max`, which determines the maximum alerts generated by any rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, the rule can generate no more than 1000 alerts even if `max_signals` is set higher.
          - `meta` (object)
            Placeholder for metadata about the rule.
> info
> This field is overwritten when you save changes to the rule’s settings.
          - `name` (string · min: 1)
            A human-readable name for the rule.
          - `namespace` (string)
            Has no effect.
          - `note` (string)
            Notes to help investigate alerts produced by the rule.
          - `outcome` (enum)
            Values: `exactMatch`, `aliasMatch`, `conflict`
          - `output_index` (string) — deprecated
            (deprecated) Has no effect.
          - `references` ([] object)
            Array containing notes about or references to relevant information about the rule. Defaults to an empty array.
          - `related_integrations` ([] object)
            - `integration` (string · min: 1)
              A string that does not contain only whitespace characters
            - `package` (string · min: 1)
              A string that does not contain only whitespace characters
            - `version` (string · min: 1)
              A string that does not contain only whitespace characters
          - `required_fields` ([] object)
            Elasticsearch fields and their types that need to be present for the rule to function.
> info
> The value of `required_fields` does not affect the rule’s behavior, and specifying it incorrectly won’t cause the rule to fail. Use `required_fields` as an informational property to document the fields that the rule expects to be present in the data.
            - `name` (string · min: 1)
              Name of an Elasticsearch field
            - `type` (string · min: 1)
              Type of the Elasticsearch field
          - `response_actions` ([] union)
            Same options as `response_actions` in `EqlRule`
          - `risk_score` (integer · min: 0 · max: 100)
            A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
          - `risk_score_mapping` ([] object)
            Overrides generated alerts' risk_score with a value from the source event
            - `field` (string)
              Source event field used to override the default `risk_score`.
            - `operator` (enum)
              Values: `equals`
            - `risk_score` (integer · min: 0 · max: 100)
              A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
            - `value` (string)
          - `rule_name_override` (string)
            Sets which field in the source event is used to populate the alert's `signal.rule.name` value (in the UI, this value is displayed on the Rules page in the Rule column). When unspecified, the rule’s `name` value is used. The source field must be a string data type.
          - `setup` (string)
            Populates the rule’s setup guide with instructions on rule prerequisites such as required integrations, configuration steps, and anything else needed for the rule to work correctly.
          - `severity` (enum)
            Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
            Values: `low`, `medium`, `high`, `critical`
          - `severity_mapping` ([] object)
            Overrides generated alerts' severity with values from the source event
            - `field` (string)
              Source event field used to override the default `severity`.
            - `operator` (enum)
              Values: `equals`
            - `severity` (enum)
              Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
              Values: `low`, `medium`, `high`, `critical`
            - `value` (string)
          - `tags` ([] object)
            String array containing words and phrases to help categorize, filter, and search rules. Defaults to an empty array.
          - `threat` ([] object)
            Same fields as `threat` in `EqlRule`
          - `throttle` (union)
            Defines how often rule actions are taken.
            Values: `no_actions`, `rule`
          - `timeline_id` (string)
            Timeline template ID
          - `timeline_title` (string)
            Timeline template title
          - `timestamp_override` (string)
            Sets the time field used to query indices. When unspecified, rules query the `@timestamp` field. The source field must be an Elasticsearch date data type.
          - `timestamp_override_fallback_disabled` (boolean)
            Disables the fallback to the event's @timestamp field
          - `to` (string)
          - `version` (integer · min: 1)
            The rule's version number.

- For prebuilt rules it represents the version of the rule's content in the source [detection-rules](https://github.com/elastic/detection-rules) repository (and the corresponding `security_detection_engine` Fleet package that is used for distributing prebuilt rules). 
- For custom rules it is set to `1` when the rule is created. 
> info
> It is not incremented on each update. Compare this to the `revision` field.
          - `created_at` (string)
          - `created_by` (string)
          - `execution_summary` ({})
            Summary of the last execution of a rule.
> info
> This field is under development and its usage or schema may change
            Same fields as `execution_summary` in `EqlRule`
          - `id` (string)
            A universally unique identifier
          - `immutable` (boolean) — deprecated
            This field determines whether the rule is a prebuilt Elastic rule. It will be replaced with the `rule_source` field.
          - `revision` (integer · min: 0)
            The rule's revision number.

It represents the version of rule's object in Kibana. It is set to `0` when the rule is installed or created and then gets incremented on each update.
> info
> Not all updates to any rule fields will increment the revision. Only those fields that are considered static `rule parameters` can trigger revision increments. For example, an update to a rule's query or index fields will increment the rule's revision by `1`. However, changes to dynamic or technical fields like enabled or execution_summary will not cause revision increments.
          - `rule_id` (string)
            A stable unique identifier for the rule object. It can be assigned during rule creation. It can be any string, but often is a UUID. It should be unique not only within a given Kibana space, but also across spaces and Elastic environments. The same prebuilt Elastic rule, when installed in two different Kibana spaces or two different Elastic environments, will have the same `rule_id`s.
          - `rule_source` (union)
            Discriminated union that determines whether the rule is internally sourced (created within the Kibana app) or has an external source, such as the Elastic Prebuilt rules repo.
            - **ExternalRuleSource** (`type: external`)
              Type of rule source for externally sourced rules, i.e. rules that have an external source, such as the Elastic Prebuilt rules repo.
              - `customized_fields` ([] object)
                An array of customized field names — that is, fields that the user has modified from their base value. Defaults to an empty array.
                - `field_name` (string)
                  Name of a user-modified field in the rule object.
              - `has_base_version` (boolean)
                Determines whether an external/prebuilt rule has its original, unmodified version present when the calculation of its customization status is performed (`rule_source.is_customized` and `rule_source.customized_fields`).
              - `is_customized` (boolean)
                Determines whether an external/prebuilt rule has been customized by the user (i.e. any of its fields have been modified and diverged from the base value).
              - `type` (enum)
                Values: `external`
            - **InternalRuleSource** (`type: internal`)
              Type of rule source for internally sourced rules, i.e. created within the Kibana apps.
              - `type` (enum)
                Values: `internal`
          - `updated_at` (string)
          - `updated_by` (string)
          - `query` (string)
            [Query](https://www.elastic.co/docs/explore-analyze/query-filter) used by the rule to create alerts.

- For indicator match rules, only the query’s results are used to determine whether an alert is generated.
- ES|QL rules have additional query requirements. Refer to [Create ES|QL](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#create-esql-rule) rules for more information.
          - `threat_index` ([] object)
            Elasticsearch indices used to check which field values generate alerts.
          - `threat_mapping` ([] object · min: 1)
            Array of entries objects that define mappings between the source event fields and the values in the Elasticsearch threat index. Each entries object must contain these fields:

- field: field from the event indices on which the rule runs
- type: must be mapping
- value: field from the Elasticsearch threat index
  
You can use Boolean and and or logic to define the conditions for when matching fields and values generate alerts. Sibling entries objects are evaluated using or logic, whereas multiple entries in a single entries object use and logic. See Example of Threat Match rule which uses both `and` and `or` logic.
            - `entries` ([] object)
              - `field` (string · min: 1)
                A string that does not contain only whitespace characters
              - `negate` (boolean)
              - `type` (enum)
                Values: `mapping`
              - `value` (string · min: 1)
                A string that does not contain only whitespace characters
          - `threat_query` (string)
            Query used to determine which fields in the Elasticsearch index are used for generating alerts.
          - `type` (enum)
            Rule type
            Values: `threat_match`
          - `alert_suppression` ({})
            Defines alert suppression configuration.
            - `duration` ({})
              - `unit` (enum)
                Time unit
                Values: `s`, `m`, `h`
              - `value` (integer · min: 1)
            - `group_by` ([] object · min: 1 · max: 3)
            - `missing_fields_strategy` (enum)
              Describes how alerts will be generated for documents with missing suppress by fields:
doNotSuppress - per each document a separate alert will be created
suppress - only alert will be created per suppress by bucket
              Values: `doNotSuppress`, `suppress`
          - `concurrent_searches` (integer · min: 1)
          - `data_view_id` (string)
          - `filters` ([] object)
            The query and filter context array used to define the conditions for when alerts are created from events. Defaults to an empty array.
> info
> This field is not supported for ES|QL rules.
          - `index` ([] object)
            Indices on which the rule functions. Defaults to the Security Solution indices defined on the Kibana Advanced Settings page (Kibana → Stack Management → Advanced Settings → `securitySolution:defaultIndex`).
> info
> This field is not supported for ES|QL rules.
          - `items_per_search` (integer · min: 1)
          - `saved_id` (string)
            Kibana [saved search](https://www.elastic.co/docs/explore-analyze/discover/search-sessions) used by the rule to create alerts.
          - `threat_filters` ([] object)
          - `threat_indicator_path` (string)
            Defines the path to the threat indicator in the indicator documents (optional)
          - `threat_language` (enum)
            Values: `kuery`, `lucene`
          - `language` (enum)
            Values: `kuery`, `lucene`
        - **MachineLearningRule**
          - `actions` ([] object)
            Array defining the automated actions (notifications) taken when alerts are generated.
            Same fields as `actions` in `EqlRule`
          - `alias_purpose` (enum)
            Values: `savedObjectConversion`, `savedObjectImport`
          - `alias_target_id` (string)
          - `author` ([] object)
            The rule’s author.
          - `building_block_type` (string)
            Determines if the rule acts as a building block. If yes, the value must be `default`.
By default, building-block alerts are not displayed in the UI. These rules are used as a foundation for other rules that do generate alerts.
For more information, refer to [About building block rules](https://www.elastic.co/docs/solutions/security/detect-and-alert/about-building-block-rules).
          - `description` (string · min: 1)
            The rule’s description.
          - `enabled` (boolean)
            Determines whether the rule is enabled. Defaults to true.
          - `exceptions_list` ([] object)
            - `id` (string · min: 1)
              ID of the exception container
            - `list_id` (string · min: 1)
              List ID of the exception container
            - `namespace_type` (enum)
              Determines the exceptions validity in rule's Kibana space
              Values: `agnostic`, `single`
            - `type` (enum)
              The exception type
              Values: `detection`, `rule_default`, `endpoint`, `endpoint_trusted_apps`, `endpoint_trusted_devices`, `endpoint_events`, `endpoint_host_isolation_exceptions`, `endpoint_blocklists`
          - `false_positives` ([] object)
            String array used to describe common reasons why the rule may issue false-positive alerts. Defaults to an empty array.
          - `from` (string)
            Time from which data is analyzed each time the rule runs, using a date math range. For example, now-4200s means the rule analyzes data from 70 minutes before its start time. Defaults to now-6m (analyzes data from 6 minutes before the start time).
          - `interval` (string)
            Frequency of rule execution, using a date math range. For example, "1h" means the rule runs every hour. Defaults to 5m (5 minutes).
          - `investigation_fields` ({})
            Schema for fields relating to investigation fields. These are user defined fields we use to highlight
in various features in the UI such as alert details flyout and exceptions auto-population from alert.
            - `field_names` ([] string · min: 1)
          - `license` (string)
            The rule's license.
          - `max_signals` (integer · min: 1)
            Maximum number of alerts the rule can create during a single run (the rule’s Max alerts per run [advanced setting](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#rule-ui-advanced-params) value). Defaults to `100`.
> info
> This setting can be superseded by the [Kibana configuration setting](https://www.elastic.co/docs/reference/kibana/configuration-reference/alerting-settings) `xpack.alerting.rules.run.alerts.max`, which determines the maximum alerts generated by any rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, the rule can generate no more than 1000 alerts even if `max_signals` is set higher.
          - `meta` (object)
            Placeholder for metadata about the rule.
> info
> This field is overwritten when you save changes to the rule’s settings.
          - `name` (string · min: 1)
            A human-readable name for the rule.
          - `namespace` (string)
            Has no effect.
          - `note` (string)
            Notes to help investigate alerts produced by the rule.
          - `outcome` (enum)
            Values: `exactMatch`, `aliasMatch`, `conflict`
          - `output_index` (string) — deprecated
            (deprecated) Has no effect.
          - `references` ([] object)
            Array containing notes about or references to relevant information about the rule. Defaults to an empty array.
          - `related_integrations` ([] object)
            - `integration` (string · min: 1)
              A string that does not contain only whitespace characters
            - `package` (string · min: 1)
              A string that does not contain only whitespace characters
            - `version` (string · min: 1)
              A string that does not contain only whitespace characters
          - `required_fields` ([] object)
            Elasticsearch fields and their types that need to be present for the rule to function.
> info
> The value of `required_fields` does not affect the rule’s behavior, and specifying it incorrectly won’t cause the rule to fail. Use `required_fields` as an informational property to document the fields that the rule expects to be present in the data.
            - `name` (string · min: 1)
              Name of an Elasticsearch field
            - `type` (string · min: 1)
              Type of the Elasticsearch field
          - `response_actions` ([] union)
            Same options as `response_actions` in `EqlRule`
          - `risk_score` (integer · min: 0 · max: 100)
            A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
          - `risk_score_mapping` ([] object)
            Overrides generated alerts' risk_score with a value from the source event
            - `field` (string)
              Source event field used to override the default `risk_score`.
            - `operator` (enum)
              Values: `equals`
            - `risk_score` (integer · min: 0 · max: 100)
              A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
            - `value` (string)
          - `rule_name_override` (string)
            Sets which field in the source event is used to populate the alert's `signal.rule.name` value (in the UI, this value is displayed on the Rules page in the Rule column). When unspecified, the rule’s `name` value is used. The source field must be a string data type.
          - `setup` (string)
            Populates the rule’s setup guide with instructions on rule prerequisites such as required integrations, configuration steps, and anything else needed for the rule to work correctly.
          - `severity` (enum)
            Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
            Values: `low`, `medium`, `high`, `critical`
          - `severity_mapping` ([] object)
            Overrides generated alerts' severity with values from the source event
            - `field` (string)
              Source event field used to override the default `severity`.
            - `operator` (enum)
              Values: `equals`
            - `severity` (enum)
              Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
              Values: `low`, `medium`, `high`, `critical`
            - `value` (string)
          - `tags` ([] object)
            String array containing words and phrases to help categorize, filter, and search rules. Defaults to an empty array.
          - `threat` ([] object)
            Same fields as `threat` in `EqlRule`
          - `throttle` (union)
            Defines how often rule actions are taken.
            Values: `no_actions`, `rule`
          - `timeline_id` (string)
            Timeline template ID
          - `timeline_title` (string)
            Timeline template title
          - `timestamp_override` (string)
            Sets the time field used to query indices. When unspecified, rules query the `@timestamp` field. The source field must be an Elasticsearch date data type.
          - `timestamp_override_fallback_disabled` (boolean)
            Disables the fallback to the event's @timestamp field
          - `to` (string)
          - `version` (integer · min: 1)
            The rule's version number.

- For prebuilt rules it represents the version of the rule's content in the source [detection-rules](https://github.com/elastic/detection-rules) repository (and the corresponding `security_detection_engine` Fleet package that is used for distributing prebuilt rules). 
- For custom rules it is set to `1` when the rule is created. 
> info
> It is not incremented on each update. Compare this to the `revision` field.
          - `created_at` (string)
          - `created_by` (string)
          - `execution_summary` ({})
            Summary of the last execution of a rule.
> info
> This field is under development and its usage or schema may change
            Same fields as `execution_summary` in `EqlRule`
          - `id` (string)
            A universally unique identifier
          - `immutable` (boolean) — deprecated
            This field determines whether the rule is a prebuilt Elastic rule. It will be replaced with the `rule_source` field.
          - `revision` (integer · min: 0)
            The rule's revision number.

It represents the version of rule's object in Kibana. It is set to `0` when the rule is installed or created and then gets incremented on each update.
> info
> Not all updates to any rule fields will increment the revision. Only those fields that are considered static `rule parameters` can trigger revision increments. For example, an update to a rule's query or index fields will increment the rule's revision by `1`. However, changes to dynamic or technical fields like enabled or execution_summary will not cause revision increments.
          - `rule_id` (string)
            A stable unique identifier for the rule object. It can be assigned during rule creation. It can be any string, but often is a UUID. It should be unique not only within a given Kibana space, but also across spaces and Elastic environments. The same prebuilt Elastic rule, when installed in two different Kibana spaces or two different Elastic environments, will have the same `rule_id`s.
          - `rule_source` (union)
            Discriminated union that determines whether the rule is internally sourced (created within the Kibana app) or has an external source, such as the Elastic Prebuilt rules repo.
            - **ExternalRuleSource** (`type: external`)
              Type of rule source for externally sourced rules, i.e. rules that have an external source, such as the Elastic Prebuilt rules repo.
              - `customized_fields` ([] object)
                An array of customized field names — that is, fields that the user has modified from their base value. Defaults to an empty array.
                - `field_name` (string)
                  Name of a user-modified field in the rule object.
              - `has_base_version` (boolean)
                Determines whether an external/prebuilt rule has its original, unmodified version present when the calculation of its customization status is performed (`rule_source.is_customized` and `rule_source.customized_fields`).
              - `is_customized` (boolean)
                Determines whether an external/prebuilt rule has been customized by the user (i.e. any of its fields have been modified and diverged from the base value).
              - `type` (enum)
                Values: `external`
            - **InternalRuleSource** (`type: internal`)
              Type of rule source for internally sourced rules, i.e. created within the Kibana apps.
              - `type` (enum)
                Values: `internal`
          - `updated_at` (string)
          - `updated_by` (string)
          - `anomaly_threshold` (integer · min: 0)
            Anomaly score threshold above which the rule creates an alert. Valid values are from 0 to 100.
          - `machine_learning_job_id` (union)
            Machine learning job ID(s) the rule monitors for anomaly scores.
            One of: `string[]` or `string`
          - `type` (enum)
            Rule type
            Values: `machine_learning`
          - `alert_suppression` ({})
            Defines alert suppression configuration.
            - `duration` ({})
              - `unit` (enum)
                Time unit
                Values: `s`, `m`, `h`
              - `value` (integer · min: 1)
            - `group_by` ([] object · min: 1 · max: 3)
            - `missing_fields_strategy` (enum)
              Describes how alerts will be generated for documents with missing suppress by fields:
doNotSuppress - per each document a separate alert will be created
suppress - only alert will be created per suppress by bucket
              Values: `doNotSuppress`, `suppress`
        - **NewTermsRule**
          - `actions` ([] object)
            Array defining the automated actions (notifications) taken when alerts are generated.
            Same fields as `actions` in `EqlRule`
          - `alias_purpose` (enum)
            Values: `savedObjectConversion`, `savedObjectImport`
          - `alias_target_id` (string)
          - `author` ([] object)
            The rule’s author.
          - `building_block_type` (string)
            Determines if the rule acts as a building block. If yes, the value must be `default`.
By default, building-block alerts are not displayed in the UI. These rules are used as a foundation for other rules that do generate alerts.
For more information, refer to [About building block rules](https://www.elastic.co/docs/solutions/security/detect-and-alert/about-building-block-rules).
          - `description` (string · min: 1)
            The rule’s description.
          - `enabled` (boolean)
            Determines whether the rule is enabled. Defaults to true.
          - `exceptions_list` ([] object)
            - `id` (string · min: 1)
              ID of the exception container
            - `list_id` (string · min: 1)
              List ID of the exception container
            - `namespace_type` (enum)
              Determines the exceptions validity in rule's Kibana space
              Values: `agnostic`, `single`
            - `type` (enum)
              The exception type
              Values: `detection`, `rule_default`, `endpoint`, `endpoint_trusted_apps`, `endpoint_trusted_devices`, `endpoint_events`, `endpoint_host_isolation_exceptions`, `endpoint_blocklists`
          - `false_positives` ([] object)
            String array used to describe common reasons why the rule may issue false-positive alerts. Defaults to an empty array.
          - `from` (string)
            Time from which data is analyzed each time the rule runs, using a date math range. For example, now-4200s means the rule analyzes data from 70 minutes before its start time. Defaults to now-6m (analyzes data from 6 minutes before the start time).
          - `interval` (string)
            Frequency of rule execution, using a date math range. For example, "1h" means the rule runs every hour. Defaults to 5m (5 minutes).
          - `investigation_fields` ({})
            Schema for fields relating to investigation fields. These are user defined fields we use to highlight
in various features in the UI such as alert details flyout and exceptions auto-population from alert.
            - `field_names` ([] string · min: 1)
          - `license` (string)
            The rule's license.
          - `max_signals` (integer · min: 1)
            Maximum number of alerts the rule can create during a single run (the rule’s Max alerts per run [advanced setting](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#rule-ui-advanced-params) value). Defaults to `100`.
> info
> This setting can be superseded by the [Kibana configuration setting](https://www.elastic.co/docs/reference/kibana/configuration-reference/alerting-settings) `xpack.alerting.rules.run.alerts.max`, which determines the maximum alerts generated by any rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, the rule can generate no more than 1000 alerts even if `max_signals` is set higher.
          - `meta` (object)
            Placeholder for metadata about the rule.
> info
> This field is overwritten when you save changes to the rule’s settings.
          - `name` (string · min: 1)
            A human-readable name for the rule.
          - `namespace` (string)
            Has no effect.
          - `note` (string)
            Notes to help investigate alerts produced by the rule.
          - `outcome` (enum)
            Values: `exactMatch`, `aliasMatch`, `conflict`
          - `output_index` (string) — deprecated
            (deprecated) Has no effect.
          - `references` ([] object)
            Array containing notes about or references to relevant information about the rule. Defaults to an empty array.
          - `related_integrations` ([] object)
            - `integration` (string · min: 1)
              A string that does not contain only whitespace characters
            - `package` (string · min: 1)
              A string that does not contain only whitespace characters
            - `version` (string · min: 1)
              A string that does not contain only whitespace characters
          - `required_fields` ([] object)
            Elasticsearch fields and their types that need to be present for the rule to function.
> info
> The value of `required_fields` does not affect the rule’s behavior, and specifying it incorrectly won’t cause the rule to fail. Use `required_fields` as an informational property to document the fields that the rule expects to be present in the data.
            - `name` (string · min: 1)
              Name of an Elasticsearch field
            - `type` (string · min: 1)
              Type of the Elasticsearch field
          - `response_actions` ([] union)
            Same options as `response_actions` in `EqlRule`
          - `risk_score` (integer · min: 0 · max: 100)
            A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
          - `risk_score_mapping` ([] object)
            Overrides generated alerts' risk_score with a value from the source event
            - `field` (string)
              Source event field used to override the default `risk_score`.
            - `operator` (enum)
              Values: `equals`
            - `risk_score` (integer · min: 0 · max: 100)
              A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
            - `value` (string)
          - `rule_name_override` (string)
            Sets which field in the source event is used to populate the alert's `signal.rule.name` value (in the UI, this value is displayed on the Rules page in the Rule column). When unspecified, the rule’s `name` value is used. The source field must be a string data type.
          - `setup` (string)
            Populates the rule’s setup guide with instructions on rule prerequisites such as required integrations, configuration steps, and anything else needed for the rule to work correctly.
          - `severity` (enum)
            Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
            Values: `low`, `medium`, `high`, `critical`
          - `severity_mapping` ([] object)
            Overrides generated alerts' severity with values from the source event
            - `field` (string)
              Source event field used to override the default `severity`.
            - `operator` (enum)
              Values: `equals`
            - `severity` (enum)
              Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
              Values: `low`, `medium`, `high`, `critical`
            - `value` (string)
          - `tags` ([] object)
            String array containing words and phrases to help categorize, filter, and search rules. Defaults to an empty array.
          - `threat` ([] object)
            Same fields as `threat` in `EqlRule`
          - `throttle` (union)
            Defines how often rule actions are taken.
            Values: `no_actions`, `rule`
          - `timeline_id` (string)
            Timeline template ID
          - `timeline_title` (string)
            Timeline template title
          - `timestamp_override` (string)
            Sets the time field used to query indices. When unspecified, rules query the `@timestamp` field. The source field must be an Elasticsearch date data type.
          - `timestamp_override_fallback_disabled` (boolean)
            Disables the fallback to the event's @timestamp field
          - `to` (string)
          - `version` (integer · min: 1)
            The rule's version number.

- For prebuilt rules it represents the version of the rule's content in the source [detection-rules](https://github.com/elastic/detection-rules) repository (and the corresponding `security_detection_engine` Fleet package that is used for distributing prebuilt rules). 
- For custom rules it is set to `1` when the rule is created. 
> info
> It is not incremented on each update. Compare this to the `revision` field.
          - `created_at` (string)
          - `created_by` (string)
          - `execution_summary` ({})
            Summary of the last execution of a rule.
> info
> This field is under development and its usage or schema may change
            Same fields as `execution_summary` in `EqlRule`
          - `id` (string)
            A universally unique identifier
          - `immutable` (boolean) — deprecated
            This field determines whether the rule is a prebuilt Elastic rule. It will be replaced with the `rule_source` field.
          - `revision` (integer · min: 0)
            The rule's revision number.

It represents the version of rule's object in Kibana. It is set to `0` when the rule is installed or created and then gets incremented on each update.
> info
> Not all updates to any rule fields will increment the revision. Only those fields that are considered static `rule parameters` can trigger revision increments. For example, an update to a rule's query or index fields will increment the rule's revision by `1`. However, changes to dynamic or technical fields like enabled or execution_summary will not cause revision increments.
          - `rule_id` (string)
            A stable unique identifier for the rule object. It can be assigned during rule creation. It can be any string, but often is a UUID. It should be unique not only within a given Kibana space, but also across spaces and Elastic environments. The same prebuilt Elastic rule, when installed in two different Kibana spaces or two different Elastic environments, will have the same `rule_id`s.
          - `rule_source` (union)
            Discriminated union that determines whether the rule is internally sourced (created within the Kibana app) or has an external source, such as the Elastic Prebuilt rules repo.
            - **ExternalRuleSource** (`type: external`)
              Type of rule source for externally sourced rules, i.e. rules that have an external source, such as the Elastic Prebuilt rules repo.
              - `customized_fields` ([] object)
                An array of customized field names — that is, fields that the user has modified from their base value. Defaults to an empty array.
                - `field_name` (string)
                  Name of a user-modified field in the rule object.
              - `has_base_version` (boolean)
                Determines whether an external/prebuilt rule has its original, unmodified version present when the calculation of its customization status is performed (`rule_source.is_customized` and `rule_source.customized_fields`).
              - `is_customized` (boolean)
                Determines whether an external/prebuilt rule has been customized by the user (i.e. any of its fields have been modified and diverged from the base value).
              - `type` (enum)
                Values: `external`
            - **InternalRuleSource** (`type: internal`)
              Type of rule source for internally sourced rules, i.e. created within the Kibana apps.
              - `type` (enum)
                Values: `internal`
          - `updated_at` (string)
          - `updated_by` (string)
          - `history_window_start` (string · min: 1)
            Start date to use when checking if a term has been seen before. Supports relative dates – for example, now-30d will search the last 30 days of data when checking if a term is new. We do not recommend using absolute dates, which can cause issues with rule performance due to querying increasing amounts of data over time.
          - `new_terms_fields` ([] object · min: 1 · max: 3)
            Fields to monitor for new values.
          - `query` (string)
            [Query](https://www.elastic.co/docs/explore-analyze/query-filter) used by the rule to create alerts.

- For indicator match rules, only the query’s results are used to determine whether an alert is generated.
- ES|QL rules have additional query requirements. Refer to [Create ES|QL](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#create-esql-rule) rules for more information.
          - `type` (enum)
            Rule type
            Values: `new_terms`
          - `alert_suppression` ({})
            Defines alert suppression configuration.
            - `duration` ({})
              - `unit` (enum)
                Time unit
                Values: `s`, `m`, `h`
              - `value` (integer · min: 1)
            - `group_by` ([] object · min: 1 · max: 3)
            - `missing_fields_strategy` (enum)
              Describes how alerts will be generated for documents with missing suppress by fields:
doNotSuppress - per each document a separate alert will be created
suppress - only alert will be created per suppress by bucket
              Values: `doNotSuppress`, `suppress`
          - `data_view_id` (string)
          - `filters` ([] object)
            The query and filter context array used to define the conditions for when alerts are created from events. Defaults to an empty array.
> info
> This field is not supported for ES|QL rules.
          - `index` ([] object)
            Indices on which the rule functions. Defaults to the Security Solution indices defined on the Kibana Advanced Settings page (Kibana → Stack Management → Advanced Settings → `securitySolution:defaultIndex`).
> info
> This field is not supported for ES|QL rules.
          - `language` (enum)
            Values: `kuery`, `lucene`
        - **EsqlRule**
          - `actions` ([] object)
            Array defining the automated actions (notifications) taken when alerts are generated.
            Same fields as `actions` in `EqlRule`
          - `alias_purpose` (enum)
            Values: `savedObjectConversion`, `savedObjectImport`
          - `alias_target_id` (string)
          - `author` ([] object)
            The rule’s author.
          - `building_block_type` (string)
            Determines if the rule acts as a building block. If yes, the value must be `default`.
By default, building-block alerts are not displayed in the UI. These rules are used as a foundation for other rules that do generate alerts.
For more information, refer to [About building block rules](https://www.elastic.co/docs/solutions/security/detect-and-alert/about-building-block-rules).
          - `description` (string · min: 1)
            The rule’s description.
          - `enabled` (boolean)
            Determines whether the rule is enabled. Defaults to true.
          - `exceptions_list` ([] object)
            - `id` (string · min: 1)
              ID of the exception container
            - `list_id` (string · min: 1)
              List ID of the exception container
            - `namespace_type` (enum)
              Determines the exceptions validity in rule's Kibana space
              Values: `agnostic`, `single`
            - `type` (enum)
              The exception type
              Values: `detection`, `rule_default`, `endpoint`, `endpoint_trusted_apps`, `endpoint_trusted_devices`, `endpoint_events`, `endpoint_host_isolation_exceptions`, `endpoint_blocklists`
          - `false_positives` ([] object)
            String array used to describe common reasons why the rule may issue false-positive alerts. Defaults to an empty array.
          - `from` (string)
            Time from which data is analyzed each time the rule runs, using a date math range. For example, now-4200s means the rule analyzes data from 70 minutes before its start time. Defaults to now-6m (analyzes data from 6 minutes before the start time).
          - `interval` (string)
            Frequency of rule execution, using a date math range. For example, "1h" means the rule runs every hour. Defaults to 5m (5 minutes).
          - `investigation_fields` ({})
            Schema for fields relating to investigation fields. These are user defined fields we use to highlight
in various features in the UI such as alert details flyout and exceptions auto-population from alert.
            - `field_names` ([] string · min: 1)
          - `license` (string)
            The rule's license.
          - `max_signals` (integer · min: 1)
            Maximum number of alerts the rule can create during a single run (the rule’s Max alerts per run [advanced setting](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#rule-ui-advanced-params) value). Defaults to `100`.
> info
> This setting can be superseded by the [Kibana configuration setting](https://www.elastic.co/docs/reference/kibana/configuration-reference/alerting-settings) `xpack.alerting.rules.run.alerts.max`, which determines the maximum alerts generated by any rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, the rule can generate no more than 1000 alerts even if `max_signals` is set higher.
          - `meta` (object)
            Placeholder for metadata about the rule.
> info
> This field is overwritten when you save changes to the rule’s settings.
          - `name` (string · min: 1)
            A human-readable name for the rule.
          - `namespace` (string)
            Has no effect.
          - `note` (string)
            Notes to help investigate alerts produced by the rule.
          - `outcome` (enum)
            Values: `exactMatch`, `aliasMatch`, `conflict`
          - `output_index` (string) — deprecated
            (deprecated) Has no effect.
          - `references` ([] object)
            Array containing notes about or references to relevant information about the rule. Defaults to an empty array.
          - `related_integrations` ([] object)
            - `integration` (string · min: 1)
              A string that does not contain only whitespace characters
            - `package` (string · min: 1)
              A string that does not contain only whitespace characters
            - `version` (string · min: 1)
              A string that does not contain only whitespace characters
          - `required_fields` ([] object)
            Elasticsearch fields and their types that need to be present for the rule to function.
> info
> The value of `required_fields` does not affect the rule’s behavior, and specifying it incorrectly won’t cause the rule to fail. Use `required_fields` as an informational property to document the fields that the rule expects to be present in the data.
            - `name` (string · min: 1)
              Name of an Elasticsearch field
            - `type` (string · min: 1)
              Type of the Elasticsearch field
          - `response_actions` ([] union)
            Same options as `response_actions` in `EqlRule`
          - `risk_score` (integer · min: 0 · max: 100)
            A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
          - `risk_score_mapping` ([] object)
            Overrides generated alerts' risk_score with a value from the source event
            - `field` (string)
              Source event field used to override the default `risk_score`.
            - `operator` (enum)
              Values: `equals`
            - `risk_score` (integer · min: 0 · max: 100)
              A numerical representation of the alert's severity from 0 to 100, where:
* `0` - `21` represents low severity
* `22` - `47` represents medium severity
* `48` - `73` represents high severity
* `74` - `100` represents critical severity
            - `value` (string)
          - `rule_name_override` (string)
            Sets which field in the source event is used to populate the alert's `signal.rule.name` value (in the UI, this value is displayed on the Rules page in the Rule column). When unspecified, the rule’s `name` value is used. The source field must be a string data type.
          - `setup` (string)
            Populates the rule’s setup guide with instructions on rule prerequisites such as required integrations, configuration steps, and anything else needed for the rule to work correctly.
          - `severity` (enum)
            Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
            Values: `low`, `medium`, `high`, `critical`
          - `severity_mapping` ([] object)
            Overrides generated alerts' severity with values from the source event
            - `field` (string)
              Source event field used to override the default `severity`.
            - `operator` (enum)
              Values: `equals`
            - `severity` (enum)
              Severity level of alerts produced by the rule, which must be one of the following:
* `low`: Alerts that are of interest but generally not considered to be security incidents
* `medium`: Alerts that require investigation
* `high`: Alerts that require immediate investigation
* `critical`: Alerts that indicate it is highly likely a security incident has occurred
              Values: `low`, `medium`, `high`, `critical`
            - `value` (string)
          - `tags` ([] object)
            String array containing words and phrases to help categorize, filter, and search rules. Defaults to an empty array.
          - `threat` ([] object)
            Same fields as `threat` in `EqlRule`
          - `throttle` (union)
            Defines how often rule actions are taken.
            Values: `no_actions`, `rule`
          - `timeline_id` (string)
            Timeline template ID
          - `timeline_title` (string)
            Timeline template title
          - `timestamp_override` (string)
            Sets the time field used to query indices. When unspecified, rules query the `@timestamp` field. The source field must be an Elasticsearch date data type.
          - `timestamp_override_fallback_disabled` (boolean)
            Disables the fallback to the event's @timestamp field
          - `to` (string)
          - `version` (integer · min: 1)
            The rule's version number.

- For prebuilt rules it represents the version of the rule's content in the source [detection-rules](https://github.com/elastic/detection-rules) repository (and the corresponding `security_detection_engine` Fleet package that is used for distributing prebuilt rules). 
- For custom rules it is set to `1` when the rule is created. 
> info
> It is not incremented on each update. Compare this to the `revision` field.
          - `created_at` (string)
          - `created_by` (string)
          - `execution_summary` ({})
            Summary of the last execution of a rule.
> info
> This field is under development and its usage or schema may change
            Same fields as `execution_summary` in `EqlRule`
          - `id` (string)
            A universally unique identifier
          - `immutable` (boolean) — deprecated
            This field determines whether the rule is a prebuilt Elastic rule. It will be replaced with the `rule_source` field.
          - `revision` (integer · min: 0)
            The rule's revision number.

It represents the version of rule's object in Kibana. It is set to `0` when the rule is installed or created and then gets incremented on each update.
> info
> Not all updates to any rule fields will increment the revision. Only those fields that are considered static `rule parameters` can trigger revision increments. For example, an update to a rule's query or index fields will increment the rule's revision by `1`. However, changes to dynamic or technical fields like enabled or execution_summary will not cause revision increments.
          - `rule_id` (string)
            A stable unique identifier for the rule object. It can be assigned during rule creation. It can be any string, but often is a UUID. It should be unique not only within a given Kibana space, but also across spaces and Elastic environments. The same prebuilt Elastic rule, when installed in two different Kibana spaces or two different Elastic environments, will have the same `rule_id`s.
          - `rule_source` (union)
            Discriminated union that determines whether the rule is internally sourced (created within the Kibana app) or has an external source, such as the Elastic Prebuilt rules repo.
            - **ExternalRuleSource** (`type: external`)
              Type of rule source for externally sourced rules, i.e. rules that have an external source, such as the Elastic Prebuilt rules repo.
              - `customized_fields` ([] object)
                An array of customized field names — that is, fields that the user has modified from their base value. Defaults to an empty array.
                - `field_name` (string)
                  Name of a user-modified field in the rule object.
              - `has_base_version` (boolean)
                Determines whether an external/prebuilt rule has its original, unmodified version present when the calculation of its customization status is performed (`rule_source.is_customized` and `rule_source.customized_fields`).
              - `is_customized` (boolean)
                Determines whether an external/prebuilt rule has been customized by the user (i.e. any of its fields have been modified and diverged from the base value).
              - `type` (enum)
                Values: `external`
            - **InternalRuleSource** (`type: internal`)
              Type of rule source for internally sourced rules, i.e. created within the Kibana apps.
              - `type` (enum)
                Values: `internal`
          - `updated_at` (string)
          - `updated_by` (string)
          - `alert_suppression` ({})
            Defines alert suppression configuration.
            - `duration` ({})
              - `unit` (enum)
                Time unit
                Values: `s`, `m`, `h`
              - `value` (integer · min: 1)
            - `group_by` ([] object · min: 1 · max: 3)
            - `missing_fields_strategy` (enum)
              Describes how alerts will be generated for documents with missing suppress by fields:
doNotSuppress - per each document a separate alert will be created
suppress - only alert will be created per suppress by bucket
              Values: `doNotSuppress`, `suppress`
          - `language` (enum)
            Values: `esql`
          - `query` (string)
            [Query](https://www.elastic.co/docs/explore-analyze/query-filter) used by the rule to create alerts.

- For indicator match rules, only the query’s results are used to determine whether an alert is generated.
- ES|QL rules have additional query requirements. Refer to [Create ES|QL](https://www.elastic.co/docs/solutions/security/detect-and-alert/create-detection-rule#create-esql-rule) rules for more information.
          - `type` (enum)
            Rule type
            Values: `esql`
      - `deleted` ([] union)
        Same options as `created` in `results`
      - `skipped` ([] object)
        - `id` (string)
        - `name` (string)
        - `skip_reason` (union BulkEditSkipReason | BulkGapsFillingSkipReason)
          Values: `RULE_NOT_MODIFIED`, `NO_GAPS_TO_FILL`
      - `updated` ([] union)
        Same options as `created` in `results`
    - `summary` ({})
      A rule can only be skipped when the bulk action to be performed on it results in nothing being done. For example, if the `edit` action is used to add a tag to a rule that already has that tag, or to delete an index pattern that is not specified in a rule. Objects returned in `attributes.results.skipped` will only include rules' `id`, `name`, and `skip_reason`.
      - `failed` (integer)
      - `skipped` (integer)
      - `succeeded` (integer)
      - `total` (integer)
  - `message` (string)
  - `rules_count` (integer)
  - `status_code` (integer)
  - `success` (boolean)
- **BulkExportActionResponse**
## Code Examples

#### Console

```console
POST /api/detection_engine/rules/_bulk_action
{
  "action": "enable",
  "query": "alert.attributes.tags: \u0022test\u0022"
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/detection_engine/rules/_bulk_action" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "enable",
  "query": "alert.attributes.tags: \u0022test\u0022"
}'
```

## Response Examples

#### Successful response

In this response one rule was updated and one was skipped. Objects returned in attributes.results.skipped will only include rules' id, name, and skip_reason.

```json
{
  "attributes": {
    "results": {
      "created": [],
      "deleted": [],
      "skipped": [
        {
          "id": "51658332-a15e-4c9e-912a-67214e2e2359",
          "name": "Skipped rule",
          "skip_reason": "RULE_NOT_MODIFIED"
        }
      ],
      "updated": [
        {
          "anomaly_threshold": 50,
          "author": [
            "Elastic"
          ],
          "created_at": "2022-02-21T14:14:13.801Z",
          "created_by": "elastic",
          "description": "A machine learning job detected unusually large numbers of DNS queries for a single top-level DNS domain, which is often used for DNS tunneling. DNS tunneling can be used for command-and-control, persistence, or data exfiltration activity. For example, dnscat tends to generate many DNS questions for a top-level domain as it uses the DNS protocol to tunnel data.",
          "enabled": true,
          "exceptions_list": [],
          "execution_summary": {
            "last_execution": {
              "date": "2022-03-23T16:06:12.787Z",
              "message": "This rule attempted to query data from Elasticsearch indices listed in the \u0022Index pattern\u0022 section of the rule definition, but no matching index was found.",
              "metrics": {
                "execution_gap_duration_s": 0,
                "total_indexing_duration_ms": 15,
                "total_search_duration_ms": 135
              },
              "status": "partial failure",
              "status_order": 20
            }
          },
          "false_positives": [
            "DNS domains that use large numbers of child domains, such as software or content distribution networks, can trigger this alert and such parent domains can be excluded."
          ],
          "from": "now-45m",
          "id": "8bc7dad0-9320-11ec-9265-8b772383a08d",
          "immutable": false,
          "interval": "15m",
          "license": "Elastic License v2",
          "machine_learning_job_id": [
            "dns_tunneling_ea"
          ],
          "max_signals": 100,
          "name": "DNS Tunneling [Duplicate]",
          "references": [
            "https://www.elastic.co/docs/reference/machine-learning/ootb-ml-jobs-siem"
          ],
          "related_integrations": [],
          "required_fields": [],
          "risk_score": 21,
          "risk_score_mapping": [],
          "rule_id": "7289bf08-4e91-4c70-bf01-e04c4c5d7756",
          "setup": "",
          "severity": "low",
          "severity_mapping": [],
          "tags": [
            "Elastic",
            "Network",
            "Threat Detection",
            "ML"
          ],
          "threat": [],
          "to": "now",
          "type": "machine_learning",
          "updated_at": "2022-02-21T17:05:50.883Z",
          "updated_by": "elastic",
          "version": 6
        }
      ]
    },
    "summary": {
      "failed": 0,
      "skipped": 1,
      "succeeded": 1,
      "total": 2
    }
  },
  "rules_count": 1,
  "success": true
}
```

#### Partial failure

If processing of any rule fails, a partial error outputs the ID and/or name of the affected rule and the corresponding error, as well as successfully processed rules (in the same format as a successful 200 request).

```json
{
  "value": {
    "attributes": {
      "errors": [
        {
          "message": "Index patterns can\u0027t be added. Machine learning rule doesn\u0027t have index patterns property",
          "rules": [
            {
              "id": "8bc7dad0-9320-11ec-9265-8b772383a08d",
              "name": "DNS Tunneling [Duplicate]"
            }
          ],
          "status_code": 500
        }
      ],
      "results": {
        "created": [],
        "deleted": [],
        "skipped": [],
        "updated": [
          {
            "actions": [],
            "author": [
              "Elastic"
            ],
            "created_at": "2022-02-21T14:14:17.883Z",
            "created_by": "elastic",
            "description": "Generates a detection alert for each external alert written to the configured indices. Enabling this rule allows you to immediately begin investigating external alerts in the app.",
            "enabled": true,
            "exceptions_list": [],
            "execution_summary": {
              "last_execution": {
                "date": "2022-03-23T16:06:12.787Z",
                "message": "This rule attempted to query data from Elasticsearch indices listed in the \u0022Index pattern\u0022 section of the rule definition, but no matching index was found.",
                "metrics": {
                  "execution_gap_duration_s": 0,
                  "total_indexing_duration_ms": 15,
                  "total_search_duration_ms": 135
                },
                "status": "partial failure",
                "status_order": 20
              }
            },
            "false_positives": [],
            "from": "now-6m",
            "id": "8e5c1a40-9320-11ec-9265-8b772383a08d",
            "immutable": false,
            "index": [
              "apm-*-transaction*",
              "traces-apm*",
              "auditbeat-*",
              "filebeat-*",
              "logs-*",
              "packetbeat-*",
              "winlogbeat-*",
              "added-by-id-*"
            ],
            "interval": "5m",
            "language": "kuery",
            "license": "Elastic License v2",
            "max_signals": 10000,
            "name": "External Alerts [Duplicate]",
            "query": "event.kind:alert and not event.module:(endgame or endpoint)\n",
            "references": [],
            "related_integrations": [],
            "required_fields": [],
            "risk_score": 47,
            "risk_score_mapping": [
              {
                "field": "event.risk_score",
                "operator": "equals",
                "value": ""
              }
            ],
            "rule_id": "941faf98-0cdc-4569-b16d-4af962914d61",
            "rule_name_override": "message",
            "setup": "",
            "severity": "medium",
            "severity_mapping": [
              {
                "field": "event.severity",
                "operator": "equals",
                "severity": "low",
                "value": "21"
              },
              {
                "field": "event.severity",
                "operator": "equals",
                "severity": "medium",
                "value": "47"
              },
              {
                "field": "event.severity",
                "operator": "equals",
                "severity": "high",
                "value": "73"
              },
              {
                "field": "event.severity",
                "operator": "equals",
                "severity": "critical",
                "value": "99"
              }
            ],
            "tags": [
              "Elastic",
              "Network",
              "Windows",
              "APM",
              "macOS",
              "Linux"
            ],
            "threat": [],
            "timestamp_override": "event.ingested",
            "to": "now",
            "type": "query",
            "updated_at": "2022-02-21T16:56:22.818Z",
            "updated_by": "elastic",
            "version": 5
          }
        ]
      },
      "summary": {
        "failed": 1,
        "skipped": 0,
        "succeeded": 1,
        "total": 2
      }
    },
    "message": "Bulk edit partially failed",
    "rules_count": 2,
    "status_code": 500,
    "success": false
  }
}
```

#### Dry run

The attributes.errors section of the response shows that two rules failed to update and one succeeded. The same results would be returned if you ran the request without dry run mode enabled. Notice that there are no arrays in attributes.results. In dry run mode, rule updates are not applied and saved to Elasticsearch, so the endpoint wouldn’t return results for rules that have been updated, created, or deleted.

```json
{
  "attributes": {
    "errors": [
      {
        "err_code": "IMMUTABLE",
        "message": "Elastic rule can\u0027t be edited",
        "rules": [
          {
            "id": "81aa0480-06af-11ed-94fb-dd1a0597d8d2",
            "name": "Unusual AWS Command for a User"
          }
        ],
        "status_code": 500
      },
      {
        "err_code": "MACHINE_LEARNING_INDEX_PATTERN",
        "message": "Machine learning rule doesn\u0027t have index patterns",
        "rules": [
          {
            "id": "dc015d10-0831-11ed-ac8b-05a222bd8d4a",
            "name": "Suspicious Powershell Script [Duplicate]"
          }
        ],
        "status_code": 500
      }
    ],
    "results": {
      "created": [],
      "deleted": [],
      "skipped": [],
      "updated": []
    },
    "summary": {
      "failed": 2,
      "skipped": 0,
      "succeeded": 1,
      "total": 3
    }
  },
  "message": "Bulk edit partially failed",
  "status_code": 500
}
```

#### Set tags successsully for 2 rules

This example presents the successful setting of tags for 2 rules. There was a difference between the set of tags that were being added and the tags that were already set in the rules, that's why the rules were updated.

```json
{
  "attributes": {
    "results": {
      "created": [],
      "deleted": [],
      "skipped": [],
      "updated": [
        {
          "actions": [],
          "author": [],
          "created_at": "2025-03-25T11:46:41.899Z",
          "created_by": "elastic",
          "description": "test",
          "enabled": false,
          "exceptions_list": [],
          "false_positives": [],
          "filters": [],
          "from": "now-6m",
          "id": "738112cd-6cfa-414a-8457-2a658845d6ba",
          "immutable": false,
          "index": [
            "apm-*-transaction*",
            "auditbeat-*",
            "endgame-*",
            "filebeat-*",
            "logs-*",
            "packetbeat-*",
            "traces-apm*",
            "winlogbeat-*",
            "-*elastic-cloud-logs-*"
          ],
          "interval": "5m",
          "language": "kuery",
          "license": "",
          "max_signals": 100,
          "meta": {
            "kibana_siem_app_url": "http://localhost:5601/kbn/app/security"
          },
          "name": "Rule 1",
          "output_index": "",
          "query": "*",
          "references": [],
          "related_integrations": [],
          "required_fields": [],
          "revision": 1,
          "risk_score": 21,
          "risk_score_mapping": [],
          "rule_id": "6fb746a0-dfe5-40fa-b03f-5cbb84f3e32e",
          "rule_source": {
            "type": "internal"
          },
          "setup": "",
          "severity": "low",
          "severity_mapping": [],
          "tags": [
            "tag-1",
            "tag-2"
          ],
          "threat": [],
          "to": "now",
          "type": "query",
          "updated_at": "2025-03-25T11:47:11.350Z",
          "updated_by": "elastic",
          "version": 2
        },
        {
          "actions": [
            {
              "action_type_id": ".webhook",
              "frequency": {
                "notifyWhen": "onActiveAlert",
                "summary": true,
                "throttle": "null"
              },
              "group": "default",
              "id": "20fbf986-a270-460e-80f3-7b83c08b430f",
              "params": {
                "body": "Hello"
              },
              "uuid": "580e2e16-5e91-411c-999b-7b75a11ed441"
            }
          ],
          "author": [],
          "created_at": "2025-03-25T09:49:08.343Z",
          "created_by": "elastic",
          "description": "test",
          "enabled": false,
          "exceptions_list": [],
          "false_positives": [],
          "filters": [],
          "from": "now-360s",
          "id": "eacdfc95-e007-41c9-986e-4b2cbdfdc71b",
          "immutable": false,
          "index": [
            "apm-*-transaction*",
            "auditbeat-*",
            "endgame-*",
            "filebeat-*",
            "logs-*",
            "packetbeat-*",
            "traces-apm*",
            "winlogbeat-*",
            "-*elastic-cloud-logs-*"
          ],
          "interval": "3m",
          "investigation_fields": {
            "field_names": [
              "alert.status",
              "Endpoint.policy.applied.artifacts.global.channel"
            ]
          },
          "language": "kuery",
          "license": "",
          "max_signals": 100,
          "meta": {
            "from": "3m",
            "kibana_siem_app_url": "http://localhost:5601/kbn/app/security"
          },
          "name": "Rule 2",
          "output_index": "",
          "query": "*",
          "references": [],
          "related_integrations": [],
          "required_fields": [],
          "revision": 33,
          "risk_score": 21,
          "risk_score_mapping": [],
          "rule_id": "43250a55-53a3-4ddd-96cb-82a1bd720180",
          "rule_source": {
            "type": "internal"
          },
          "setup": "",
          "severity": "low",
          "severity_mapping": [],
          "tags": [
            "tag-1",
            "tag-2"
          ],
          "threat": [],
          "timeline_id": "3e827bab-838a-469f-bd1e-5e19a2bff2fd",
          "timeline_title": "Alerts Involving a Single User Timeline",
          "to": "now",
          "type": "query",
          "updated_at": "2025-03-25T11:47:11.357Z",
          "updated_by": "elastic",
          "version": 24
        }
      ]
    },
    "summary": {
      "failed": 0,
      "skipped": 0,
      "succeeded": 2,
      "total": 2
    }
  },
  "rules_count": 2,
  "success": true
}
```

#### Idempotent behavior of set_tags

This example presents the idempotent behavior of the edit action with set_tags request. Both rules already had exactly the same tags that were being added, so no changes were made in any of them.

```json
{
  "attributes": {
    "results": {
      "created": [],
      "deleted": [],
      "skipped": [
        {
          "id": "eacdfc95-e007-41c9-986e-4b2cbdfdc71b",
          "name": "Rule 1",
          "skip_reason": "RULE_NOT_MODIFIED"
        },
        {
          "id": "738112cd-6cfa-414a-8457-2a658845d6ba",
          "name": "Rule 2",
          "skip_reason": "RULE_NOT_MODIFIED"
        }
      ],
      "updated": []
    },
    "summary": {
      "failed": 0,
      "skipped": 2,
      "succeeded": 0,
      "total": 2
    }
  },
  "rules_count": 2,
  "success": true
}
```

#### Idempotent behavior of add_tags

This example presents the idempotent behavior of the edit action with add_tags request. One rule was updated and one was skipped. The rule that was skipped already had all the tags that were being added.

```json
{
  "attributes": {
    "results": {
      "created": [],
      "deleted": [],
      "skipped": [
        {
          "id": "738112cd-6cfa-414a-8457-2a658845d6ba",
          "name": "Test Rule 2",
          "skip_reason": "RULE_NOT_MODIFIED"
        }
      ],
      "updated": [
        {
          "actions": [
            {
              "action_type_id": ".webhook",
              "frequency": {
                "notifyWhen": "onActiveAlert",
                "summary": true,
                "throttle": "null"
              },
              "group": "default",
              "id": "20fbf986-a270-460e-80f3-7b83c08b430f",
              "params": {
                "body": "Hello"
              },
              "uuid": "580e2e16-5e91-411c-999b-7b75a11ed441"
            }
          ],
          "author": [],
          "created_at": "2025-03-25T09:49:08.343Z",
          "created_by": "elastic",
          "description": "test",
          "enabled": false,
          "exceptions_list": [],
          "false_positives": [],
          "filters": [],
          "from": "now-360s",
          "id": "eacdfc95-e007-41c9-986e-4b2cbdfdc71b",
          "immutable": false,
          "index": [
            "apm-*-transaction*",
            "auditbeat-*",
            "endgame-*",
            "filebeat-*",
            "logs-*",
            "packetbeat-*",
            "traces-apm*",
            "winlogbeat-*",
            "-*elastic-cloud-logs-*"
          ],
          "interval": "3m",
          "investigation_fields": {
            "field_names": [
              "alert.status",
              "Endpoint.policy.applied.artifacts.global.channel"
            ]
          },
          "language": "kuery",
          "license": "",
          "max_signals": 100,
          "meta": {
            "from": "3m",
            "kibana_siem_app_url": "http://localhost:5601/kbn/app/security"
          },
          "name": "Test rule",
          "output_index": "",
          "query": "*",
          "references": [],
          "related_integrations": [],
          "required_fields": [],
          "revision": 34,
          "risk_score": 21,
          "risk_score_mapping": [],
          "rule_id": "43250a55-53a3-4ddd-96cb-82a1bd720180",
          "rule_source": {
            "type": "internal"
          },
          "setup": "",
          "severity": "low",
          "severity_mapping": [],
          "tags": [
            "tag-1",
            "tag-2",
            "tag-4"
          ],
          "threat": [],
          "timeline_id": "3e827bab-838a-469f-bd1e-5e19a2bff2fd",
          "timeline_title": "Alerts Involving a Single User Timeline",
          "to": "now",
          "type": "query",
          "updated_at": "2025-03-25T11:55:12.752Z",
          "updated_by": "elastic",
          "version": 25
        }
      ]
    },
    "summary": {
      "failed": 0,
      "skipped": 1,
      "succeeded": 1,
      "total": 2
    }
  },
  "rules_count": 2,
  "success": true
}
```

#### Non-idempotent behavior for set_rule_actions

This example shows a non-idempotent nature of the set_rule_actions requests. Regardless if the actions are the same as the existing actions for a rule, the actions are always set in the rule and receive a new unique ID.

```json
{
  "attributes": {
    "results": {
      "created": [],
      "deleted": [],
      "skipped": [],
      "updated": [
        {
          "actions": [
            {
              "action_type_id": ".webhook",
              "frequency": {
                "notifyWhen": "onActiveAlert",
                "summary": true,
                "throttle": "null"
              },
              "group": "default",
              "id": "20fbf986-a270-460e-80f3-7b83c08b430f",
              "params": {
                "body": "Hello"
              },
              "uuid": "e48428e5-efac-4856-b8ad-b271c14eaa91"
            }
          ],
          "author": [],
          "created_at": "2025-03-25T09:49:08.343Z",
          "created_by": "elastic",
          "description": "test",
          "enabled": false,
          "exceptions_list": [],
          "false_positives": [],
          "filters": [],
          "from": "now-360s",
          "id": "eacdfc95-e007-41c9-986e-4b2cbdfdc71b",
          "immutable": false,
          "index": [
            "apm-*-transaction*",
            "auditbeat-*",
            "endgame-*",
            "filebeat-*",
            "logs-*",
            "packetbeat-*",
            "traces-apm*",
            "winlogbeat-*",
            "-*elastic-cloud-logs-*"
          ],
          "interval": "3m",
          "investigation_fields": {
            "field_names": [
              "alert.status",
              "Endpoint.policy.applied.artifacts.global.channel"
            ]
          },
          "language": "kuery",
          "license": "",
          "max_signals": 100,
          "meta": {
            "from": "3m",
            "kibana_siem_app_url": "http://localhost:5601/kbn/app/security"
          },
          "name": "Test rule",
          "output_index": "",
          "query": "*",
          "references": [],
          "related_integrations": [],
          "required_fields": [],
          "revision": 39,
          "risk_score": 21,
          "risk_score_mapping": [],
          "rule_id": "43250a55-53a3-4ddd-96cb-82a1bd720180",
          "rule_source": {
            "type": "internal"
          },
          "setup": "",
          "severity": "low",
          "severity_mapping": [],
          "tags": [
            "tag-1",
            "tag-2",
            "tag-4"
          ],
          "threat": [],
          "timeline_id": "3e827bab-838a-469f-bd1e-5e19a2bff2fd",
          "timeline_title": "Alerts Involving a Single User Timeline",
          "to": "now",
          "type": "query",
          "updated_at": "2025-03-25T12:17:40.528Z",
          "updated_by": "elastic",
          "version": 30
        }
      ]
    },
    "summary": {
      "failed": 0,
      "skipped": 0,
      "succeeded": 1,
      "total": 1
    }
  },
  "rules_count": 1,
  "success": true
}
```

#### Non-idempotent behavior for add_rule_actions

This example shows a non-idempotent nature of the add_rule_actions requests. Regardless if the added action is the same as another existing action for a rule, the new action is added to the rule and receives a new unique ID.

```json
{
  "attributes": {
    "results": {
      "created": [],
      "deleted": [],
      "skipped": [],
      "updated": [
        {
          "actions": [
            {
              "action_type_id": ".webhook",
              "frequency": {
                "notifyWhen": "onActiveAlert",
                "summary": true,
                "throttle": "null"
              },
              "group": "default",
              "id": "76af173d-38d8-4a9a-b2cc-a3c695b845b4",
              "params": {
                "body": "Message body"
              },
              "uuid": "0309347e-3954-429c-9168-5da2663389af"
            },
            {
              "action_type_id": ".webhook",
              "frequency": {
                "notifyWhen": "onActiveAlert",
                "summary": true,
                "throttle": "null"
              },
              "group": "default",
              "id": "76af173d-38d8-4a9a-b2cc-a3c695b845b4",
              "params": {
                "body": "Message body"
              },
              "uuid": "49ddaa94-d63d-410e-90dc-8c1bad9552bd"
            }
          ],
          "author": [],
          "created_at": "2025-04-02T12:42:03.400Z",
          "created_by": "elastic",
          "description": "test",
          "enabled": false,
          "exceptions_list": [],
          "false_positives": [],
          "filters": [],
          "from": "now-6m",
          "id": "0d3eb0cd-88c4-4651-ac87-6d9f0cb87217",
          "immutable": false,
          "index": [
            "apm-*-transaction*",
            "auditbeat-*",
            "endgame-*",
            "filebeat-*",
            "logs-*",
            "packetbeat-*",
            "traces-apm*",
            "winlogbeat-*",
            "-*elastic-cloud-logs-*"
          ],
          "interval": "5m",
          "language": "kuery",
          "license": "",
          "max_signals": 100,
          "meta": {
            "kibana_siem_app_url": "http://localhost:5601/kbn/app/security"
          },
          "name": "Jacek test rule",
          "output_index": "",
          "query": "*",
          "references": [],
          "related_integrations": [],
          "required_fields": [],
          "revision": 2,
          "risk_score": 21,
          "risk_score_mapping": [],
          "rule_id": "2684c020-1370-4719-ac27-eafe6428fe10",
          "rule_source": {
            "type": "internal"
          },
          "setup": "",
          "severity": "low",
          "severity_mapping": [],
          "tags": [],
          "threat": [],
          "to": "now",
          "type": "query",
          "updated_at": "2025-04-02T12:51:40.215Z",
          "updated_by": "elastic",
          "version": 2
        }
      ]
    },
    "summary": {
      "failed": 0,
      "skipped": 0,
      "succeeded": 1,
      "total": 1
    }
  },
  "rules_count": 1,
  "success": true
}
```

