IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Delete roles API
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Delete roles API
editRemoves roles in the native realm.
Request
editDELETE /_security/role/<name>
Prerequisites
edit-
To use this API, you must have at least the
manage_securitycluster privilege.
Description
editThe role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The delete roles API cannot remove roles that are defined in roles files.
Path parameters
edit-
name - (string) The name of the role.
Examples
editThe following example deletes a my_admin_role role:
resp = client.security.delete_role(
name="my_admin_role",
)
print(resp)
const response = await client.security.deleteRole({
name: "my_admin_role",
});
console.log(response);
DELETE /_security/role/my_admin_role
If the role is successfully deleted, the request returns {"found": true}.
Otherwise, found is set to false.
{
"found" : true
}