---
type: api
title: Cleanup the Risk Engine
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-cleanupriskengine
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-cleanupriskengine
products:
  - Kibana
---

# Cleanup the Risk Engine

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

## Paths

- `DELETE` `/api/risk_score/engine/dangerously_delete_data`
- `DELETE` `/s/{space_id}/api/risk_score/engine/dangerously_delete_data`

## Description

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

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

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

- `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 kbn:/api/risk_score/engine/dangerously_delete_data
```

#### curl

```curl
curl -X DELETE "${KIBANA_URL}/api/risk_score/engine/dangerously_delete_data" \
  -H "Authorization: ApiKey ${API_KEY}"
```

