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

52 lines
1.0 KiB
Plaintext

[role="xpack"]
[[security-api-delete-user]]
=== Delete users API
++++
<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