Query parameters

  • refreshstring

    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 are true, false, or wait_for.

application/json

BodyRequired

  • namesarray[string] Required

    An array of role names to delete

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • deletedarray[string]

      Array of deleted roles

    • not_foundarray[string]

      Array of roles that could not be found

    • errorsobject
      Hide errors attributes Show errors attributes object
      • countnumber Required

        The number of errors

      • detailsobject Required

        Details about the errors, keyed by role name

        Hide details attribute Show details attribute object
        • *object
          Hide * attributes Show * attributes object
          • typestring Required

            The type of error

          • reasonstring

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

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

          • caused_byobject
          • root_causearray[object]
          • suppressedarray[object]
DELETE /_security/role
curl \
 --request DELETE 'http://api.example.com/_security/role' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '"{\n  \"names\": [\"my_admin_role\", \"my_user_role\"]\n}"'
Request example
Run DELETE /_security/role` to delete `my_admin_role` and `my_user_role` roles.
{
  "names": ["my_admin_role", "my_user_role"]
}
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"
          }
      }
  }
}