2018-08-18 02:17:33 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[[security-api-delete-user]]
|
|
|
|
=== Delete users API
|
2018-12-20 13:23:28 -05:00
|
|
|
++++
|
|
|
|
<titleabbrev>Delete users</titleabbrev>
|
|
|
|
++++
|
2018-08-18 02:17:33 -04:00
|
|
|
|
|
|
|
Deletes users from the native realm.
|
|
|
|
|
2019-08-02 13:56:05 -04:00
|
|
|
[[security-api-delete-user-request]]
|
|
|
|
==== {api-request-title}
|
2018-08-18 02:17:33 -04:00
|
|
|
|
2018-12-11 04:13:10 -05:00
|
|
|
`DELETE /_security/user/<username>`
|
2018-08-18 02:17:33 -04:00
|
|
|
|
2019-08-02 13:56:05 -04:00
|
|
|
[[security-api-delete-user-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
2018-08-18 02:17:33 -04:00
|
|
|
|
2019-08-02 13:56:05 -04:00
|
|
|
* To use this API, you must have at least the `manage_security` cluster privilege.
|
2018-08-18 02:17:33 -04:00
|
|
|
|
2019-08-02 13:56:05 -04:00
|
|
|
[[security-api-delete-user-desc]]
|
|
|
|
==== {api-description-title}
|
2018-08-18 02:17:33 -04:00
|
|
|
|
2019-08-02 13:56:05 -04:00
|
|
|
For more information about the native realm, see
|
2019-11-15 18:33:12 -05:00
|
|
|
<<realms>> and <<native-realm>>.
|
2018-08-18 02:17:33 -04:00
|
|
|
|
2019-08-02 13:56:05 -04:00
|
|
|
[[security-api-delete-user-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
2018-08-18 02:17:33 -04:00
|
|
|
|
2019-08-02 13:56:05 -04:00
|
|
|
`username`::
|
|
|
|
(Required, string) An identifier for the user.
|
2018-08-18 02:17:33 -04:00
|
|
|
|
|
|
|
|
2019-08-02 13:56:05 -04:00
|
|
|
[[security-api-delete-user-example]]
|
|
|
|
==== {api-examples-title}
|
2018-08-18 02:17:33 -04:00
|
|
|
|
|
|
|
The following example deletes the user `jacknich`:
|
|
|
|
|
2019-09-05 14:12:39 -04:00
|
|
|
[source,console]
|
2018-08-18 02:17:33 -04:00
|
|
|
--------------------------------------------------
|
2018-12-11 04:13:10 -05:00
|
|
|
DELETE /_security/user/jacknich
|
2018-08-18 02:17:33 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[setup:jacknich_user]
|
|
|
|
|
|
|
|
If the user is successfully deleted, the request returns `{"found": true}`.
|
|
|
|
Otherwise, `found` is set to false.
|
|
|
|
|
2019-09-05 14:12:39 -04:00
|
|
|
[source,console-result]
|
2018-08-18 02:17:33 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"found" : true
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|