Bulk delete roles Added in 8.15.0
The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The bulk delete roles API cannot delete roles that are defined in roles files.
Query parameters
-
refresh string
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
curl \
-X DELETE http://api.example.com/_security/role \
-H "Content-Type: application/json" \
-d '{"names":["string"]}'
Request examples
{
"names": [
"string"
]
}
Response examples (200)
{
"deleted": [
"string"
],
"not_found": [
"string"
],
"errors": {
"count": 42.0,
"details": {
"*": {
"type": "string",
"reason": "string",
"stack_trace": "string",
"caused_by": {},
"root_cause": [
{}
],
"suppressed": [
{}
]
}
}
}
}