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.
|
|
|
|
|
|
|
|
==== Request
|
|
|
|
|
2018-12-11 04:13:10 -05:00
|
|
|
`DELETE /_security/user/<username>`
|
2018-08-18 02:17:33 -04:00
|
|
|
|
|
|
|
==== Description
|
|
|
|
|
|
|
|
For more information about the native realm, see
|
|
|
|
{stack-ov}/realms.html[Realms] and <<configuring-native-realm>>.
|
|
|
|
|
|
|
|
==== Path Parameters
|
|
|
|
|
|
|
|
`username` (required)::
|
|
|
|
(string) An identifier for the user.
|
|
|
|
|
|
|
|
//==== Request Body
|
|
|
|
|
|
|
|
==== Authorization
|
|
|
|
|
|
|
|
To use this API, you must have at least the `manage_security` cluster privilege.
|
|
|
|
|
|
|
|
|
|
|
|
==== Examples
|
|
|
|
|
|
|
|
The following example deletes the user `jacknich`:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2018-12-11 04:13:10 -05:00
|
|
|
DELETE /_security/user/jacknich
|
2018-08-18 02:17:33 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[setup:jacknich_user]
|
|
|
|
|
|
|
|
If the user is successfully deleted, the request returns `{"found": true}`.
|
|
|
|
Otherwise, `found` is set to false.
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"found" : true
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TESTRESPONSE
|