delete-users.asciidoc 1.3 KB

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