Update filter API

Updates the description of a filter, adds items, or removes items.

Request

POST _ml/filters/<filter_id>/_update

Prerequisites

Path parameters

<filter_id>

(Required, string) A string that uniquely identifies a filter.

Request body

add_items

(Optional, array of strings) The items to add to the filter.

description

(Optional, string) A description for the filter.

remove_items

(Optional, array of strings) The items to remove from the filter.

Examples

  1. POST _ml/filters/safe_domains/_update
  2. {
  3. "description": "Updated list of domains",
  4. "add_items": ["*.myorg.com"],
  5. "remove_items": ["wikipedia.org"]
  6. }

The API returns the following results:

  1. {
  2. "filter_id": "safe_domains",
  3. "description": "Updated list of domains",
  4. "items": ["*.google.com", "*.myorg.com"]
  5. }