---
type: api
title: Get snapshot repository information
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-snapshot-get-repository
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-snapshot-get-repository
products:
  - Elasticsearch
---

# Get snapshot repository information


Availability:

## Paths

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

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

#### Path Parameters

- `repository` (union Name | [] Name) — optional, leave it out to use `/_snapshot`
  A comma-separated list of snapshot repository names used to limit the request.
Wildcard (`*`) expressions are supported including combining wildcards with exclude patterns starting with `-`.

To get information about all snapshot repositories registered in the cluster, omit this parameter or use `*` or `_all`.

## Description

## Required authorization

* Cluster privileges: `monitor_snapshot`

## Query String Parameters

- `local` (boolean · default: false)
  If `true`, the request gets information from the local node only.
If `false`, the request gets information from the master node.
- `master_timeout` (string Duration · default: 30s)
  The period to wait for the master node.
If the master node is not available before the timeout expires, the request fails and returns an error.
To indicate that the request should never timeout, set it to `-1`.

## Response

`application/json`

Type: `map string to Repository`

## Code Examples

#### Console

```console
GET /_snapshot/my_repository
```

#### JavaScript

```javascript
const response = await client.snapshot.getRepository({
  name: "my_repository",
});
```

#### Python

```python
resp = client.snapshot.get_repository(
    name="my_repository",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_snapshot/my_repository" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.snapshot().getRepository(g -> g
    .name("my_repository")
);
```

#### C#

```c#
var response = await client.Snapshot
    .GetRepositoryAsync(d1 => d1
        .Name(new[] { "my_repository" })
    );
```

#### PHP

```php
$resp = $client->snapshot()->getRepository([
    "repository" => "my_repository",
]);
```

#### Ruby

```ruby
response = client.snapshot.get_repository(
  repository: "my_repository"
)
```

## Response Examples

#### Snapshot get repository response example1

A successful response from `GET /_snapshot/my_repository`.

```json
{
  "my_repository" : {
    "type" : "fs",
    "uuid" : "0JLknrXbSUiVPuLakHjBrQ",
    "settings" : {
      "location" : "my_backup_location"
    }
  }
}
```

