clear-api-key-cache.asciidoc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. [role="xpack"]
  2. [[security-api-clear-api-key-cache]]
  3. === Clear API key cache API
  4. ++++
  5. <titleabbrev>Clear API key cache</titleabbrev>
  6. ++++
  7. Evicts a subset of all entries from the API key cache.
  8. The cache is also automatically cleared on state changes of the security index.
  9. [[security-api-clear-api-key-cache-request]]
  10. ==== {api-request-title}
  11. `POST /_security/api_key/<ids>/_clear_cache`
  12. [[security-api-clear-api-key-cache-prereqs]]
  13. ==== {api-prereq-title}
  14. * To use this API, you must have at least the `manage_security` cluster
  15. privilege.
  16. [[security-api-clear-api-key-cache-desc]]
  17. ==== {api-description-title}
  18. For more information about API keys, see <<security-api-create-api-key>>,
  19. <<security-api-get-api-key>>, and <<security-api-invalidate-api-key>>.
  20. [[security-api-clear-api-key-cache-path-params]]
  21. ==== {api-path-parms-title}
  22. `<ids>`::
  23. (Required, string)
  24. Comma-separated list of API key IDs to evict from the API key cache. To evict
  25. all API keys, use `*`. Does not support other wildcard patterns.
  26. [[security-api-clear-api-key-cache-example]]
  27. ==== {api-examples-title}
  28. The clear API key cache API evicts entries from the API key cache.
  29. For example, to clear the entry of API key with ID `yVGMr3QByxdh1MSaicYx`.
  30. [source,console]
  31. --------------------------------------------------
  32. POST /_security/api_key/yVGMr3QByxdh1MSaicYx/_clear_cache
  33. --------------------------------------------------
  34. Specify multiple API keys as a comma-separated list.
  35. [source,console]
  36. ----
  37. POST /_security/api_key/yVGMr3QByxdh1MSaicYx,YoiMaqREw0YVpjn40iMg/_clear_cache
  38. ----
  39. To clear all entries from the API key cache, use `*`.
  40. [source,console]
  41. ----
  42. POST /_security/api_key/*/_clear_cache
  43. ----