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

# Get snapshot repository information


## Paths

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

#### Path parameters

- `repository` (union string | string[]) — 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`.

## Required authorization

- Cluster privileges: `monitor_snapshot`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/token-based-authentication-services)

## Query string parameters

- `local` (boolean · default: false) — optional
  If `true`, the request gets information from the local node only.
If `false`, the request gets information from the master node.
- `master_timeout` (string · default: 30s) — optional
  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 oneOf`

## 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"
    }
  }
}
```

