[role="xpack"] [[data-stream-reindex-cancel-api]] === Reindex data stream cancel API ++++ Reindex data stream cancel ++++ .New API reference [sidebar] -- For the most up-to-date API details, refer to {api-es}/group/endpoint-migration[Migration APIs]. -- include::{es-ref-dir}/migration/apis/shared-migration-apis-tip.asciidoc[] Cancels a running data stream reindex task which was started by the <>. Any backing indices that have already been reindexed and swapped into the data stream will remain in the data stream. Only backing indices which are currently being reindexed, or pending backing indices which are still waiting to be reindexed, will be cancelled. Once a data stream reindex task is cancelled it will no longer be accessible through the <>. If a reindex task is not currently running this API will return `resource_not_found_exception`. /////////////////////////////////////////////////////////// [source,console] ------------------------------------------------------ POST _migration/reindex { "source": { "index": "my-data-stream" }, "mode": "upgrade" } ------------------------------------------------------ // TESTSETUP // TEST[setup:my_data_stream] /////////////////////////////////////////////////////////// [source,console] ---- POST _migration/reindex/my-data-stream/_cancel ---- // TEST[teardown:data_stream_cleanup] [[data-stream-reindex-cancel-request]] ==== {api-request-title} `GET /_migration/reindex//_cancel` [[data-stream-reindex-cancel-prereqs]] ==== {api-prereq-title} * If the {es} {security-features} are enabled, you must have the `manage` <> for the data stream. [[data-stream-reindex-cancel-path-params]] ==== {api-path-parms-title} ``:: (Required, string) Name of data stream to cancel reindexing.