---
title: "Get a role"
method: GET
path: "/api/security/role/{name}"
tags: ["roles"]
---

# Get a role

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

Retrieve a Kibana role by its name.

## Path parameters

- `name` string, required

## Query parameters

- `replaceDeprecatedPrivileges` boolean

## Response `200`

Indicates a successful call.

- KibanaHTTPAPIsSecurityRoleResponse — A Kibana role definition returned by the Roles API.
  - `_transform_error` KibanaHTTPAPIsSecurityRoleTransformError[]
    - `reason` string, required — The reason the role could not be fully transformed.
    - `state` KibanaHTTPAPIsSecurityRoleKibanaApplication[]
      - `application` string, required
      - `privileges` string[], required
      - `resources` string[], required
  - `_unrecognized_applications` string[]
  - `description` string — A description for the role.
  - `elasticsearch` KibanaHTTPAPIsSecurityRoleElasticsearch, required — The Elasticsearch cluster, index, and remote cluster security privileges for the role.
    - `cluster` string[]
    - `indices` KibanaHTTPAPIsSecurityRoleIndicesPrivileges[]
      - `allow_restricted_indices` boolean — Restricted indices are a special category of indices that are used internally to store configuration data and should not be directly accessed. Only internal system roles should normally grant privileges over the restricted indices. Toggling this flag is very strongly discouraged because it could effectively grant unrestricted operations on critical data, making the entire system unstable or leaking sensitive information. If for administrative purposes you need to create a role with privileges covering restricted indices, however, you can set this property to true. In that case, the names field covers the restricted indices too.
      - `field_security` object
      - `names` string[], required
      - `privileges` string[], required
      - `query` string — A search query that defines the documents the role members have read access to. A document within the specified data streams and indices must match this query in order for it to be accessible by the role members.
    - `remote_cluster` KibanaHTTPAPIsSecurityRoleRemoteClusterPrivileges[]
      - `clusters` string[], required
      - `privileges` string[], required
    - `remote_indices` KibanaHTTPAPIsSecurityRoleRemoteIndicesPrivileges[]
      - `allow_restricted_indices` boolean — Restricted indices are a special category of indices that are used internally to store configuration data and should not be directly accessed. Only internal system roles should normally grant privileges over the restricted indices. Toggling this flag is very strongly discouraged because it could effectively grant unrestricted operations on critical data, making the entire system unstable or leaking sensitive information. If for administrative purposes you need to create a role with privileges covering restricted indices, however, you can set this property to true. In that case, the names field will cover the restricted indices too.
      - `clusters` string[], required
      - `field_security` object
      - `names` string[], required
      - `privileges` string[], required
      - `query` string — A search query that defines the documents the role members have read access to. A document within the specified data streams and indices must match this query in order for it to be accessible by the role members.
    - `run_as` string[]
  - `kibana` KibanaHTTPAPIsSecurityRoleKibanaPrivilegeResponse[], required
    - `_reserved` string[]
    - `base` string[], required
    - `feature` object, required
    - `spaces` string[], required
  - `metadata` object
  - `name` string, required — The role name.
  - `transient_metadata` object

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
