disable-users.asciidoc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. [role="xpack"]
  2. [[security-api-disable-user]]
  3. === Disable users API
  4. ++++
  5. <titleabbrev>Disable users</titleabbrev>
  6. ++++
  7. Disables users in the native realm.
  8. [[security-api-disable-user-request]]
  9. ==== {api-request-title}
  10. `PUT /_security/user/<username>/_disable`
  11. [[security-api-disable-user-prereqs]]
  12. ==== {api-prereq-title}
  13. * To use this API, you must have at least the `manage_security` cluster privilege.
  14. [[security-api-disable-user-desc]]
  15. ==== {api-description-title}
  16. By default, when you create users, they are enabled. You can use this API to
  17. revoke a user's access to {es}. To re-enable a user, there is an
  18. <<security-api-enable-user,enable users API>>.
  19. For more information about the native realm, see
  20. {stack-ov}/realms.html[Realms] and <<configuring-native-realm>>.
  21. [[security-api-disable-user-path-params]]
  22. ==== {api-path-parms-title}
  23. `username`::
  24. (Required, string) An identifier for the user.
  25. [[security-api-disable-user-example]]
  26. ==== {api-examples-title}
  27. The following example disables the user `jacknich`:
  28. [source,js]
  29. --------------------------------------------------
  30. PUT /_security/user/jacknich/_disable
  31. --------------------------------------------------
  32. // CONSOLE
  33. // TEST[setup:jacknich_user]