---
type: api
title: Finalize detection alert migrations
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-finalizealertsmigration
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-finalizealertsmigration
products:
  - Kibana
---

# Finalize detection alert migrations

deprecated

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

## Paths

- `POST` `/api/detection_engine/signals/finalize_migration`
- `POST` `/s/{space_id}/api/detection_engine/signals/finalize_migration`

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

## Description

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

Finalize successful migrations of detection alerts. This replaces the original index's alias with the successfully migrated index's alias.
The endpoint is idempotent; therefore, it can safely be used to poll a given migration and, upon completion,
finalize it.

## Request Body

`application/json`

Array of `migration_id`s to finalize

- `migration_ids` ([] string · min: 1) — required

## Responses

#### `200`

Successful response

`application/json`

Type: `[] object`

- `completed` (boolean)
- `destinationIndex` (string)
- `error` (object)
  - `message` (string)
  - `status_code` (integer)
- `id` (string)
- `sourceIndex` (string)
- `status` (enum)
  Values: `success`, `failure`, `pending`
- `updated` (string)
- `version` (string)
#### `400`

Invalid input data response

`application/json`

One of:
- **PlatformErrorResponse**
  - `error` (string)
  - `message` (string)
  - `statusCode` (integer)
- **SiemErrorResponse**
  - `message` (string)
  - `status_code` (integer)
#### `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
POST /api/detection_engine/signals/finalize_migration
```

#### curl

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

