---
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/4493/api/doc/kibana/v9/operation/operation-readprivileges
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/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`

## 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.

## 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>`

## 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 kbn:/api/detection_engine/privileges
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/detection_engine/privileges" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## 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
}
```

