This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Delete users API
editDelete users API
editDeletes users from the native realm.
Request
editDELETE /_security/user/<username>
Prerequisites
edit-
To use this API, you must have at least the
manage_security
cluster privilege.
Description
editFor more information about the native realm, see Realms and Native user authentication.
Path parameters
edit-
username
- (Required, string) An identifier for the user.
Examples
editThe following example deletes the user jacknich
:
resp = client.security.delete_user( username="jacknich", ) print(resp)
const response = await client.security.deleteUser({ username: "jacknich", }); console.log(response);
DELETE /_security/user/jacknich
If the user is successfully deleted, the request returns {"found": true}
.
Otherwise, found
is set to false.
{ "found" : true }