Clear the API key cache Generally available; Added in 7.10.0

POST /_security/api_key/{ids}/_clear_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.

highlight#highlightFromAnchor" href="#topic-required-authorization"> Required authorization

  • Cluster privileges: manage_security

Path parameters

  • ids string | array[string] Required

    Comma-separated list of API key IDs to evict from the API key cache. To evict all API keys, use *. Does not support other wildcard patterns.

Responses

POST /_security/api_key/yVGMr3QByxdh1MSaicYx/_clear_cache
resp = client.security.clear_api_key_cache(
    ids="yVGMr3QByxdh1MSaicYx",
)
const response = await client.security.clearApiKeyCache({
  ids: "yVGMr3QByxdh1MSaicYx",
});
response = client.security.clear_api_key_cache(
  ids: "yVGMr3QByxdh1MSaicYx"
)
$resp = $client->security()->clearApiKeyCache([
    "ids" => "yVGMr3QByxdh1MSaicYx",
]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/api_key/yVGMr3QByxdh1MSaicYx/_clear_cache"
client.security().clearApiKeyCache(c -> c
    .ids("yVGMr3QByxdh1MSaicYx")
);