Get all Kibana roles API

[experimental] This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features. Retrieve all Kibana roles.

Prerequisite

To use the get role API, you must have the manage_security cluster privilege.

Request

GET <kibana host>:<port>/api/security/role

Response code

200
Indicates a successful call.

Example

The API returns the following:

[
  {
    "name": "my_kibana_role",
    "metadata" : {
      "version" : 1
    },
    "transient_metadata": {
      "enabled": true
    },
    "elasticsearch": {
      "indices": [ ],
      "cluster": [ ],
      "run_as": [ ]
    },
    "kibana": [{
      "base": [
        "all"
      ],
      "feature": {},
      "spaces": [
        "*"
      ]
    }]
  },
  {
    "name": "my_admin_role",
    "metadata" : {
      "version" : 1
    },
    "transient_metadata": {
      "enabled": true
    },
    "elasticsearch": {
      "cluster" : [ "all" ],
      "indices" : [ {
        "names" : [ "index1", "index2" ],
        "privileges" : [ "all" ],
        "field_security" : {
          "grant" : [ "title", "body" ]
        },
        "query" : "{\"match\": {\"title\": \"foo\"}}"
      } ],
    },
    "kibana": [ ]
  }
]