---
type: api
title: Get snapshot information
description: NOTE: The `after` parameter and `next` field enable you to iterate through snapshots with some consistency guarantees regarding concurrent creation or deletion of snapshots.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-snapshot-get
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-snapshot-get
products:
  - Elasticsearch
---

# Get snapshot information

Availability: 0.0+

## Paths

- `GET` `/_snapshot/{repository}/{snapshot}`

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

#### Path Parameters

- `repository` (string Name)
  A comma-separated list of snapshot repository names used to limit the request.
Wildcard (`*`) expressions are supported.
- `snapshot` (union Name | [] Name)
  A comma-separated list of snapshot names to retrieve
Wildcards (`*`) are supported.

* To get information about all snapshots in a registered repository, use a wildcard (`*`) or `_all`.
* To get information about any snapshots that are currently running, use `_current`.

## Description

NOTE: The `after` parameter and `next` field enable you to iterate through snapshots with some consistency guarantees regarding concurrent creation or deletion of snapshots.
It is guaranteed that any snapshot that exists at the beginning of the iteration and is not concurrently deleted will be seen during the iteration.
Snapshots concurrently created may be seen during an iteration.

## Required authorization

* Cluster privileges: `monitor_snapshot`

## Query String Parameters

- `after` (string)
  An offset identifier to start pagination from as returned by the next field in the response body.
- `from_sort_value` (string)
  The value of the current sort column at which to start retrieval.
It can be a string `snapshot-` or a repository name when sorting by snapshot or repository name.
It can be a millisecond time value or a number when sorting by `index-` or shard count.
- `ignore_unavailable` (boolean · default: false)
  If `false`, the request returns an error for any snapshots that are unavailable.
- `index_details` (boolean · default: false)
  If `true`, the response includes additional information about each index in the snapshot comprising the number of shards in the index, the total size of the index in bytes, and the maximum number of segments per shard in the index.
The default is `false`, meaning that this information is omitted.
- `index_names` (boolean · default: true)
  If `true`, the response includes the name of each index in each snapshot.
- `include_repository` (boolean · default: true)
  If `true`, the response includes the repository name in each snapshot.
- `master_timeout` (string Duration · default: 30s)
  The 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.
- `order` (enum SortOrder · default: asc)
  The sort order.
Valid values are `asc` for ascending and `desc` for descending order.
The default behavior is ascending order.

Supported values include:
  - `asc`: Ascending (smallest to largest)
  - `desc`: Descending (largest to smallest)
  Values: `asc`, `desc`
- `offset` (number · default: 0)
  Numeric offset to start pagination from based on the snapshots matching this request. Using a non-zero value for this parameter is mutually exclusive with using the after parameter. Defaults to 0.
- `size` (number · default: -1)
  The maximum number of snapshots to return.
The default is -1, which means to return all that match the request without limit.
- `slm_policy_filter` (string Name)
  Filter snapshots by a comma-separated list of snapshot lifecycle management (SLM) policy names that snapshots belong to.

You can use wildcards (`*`) and combinations of wildcards followed by exclude patterns starting with `-`.
For example, the pattern `*,-policy-a-\*` will return all snapshots except for those that were created by an SLM policy with a name starting with `policy-a-`.
Note that the wildcard pattern `*` matches all snapshots created by an SLM policy but not those snapshots that were not created by an SLM policy.
To include snapshots that were not created by an SLM policy, you can use the special pattern `_none` that will match all snapshots without an SLM policy.
- `sort` (enum SnapshotSort · default: start_time)
  The sort order for the result.
The default behavior is sorting by snapshot start time stamp.
  Values: `start_time`, `duration`, `name`, `index_count`, `repository`, `shard_count`, `failed_shard_count`
- `verbose` (boolean · default: true)
  If `true`, returns additional information about each snapshot such as the version of Elasticsearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted.

NOTE: The parameters `size`, `order`, `after`, `from_sort_value`, `offset`, `slm_policy_filter`, and `sort` are not supported when you set `verbose=false` and the sort order for requests with `verbose=false` is undefined.

## Response

`application/json`

- `remaining` (number)
  The number of remaining snapshots that were not returned due to size limits and that can be fetched by additional requests using the `next` field value.
- `total` (number)
  The total number of snapshots that match the request when ignoring the size limit or `after` query parameter.
- `next` (string)
  If the request contained a size limit and there might be more results, a `next` field will be added to the response.
