[role="xpack"]
[testenv="platinum"]
[[ml-update-filter]]
=== Update Filter API
++++
<titleabbrev>Update Filter</titleabbrev>
++++

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

==== Request

`POST _xpack/ml/filters/<filter_id>/_update`

//==== Description

==== Path Parameters

`filter_id` (required)::
		(string) Identifier for the filter.


==== Request Body

`description`::
  (string) A description for the filter. See <<ml-filter-resource>>.
	
`add_items`::
  (array of strings) The items to add to the filter.
	
`remove_items`::
  (array of strings) The items to remove from the filter.


==== Authorization

You must have `manage_ml`, or `manage` cluster privileges to use this API.
For more information, see
{xpack-ref}/security-privileges.html[Security Privileges].


==== Examples

You can change the description, add and remove items to the `safe_domains` filter as follows:

[source,js]
--------------------------------------------------
POST _xpack/ml/filters/safe_domains/_update
{
  "description": "Updated list of domains",
  "add_items": ["*.myorg.com"],
  "remove_items": ["wikipedia.org"]
}
--------------------------------------------------
// CONSOLE
// TEST[skip:setup:ml_filter_safe_domains]

The API returns the following results:

[source,js]
----
{
  "filter_id": "safe_domains",
  "description": "Updated list of domains",
  "items": ["*.google.com", "*.myorg.com"]
}
----
// TESTRESPONSE
