---
type: api
title: Cleanup the Risk Engine
description: Cleaning up the the Risk Engine by removing the indices, mapping and transforms
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-cleanupriskengine
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-cleanupriskengine
products:
  - Kibana
---

# Cleanup the Risk Engine

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

## Paths

- `DELETE` `/api/risk_score/engine/dangerously_delete_data`

- [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

Cleaning up the the Risk Engine by removing the indices, mapping and transforms

## Responses

#### `200`

Successful response

`application/json`

- `cleanup_successful` (boolean)
#### `400`

Task manager is unavailable

`application/json`

- `message` (string)
- `status_code` (integer · min: 400)
#### `default`

Unexpected error

`application/json`

- `cleanup_successful` (boolean)
- `errors` ([] object)
  - `error` (string)
  - `seq` (integer)
## Code Examples

#### Console

```console
DELETE /api/risk_score/engine/dangerously_delete_data
```

#### curl

```curl
curl -X DELETE "https://{kibana_url}/api/risk_score/engine/dangerously_delete_data"
```

## Response Examples

#### Successful cleanup response

```json
{
  "cleanup_successful": true
}
```

#### Task manager is unavailable

```json
{
  "message": "Task Manager is unavailable, but is required by the risk engine. Please enable the taskManager plugin and try again.",
  "status_code": 400
}
```

#### Cleanup failed

```json
{
  "cleanup_successful": false,
  "errors": [
    {
      "error": "Risk engine is disabled or deleted already.",
      "seq": 1
    }
  ]
}
```

