---
type: api
title: Get a role
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-get-security-role-name
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-get-security-role-name
products:
  - Kibana
---

# Get a role

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/security/role/{name}`

#### Path parameters

- `name` (string · min length: 1) — required
  The role name.

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Query string parameters

- `replaceDeprecatedPrivileges` (boolean) — optional
  If `true` and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges.

## Response

Indicates a successful call.

`application/json`

## Code examples

#### Console

```console
GET kbn:/api/security/role/NAME
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/security/role/${NAME}" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### Get role details

```json
{
  "name": "my_kibana_role",
  "description": "Grants all cluster privileges and full access to index1 and index2. Grants full access to remote_index1 and remote_index2, and the monitor_enrich cluster privilege on remote_cluster1. Grants all Kibana privileges in the default space.",
  "metadata": {
    "version": 1
  },
  "transient_metadata": {
    "enabled": true
  },
  "elasticsearch": {
    "cluster": [
      "all"
    ],
    "remote_cluster": [
      {
        "privileges": [
          "monitor_enrich"
        ],
        "clusters": [
          "remote_cluster1"
        ]
      }
    ],
    "indices": [
      {
        "names": [
          "index1",
          "index2"
        ],
        "privileges": [
          "all"
        ],
        "allow_restricted_indices": false
      }
    ],
    "remote_indices": [
      {
        "names": [
          "remote_index1",
          "remote_index2"
        ],
        "privileges": [
          "all"
        ],
        "allow_restricted_indices": false,
        "clusters": [
          "remote_cluster1"
        ]
      }
    ],
    "run_as": []
  },
  "kibana": [
    {
      "base": [
        "all"
      ],
      "feature": {},
      "spaces": [
        "default"
      ]
    }
  ],
  "_transform_error": [],
  "_unrecognized_applications": []
}
```

