---
type: api
title: Reads the alert index name if it exists
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-readalertsindex
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-readalertsindex
products:
  - Kibana
---

# Reads the alert index name if it exists

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

## Paths

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

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

## Description

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

Returns the backing Elasticsearch index for Elastic Security detection alerts in the current space, and
whether its mapping is outdated. Use this to verify that an alert index is provisioned before creating
or running rules that write alerts to it.

## Responses

#### `200`

Successful response

`application/json`

- `index_mapping_outdated` (boolean) — nullable
- `name` (string)
#### `401`

Unsuccessful authentication response

`application/json`

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

Not enough permissions response

`application/json`

- `message` (string)
- `status_code` (integer)
#### `404`

Not found

`application/json`

- `message` (string)
- `status_code` (integer)
#### `500`

Internal server error response

`application/json`

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

#### Console

```console
GET /api/detection_engine/index
```

#### curl

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

## Response Examples

#### Success

```json
{
  "index_mapping_outdated": false,
  "name": ".alerts-security.alerts-default"
}
```

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

#### Forbidden

```json
{
  "message": "API [GET /api/detection_engine/index] is unauthorized for the current user. Check Security and Kibana feature privileges (detection engine / alerts) for the space.",
  "status_code": 403
}
```

#### Not found

```json
{
  "message": "Elastic Security alert index is not found for the current space.",
  "status_code": 404
}
```

#### Server error

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

