Bulk delete roles

  • DELETE /_security/role
Auth

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.

Required authorization

Cluster privileges manage_security

Query parameters

refresh enum

If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.

Values: true false wait_for

Request body

names string[] required

An array of role names to delete

Response

application/json
deleted string[]

Array of deleted roles

not_found string[]

Array of roles that could not be found

errors object

Present if any deletes resulted in errors

count number required

The number of errors

details map string to object required

Details about the errors, keyed by role name

<string> object
type string required

The type of error

reason union string nullable

A human-readable explanation of the error, in English.

One of: string
stack_trace string

The server stack trace. Present only if the error_trace=true parameter was sent with the request.

caused_by object
root_cause object[]
suppressed object[]