Delete snapshot API

Deletes a snapshot.

  1. DELETE /_snapshot/my_repository/my_snapshot

Request

DELETE /_snapshot/<repository>/<snapshot>

Description

Use the delete snapshot API to delete a snapshot, which is a backup taken from a running Elasticsearch cluster.

When deleting a snapshot from a repository, Elasticsearch deletes all files that are associated with the snapshot and not used by any other snapshots. All files that are shared with at least one other existing snapshot are left intact.

If you attempt to delete a snapshot while it is being created, the snapshot process aborts and all associated will be deleted.

To delete multiple snapshots in a single request, separate the snapshot names with a comma or use a wildcard (*).

Use the delete snapshot API to cancel long-running snapshot operations that were started by mistake.

Path parameters

<repository>

(Required, string) Name of the repository to delete a snapshot from.

<snapshot>

(Required, string) Comma-separated list of snapshot names to delete. Also accepts wildcards (*).

Example

The following request deletes snapshot_2 and snapshot_3 from the repository named my_repository.

  1. DELETE /_snapshot/my_repository/snapshot_2,snapshot_3

The API returns the following response:

  1. {
  2. "acknowledged" : true
  3. }