---
type: api
title: Get snapshot repository information
description: Get a list of snapshot repositories for a cluster.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-cat-repositories
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-cat-repositories
products:
  - Elasticsearch
---

# Get snapshot repository information

Availability: Generally available since 2.1

## Paths

- `GET` `/_cat/repositories`

## Description

Get a list of snapshot repositories for a cluster.
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot repository API.

## 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

- `h` (union oneOf) — optional
  List of columns to appear in the response. Supports simple wildcards.
  One of: `string[]` or `string`
- `s` (union oneOf) — optional
  List of columns that determine how the table should be sorted.
Sorting defaults to ascending and can be changed by setting `:asc`
or `:desc` as a suffix to the column name.
  One of: `string[]` or `string`
- `local` (boolean · default: false) — optional
  If `true`, the request computes the list of selected nodes from the
local cluster state. If `false` the list of selected nodes are computed
from the cluster state of the master node. In both cases the coordinating
node will send requests for further information to each selected node.
- `master_timeout` (string · default: 30s) — optional
  Period to wait for a connection to the master node.

## Response

`application/json`

Type: `object[]`

An array; each item has these fields:

- `id` (string)
  The unique repository identifier.
- `type` (string)
  The repository type.
## Code examples

#### Console

```console
GET /_cat/repositories?v=true&format=json
```

#### JavaScript

```javascript
const response = await client.cat.repositories({
  v: "true",
  format: "json",
});
```

#### Python

```python
resp = client.cat.repositories(
    v=True,
    format="json",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_cat/repositories?v=true&format=json" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.cat().repositories(r -> r);
```

#### PHP

```php
$resp = $client->cat()->repositories([
    "v" => "true",
    "format" => "json",
]);
```

#### Ruby

```ruby
response = client.cat.repositories(
  v: "true",
  format: "json"
)
```

## Response examples

#### Cat repositories response example1

A successful response from `GET /_cat/repositories?v=true&format=json`.

```json
[
  {
    "id": "repo1",
    "type": "fs"
  },
  {
    "id": "repo2",
    "type": "s3"
  }
]
```

