---
title: "Finalize detection alert migrations"
method: POST
path: "/api/detection_engine/signals/finalize_migration"
tags: ["Security Detections API"]
deprecated: true
---

# Finalize detection alert migrations

`POST /api/detection_engine/signals/finalize_migration`

> **Deprecated.**

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/detection_engine/signals/finalize_migration</span></div>

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

**DEPRECATED.** Completes a legacy alert index migration. Do not automate against this in new code.
**WARNING:** Finalizing swaps read aliases; confirm the migration has finished successfully before calling.

Finalize successful migrations of detection alerts. This replaces the original index's alias with the
successfully migrated index's alias. The endpoint is idempotent, so you can poll until a migration
finishes and then call this operation once.

## Request body

- object
  - `migration_ids` string[], required — Array of `migration_id`s to finalize.

## Response `200`

Successful response

- SecurityDetectionsAPIMigrationFinalizationResult[]
  - `completed` boolean, required
  - `destinationIndex` string, required
  - `error` object
    - `message` string, required
    - `status_code` integer, required
  - `id` string, required
  - `sourceIndex` string, required
  - `status` 'success' | 'failure' | 'pending', required
  - `updated` string, date-time, required
  - `version` string, required

## Other responses

- `400` — Invalid input data response
- `401` — Unsuccessful authentication response
- `500` — Internal server error response

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
