delete-users.asciidoc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. [role="xpack"]
  2. [[security-api-delete-user]]
  3. === Delete users API
  4. ++++
  5. <titleabbrev>Delete users</titleabbrev>
  6. ++++
  7. Deletes users from the native realm.
  8. [[security-api-delete-user-request]]
  9. ==== {api-request-title}
  10. `DELETE /_security/user/<username>`
  11. [[security-api-delete-user-prereqs]]
  12. ==== {api-prereq-title}
  13. * To use this API, you must have at least the `manage_security` cluster privilege.
  14. [[security-api-delete-user-desc]]
  15. ==== {api-description-title}
  16. For more information about the native realm, see
  17. <<realms>> and <<native-realm>>.
  18. [[security-api-delete-user-path-params]]
  19. ==== {api-path-parms-title}
  20. `username`::
  21. (Required, string) An identifier for the user.
  22. [[security-api-delete-user-example]]
  23. ==== {api-examples-title}
  24. The following example deletes the user `jacknich`:
  25. [source,console]
  26. --------------------------------------------------
  27. DELETE /_security/user/jacknich
  28. --------------------------------------------------
  29. // TEST[setup:jacknich_user]
  30. If the user is successfully deleted, the request returns `{"found": true}`.
  31. Otherwise, `found` is set to false.
  32. [source,console-result]
  33. --------------------------------------------------
  34. {
  35. "found" : true
  36. }
  37. --------------------------------------------------