Query parameters
-
If
true
(the default) then refresh the affected shards to make this operation visible to search, ifwait_for
then wait for a refresh to make this operation visible to search, iffalse
then do nothing with refreshes.Values are
true
,false
, orwait_for
.
DELETE /_security/role
Console
DELETE /_security/role { "names": ["my_admin_role", "my_user_role"] }
resp = client.security.bulk_delete_role( names=[ "my_admin_role", "my_user_role" ], )
const response = await client.security.bulkDeleteRole({ names: ["my_admin_role", "my_user_role"], });
response = client.security.bulk_delete_role( body: { "names": [ "my_admin_role", "my_user_role" ] } )
$resp = $client->security()->bulkDeleteRole([ "body" => [ "names" => array( "my_admin_role", "my_user_role", ), ], ]);
curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"names":["my_admin_role","my_user_role"]}' "$ELASTICSEARCH_URL/_security/role"
client.security().bulkDeleteRole(b -> b .names(List.of("my_admin_role","my_user_role")) );
Request example
Run DELETE /_security/role` to delete `my_admin_role` and `my_user_role` roles.
{ "names": ["my_admin_role", "my_user_role"] }
Response examples (200)
A successful response
A successful response from `DELETE /_security/role`.
{ "deleted": [ "my_admin_role", "my_user_role" ] }
A partially successful response from `DELETE /_security/role`. If a role cannot be found, it appears in the `not_found` list in the response.
{ "deleted": [ "my_admin_role" ], "not_found": [ "not_an_existing_role" ] }
A partially successful response from `DELETE /_security/role`. If part of a request fails or is invalid, the response includes `errors`.
{ "deleted": [ "my_admin_role" ], "errors": { "count": 1, "details": { "superuser": { "type": "illegal_argument_exception", "reason": "role [superuser] is reserved and cannot be deleted" } } } }