[role="xpack"]
[[security-api-clear-privilege-cache]]
=== Clear privileges cache API
++++
<titleabbrev>Clear privileges cache</titleabbrev>
++++

Evicts privileges from the native application privilege cache.
The cache is also automatically cleared for applications that have their privileges updated.

[[security-api-clear-privilege-cache-request]]
==== {api-request-title}

`POST /_security/privilege/<applications>/_clear_cache`

[[security-api-clear-privilege-cache-prereqs]]
==== {api-prereq-title}

* To use this API, you must have at least the `manage_security` cluster
privilege.

[[security-api-clear-privilege-cache-desc]]
==== {api-description-title}

For more information about the native realm, see
<<realms>> and <<native-realm>>.

[[security-api-clear-privilege-cache-path-params]]
==== {api-path-parms-title}

`<applications>`::
(Required, string)
Comma-separated list of applications to clear. To clear all applications, use
`*`. Does not support other wildcard patterns.

[[security-api-clear-privilege-cache-example]]
==== {api-examples-title}

The clear privileges cache API evicts privileges from the native application privilege cache.
For example, to clear the cache for `myapp`:

[source,console]
--------------------------------------------------
POST /_security/privilege/myapp/_clear_cache
--------------------------------------------------

Specify multiple applications as a comma-separated list.

[source,console]
--------------------------------------------------
POST /_security/privilege/myapp,my-other-app/_clear_cache
--------------------------------------------------

To clear the cache for all applications, use `*`.

[source,console]
----
POST /_security/privilege/*/_clear_cache
----
