Delete role mappings
Generally available; Added in 5.5.0
Role mappings define which roles are assigned to each user. 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.
Required authorization
- Cluster privileges:
manage_security
Path parameters
-
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.
DELETE
/_security/role_mapping/{name}
Console
DELETE /_security/role_mapping/mapping1
resp = client.security.delete_role_mapping(
name="mapping1",
)
const response = await client.security.deleteRoleMapping({
name: "mapping1",
});
response = client.security.delete_role_mapping(
name: "mapping1"
)
$resp = $client->security()->deleteRoleMapping([
"name" => "mapping1",
]);
curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/role_mapping/mapping1"
Response examples (200)
A successful response from `DELETE /_security/role_mapping/mapping1`. If the mapping is successfully deleted, `found` is `true`.
{
"found" : true
}