---
type: api
title: Returns user privileges for the Kibana space
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-readprivileges
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-readprivileges
products:
  - Kibana
---

# Returns user privileges for the Kibana space

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

## Paths

- `GET` `/api/detection_engine/privileges`
- `GET` `/s/{space_id}/api/detection_engine/privileges`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#basicauth)

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Retrieves whether or not the user is authenticated, and the user's Kibana
space and index privileges, which determine if the user can create an
index for the Elastic Security alerts generated by
detection engine rules.

## Responses

#### `200`

Successful response

`application/json`

- `has_encryption_key` (boolean)
- `is_authenticated` (boolean)
#### `401`

Unsuccessful authentication response

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (integer)
#### `500`

Internal server error response

`application/json`

- `message` (string)
- `status_code` (integer)
## Code Examples

#### Console

```console
GET /api/detection_engine/privileges
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/detection_engine/privileges"
```

## Response Examples

#### Success

```json
{
  "application": {},
  "cluster": {
    "all": true,
    "manage": true,
    "manage_api_key": true,
    "manage_index_templates": true,
    "manage_ml": true,
    "manage_own_api_key": true,
    "manage_pipeline": true,
    "manage_security": true,
    "manage_transform": true,
    "monitor": true,
    "monitor_ml": true,
    "monitor_transform": true
  },
  "has_all_requested": true,
  "has_encryption_key": true,
  "index": {
    ".alerts-security.alerts-default": {
      "all": true,
      "create": true,
      "create_doc": true,
      "create_index": true,
      "delete": true,
      "delete_index": true,
      "index": true,
      "maintenance": true,
      "manage": true,
      "monitor": true,
      "read": true,
      "view_index_metadata": true,
      "write": true
    }
  },
  "is_authenticated": true,
  "username": "elastic"
}
```

#### Unauthorized

```json
{
  "error": "Unauthorized",
  "message": "[security_exception\n\tRoot causes:\n\t\tsecurity_exception: unable to authenticate user [elastic] for REST request [/_security/_authenticate]]: unable to authenticate user [elastic] for REST request [/_security/_authenticate]",
  "statusCode": 401
}
```

#### Server error

```json
{
  "message": "Internal Server Error",
  "status_code": 500
}
```