It can be used as the `after` query parameter to fetch additional results.
- `responses` ([] SnapshotResponseItem)
  - `repository` (string Name)
  - `snapshots` ([] SnapshotInfo)
    - `data_streams` ([] string)
    - `duration` (string Duration)
    - `duration_in_millis` (DurationValueUnitMillis)
    - `end_time` (DateTime)
    - `end_time_in_millis` (EpochTimeUnitMillis)
    - `failures` ([] SnapshotShardFailure)
      - `index` (string IndexName)
      - `node_id` (string Id)
      - `reason` (string)
      - `shard_id` (number)
      - `index_uuid` (string Id)
      - `status` (string)
    - `include_global_state` (boolean)
    - `indices` ([] string IndexName)
    - `index_details` (map string to IndexDetails)
      Map values ({} IndexDetails)
      - `shard_count` (number)
      - `size` (number | string ByteSize)
      - `size_in_bytes` (number)
      - `max_segments_per_shard` (number)
    - `metadata` (Metadata)
    - `reason` (string)
    - `repository` (string Name)
    - `snapshot` (string Name)
    - `shards` ({} ShardStatistics)
      - `failed` (number uint)
        The number of shards the operation or search attempted to run on but failed.
      - `successful` (number uint)
        The number of shards the operation or search succeeded on.
      - `total` (number uint)
        The number of shards the operation or search will run on overall.
      - `failures` ([] ShardFailure)
        - `index` (string IndexName)
        - `node` (string)
        - `reason` ({} ErrorCause)
          - `type` (string)
            The type of error
          - `reason` (union string) — nullable
            A human-readable explanation of the error, in English.
            One of: `string`
          - `stack_trace` (string)
            The server stack trace. Present only if the `error_trace=true` parameter was sent with the request.
          - `caused_by` ({} ErrorCause) — recursive
            Same fields as `reason` in `failures`
          - `root_cause` ([] ErrorCause) — recursive
            Same fields as `reason` in `failures`
          - `suppressed` ([] ErrorCause) — recursive
            Same fields as `reason` in `failures`
        - `shard` (number)
        - `status` (string)
        - `primary` (boolean)
      - `skipped` (number uint)
    - `start_time` (DateTime)
    - `start_time_in_millis` (EpochTimeUnitMillis)
    - `state` (string)
    - `uuid` (string)
    - `version` (string)
    - `version_id` (number VersionNumber)
    - `feature_states` ([] InfoFeatureState)
      - `feature_name` (string)
      - `indices` (string Indices)
  - `error` ({} ErrorCause)
    - `type` (string)
      The type of error
    - `reason` (union string) — nullable
      A human-readable explanation of the error, in English.
      One of: `string`
    - `stack_trace` (string)
      The server stack trace. Present only if the `error_trace=true` parameter was sent with the request.
    - `caused_by` ({} ErrorCause) — recursive
      Same fields as `error` in `responses`
    - `root_cause` ([] ErrorCause) — recursive
      Same fields as `error` in `responses`
    - `suppressed` ([] ErrorCause) — recursive
      Same fields as `error` in `responses`
- `snapshots` ([] SnapshotInfo)
  Same fields as `snapshots` in `responses`
## Code Examples

#### Console

```console
GET /_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000
```

#### JavaScript

```javascript
const response = await client.snapshot.get({
  repository: "my_repository",
  snapshot: "snapshot_*",
  sort: "start_time",
  from_sort_value: 1577833200000,
});
```

#### Python

```python
resp = client.snapshot.get(
    repository="my_repository",
    snapshot="snapshot_*",
    sort="start_time",
    from_sort_value="1577833200000",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.snapshot().get(g -> g
    .fromSortValue("1577833200000")
    .repository("my_repository")
    .snapshot("snapshot_*")
    .sort(SnapshotSort.StartTime)
);
```

#### C#

```c#
var response = await client.Snapshot
    .GetAsync(repository: "my_repository", snapshot: new[] { "snapshot_*" }, d1 => d1
        .FromSortValue("1577833200000")
        .Sort(SnapshotSort.StartTime)
    );
```

#### PHP

```php
$resp = $client->snapshot()->get([
    "repository" => "my_repository",
    "snapshot" => "snapshot_*",
    "sort" => "start_time",
    "from_sort_value" => "1577833200000",
]);
```

#### Ruby

```ruby
response = client.snapshot.get(
  repository: "my_repository",
  snapshot: "snapshot_*",
  sort: "start_time",
  from_sort_value: "1577833200000"
)
```

## Response Examples

#### Snapshot get response example1

A successful response from `GET /_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000`. The response contains information for all snapshots with names starting with `snapshot_` and that started on or after timestamp `1577833200000` (Jan 1st 2020) when sorted by snapshot start time in the default ascending order.

```json
{
  "snapshots": [
    {
      "snapshot": "snapshot_1",
      "uuid": "dKb54xw67gvdRctLCxSket",
      "repository": "my_repository",
      "version_id": <version_id>,
      "version": <version>,
      "indices": [],
      "data_streams": [],
      "feature_states": [],
      "include_global_state": true,
      "state": "SUCCESS",
      "start_time": "2020-07-06T21:55:18.128Z",
      "start_time_in_millis": 1593093628849,
      "end_time": "2020-07-06T21:55:18.129Z",
      "end_time_in_millis": 1593093628850,
      "duration_in_millis": 1,
      "failures": [],
      "shards": {
        "total": 0,
        "failed": 0,
        "successful": 0
      }
    },
    {
      "snapshot": "snapshot_2",
      "uuid": "vdRctLCxSketdKb54xw67g",
      "repository": "my_repository",
      "version_id": <version_id>,
      "version": <version>,
      "indices": [],
      "data_streams": [],
      "feature_states": [],
      "include_global_state": true,
      "state": "SUCCESS",
      "start_time": "2020-07-06T21:55:18.130Z",
      "start_time_in_millis": 1593093628851,
      "end_time": "2020-07-06T21:55:18.130Z",
      "end_time_in_millis": 1593093628851,
      "duration_in_millis": 0,
      "failures": [],
      "shards": {
        "total": 0,
        "failed": 0,
        "successful": 0
      }
    },
    {
      "snapshot": "snapshot_3",
      "uuid": "dRctdKb54xw67gvLCxSket",
      "repository": "my_repository",
      "version_id": <version_id>,
      "version": <version>,
      "indices": [],
      "data_streams": [],
      "feature_states": [],
      "include_global_state": true,
      "state": "SUCCESS",
      "start_time": "2020-07-06T21:55:18.131Z",
      "start_time_in_millis": 1593093628852,
      "end_time": "2020-07-06T21:55:18.135Z",
      "end_time_in_millis": 1593093628856,
      "duration_in_millis": 4,
      "failures": [],
      "shards": {
        "total": 0,
        "failed": 0,
        "successful": 0
      }
    }
  ],
  "total": 3,
  "remaining": 0
}
```

