[[reference-security-clear_api_key_cache]]

////////
===========================================================================================================================
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
||        ██████╗ ███████╗ █████╗ ██████╗ ███╗   ███╗███████╗                                                            ||
||        ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝                                                            ||
||        ██████╔╝█████╗  ███████║██║  ██║██╔████╔██║█████╗                                                              ||
||        ██╔══██╗██╔══╝  ██╔══██║██║  ██║██║╚██╔╝██║██╔══╝                                                              ||
||        ██║  ██║███████╗██║  ██║██████╔╝██║ ╚═╝ ██║███████╗                                                            ||
||        ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝ ╚═╝     ╚═╝╚══════╝                                                            ||
||                                                                                                                       ||
||                                                                                                                       ||
||    This file is autogenerated, DO NOT send pull requests that changes this file directly.                             ||
||    You should update the script that does the generation, which can be found in:                                      ||
||    https://github.com/elastic/elastic-client-generator-js                                                             ||
||                                                                                                                       ||
||    You can run the script with the following command:                                                                 ||
||       npm run elasticsearch -- --version <version>                                                                    ||
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
===========================================================================================================================
////////

[discrete]
[[client.security.clearApiKeyCache]]
=== client.security.clearApiKeyCache

Clear the API key cache. Evict a subset of all entries from the API key cache. The cache is also automatically cleared on state changes of the security index.

{ref}/security-api-clear-api-key-cache.html[{es} documentation]

[discrete]
==== Function signature

[source,ts]
----
(SecurityClearApiKeyCacheRequest, options?): Promise<SecurityClearApiKeyCacheResponse>
----

[discrete]
==== Request

[pass]
++++
<pre>
++++
interface SecurityClearApiKeyCacheRequest extends <<RequestBase>> {
  ids: <<Ids>>
}

[pass]
++++
</pre>
++++
[discrete]
==== Response

[pass]
++++
<pre>
++++
interface SecurityClearApiKeyCacheResponse {
  _nodes: <<NodeStatistics>>
  cluster_name: <<Name>>
  nodes: Record<string, <<SecurityClusterNode>>>
}

[pass]
++++
</pre>
++++
