This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Clear privileges cache API
editClear privileges cache API
editEvicts privileges from the native application privilege cache. The cache is also automatically cleared for applications that have their privileges updated.
Request
editPOST /_security/privilege/<applications>/_clear_cache
Prerequisites
edit-
To use this API, you must have at least the
manage_security
cluster privilege.
Description
editFor more information about the native realm, see Realms and Native user authentication.
Path parameters
edit-
<applications>
-
(Required, string)
Comma-separated list of applications to clear. To clear all applications, use
*
. Does not support other wildcard patterns.
Examples
editThe clear privileges cache API evicts privileges from the native application privilege cache.
For example, to clear the cache for myapp
:
resp = client.security.clear_cached_privileges( application="myapp", ) print(resp)
const response = await client.security.clearCachedPrivileges({ application: "myapp", }); console.log(response);
POST /_security/privilege/myapp/_clear_cache
Specify multiple applications as a comma-separated list.
resp = client.security.clear_cached_privileges( application="myapp,my-other-app", ) print(resp)
const response = await client.security.clearCachedPrivileges({ application: "myapp,my-other-app", }); console.log(response);
POST /_security/privilege/myapp,my-other-app/_clear_cache
To clear the cache for all applications, use *
.
resp = client.security.clear_cached_privileges( application="*", ) print(resp)
const response = await client.security.clearCachedPrivileges({ application: "*", }); console.log(response);
POST /_security/privilege/*/_clear_cache