OpenSearch/x-pack/docs/en/rest-api/security/delete-users.asciidoc

52 lines
1.0 KiB
Plaintext
Raw Normal View History

[role="xpack"]
[[security-api-delete-user]]
=== Delete users API
2018-12-20 13:23:28 -05:00
++++
<titleabbrev>Delete users</titleabbrev>
++++
Deletes users from the native realm.
==== Request
`DELETE /_security/user/<username>`
==== 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]
--------------------------------------------------
DELETE /_security/user/jacknich
--------------------------------------------------
// 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