Create snapshot APIedit

Takes a snapshot of a cluster or specified data streams and indices.

PUT /_snapshot/my_repository/my_snapshot


PUT /_snapshot/<repository>/<snapshot>

POST /_snapshot/<repository>/<snapshot>


  • If the Elasticsearch security features are enabled, you must have the create_snapshot or manage cluster privilege to use this API.

Path parametersedit

(Required, string) Name of the snapshot repository.
(Required, string) Name of the snapshot. Supports date math. Must be unique within the snapshot repository.

Query parametersedit

(Optional, time units) Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s.
(Optional, Boolean) If true, the request returns a response when the snapshot is complete. If false, the request returns a response when the snapshot initializes. Defaults to false.

Request bodyedit


(Optional, string) Determines how wildcard patterns in the indices parameter match data streams and indices. Supports comma-separated values, such as closed,hidden. Defaults to open,hidden. Valid values are:

Match any data stream or index, including hidden ones.
Match open indices and data streams.
Match closed indices and data streams.
Match hidden data streams and indices. Must be combined with open, closed, or both.
Don’t expand wildcard patterns.
(Optional, Boolean) If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices. Defaults to false.

(Optional, Boolean) If true, include the cluster state in the snapshot. Defaults to true. The cluster state includes:


(Optional, string or array of strings) Comma-separated list of data streams and indices to include in the snapshot. Supports multi-index syntax. Defaults to an empty array ([]), which includes all data streams and indices, including system indices.

To exclude all data streams and indices, use -*.


(Optional, array of strings) Feature states to include in the snapshot. To get a list of possible values and their descriptions, use the get features API.

If include_global_state is true, the snapshot includes all feature states by default. If include_global_state is false, the snapshot includes no feature states by default.

To exclude all feature states, regardless of the include_global_state value, specify an empty array ([]) or none.

(Optional, object) Attaches arbitrary metadata to the snapshot, such as a record of who took the snapshot, why it was taken, or any other useful data. Metadata must be less than 1024 bytes.

(Optional, Boolean) If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available. Defaults to false.

If true, allows taking a partial snapshot of indices with unavailable shards.


The following request takes a snapshot of index_1 and index_2.

PUT /_snapshot/my_repository/snapshot_2?wait_for_completion=true
  "indices": "index_1,index_2",
  "ignore_unavailable": true,
  "include_global_state": false,
  "metadata": {
    "taken_by": "user123",
    "taken_because": "backup before upgrading"

The API returns the following response:

  "snapshot": {
    "snapshot": "snapshot_2",
    "uuid": "vdRctLCxSketdKb54xw67g",
    "repository": "my_repository",
    "version_id": <version_id>,
    "version": <version>,
    "indices": [],
    "data_streams": [],
    "feature_states": [],
    "include_global_state": false,
    "metadata": {
      "taken_by": "user123",
      "taken_because": "backup before upgrading"
    "state": "SUCCESS",
    "start_time": "2020-06-25T14:00:28.850Z",
    "start_time_in_millis": 1593093628850,
    "end_time": "2020-06-25T14:00:28.850Z",
    "end_time_in_millis": 1593094752018,
    "duration_in_millis": 0,
    "failures": [],
    "shards": {
      "total": 0,
      "failed": 0,
      "successful": 0