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 role mappings API
editDelete role mappings API
editRemoves role mappings.
Request
editDELETE /_security/role_mapping/<name>
Prerequisites
edit-
To use this API, you must have at least the
manage_security
cluster privilege.
Description
editRole mappings define which roles are assigned to each user. For more information, see Mapping users and groups to roles.
The role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files. The delete role mappings API cannot remove role mappings that are defined in role mapping files.
Path parameters
edit-
name
- (string) The distinct name that identifies the role mapping. The name is used solely as an identifier to facilitate interaction via the API; it does not affect the behavior of the mapping in any way.
Examples
editThe following example delete a role mapping:
resp = client.security.delete_role_mapping( name="mapping1", ) print(resp)
const response = await client.security.deleteRoleMapping({ name: "mapping1", }); console.log(response);
DELETE /_security/role_mapping/mapping1
If the mapping is successfully deleted, the request returns {"found": true}
.
Otherwise, found
is set to false.
{ "found" : true }