---
type: api
title: Create an alerts index
description: Creates an index for Elastic Security alerts. Calling this API is not
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-createalertsindex
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-createalertsindex
products:
  - Kibana
---

# Create an alerts index

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

## Paths

- `POST` `/api/detection_engine/index`

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

## Description

Creates an index for Elastic Security alerts. Calling this API is not
required for the detection engine to function properly. You can create
rules and alerts without calling this API.

## Responses

#### `200`

Successful response

`application/json`

- `acknowledged` (boolean)
#### `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
POST /api/detection_engine/index
```

#### curl

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

## Response Examples

#### Acknowledged

```json
{
  "acknowledged": true
}
```

#### 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 [POST /api/detection_engine/index] is unauthorized for the current user. The user must be able to create indices for the Elastic Security solution.",
  "status_code": 403
}
```

#### Not found

```json
{
  "message": "A prerequisite resource required to create the alerts index was not found.",
  "status_code": 404
}
```

#### Server error

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

