---
type: api
title: List the attached snapshot repositories
description: Lists all the snapshot repositories this deployment has access to. These are snapshot repositories of other deployments that have been linked to this deployment.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/operation/operation-get-deployment-es-resource-snapshot-repository
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/operation/operation-get-deployment-es-resource-snapshot-repository
products:
  - Elastic Cloud Enterprise
---

# List the attached snapshot repositories

Authentication: required

## Paths

- `GET` `/deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/repository`

#### Path parameters

- `deployment_id` (string) — required
  Identifier for the Deployment
- `ref_id` (string) — required
  User-specified RefId for the Resource (or '_main' if there is only one)

## Description

Lists all the snapshot repositories this deployment has access to. These are snapshot repositories of other deployments that have been linked to this deployment.

## Responses

#### `200`

List of snapshot repositories for this deployment

`application/json`

- `repositories` (object[])
  List of snapshot repositories (other deployments whose snapshots this deployment can access)
  - `cluster_id` (string)
    Elasticsearch cluster id
  - `deployment_id` (string)
    Deployment id
  - `deployment_name` (string)
    Deployment name
  - `repository_name` (string)
    The name of the snapshot repository in Elasticsearch (e.g. _clone_abcd1234)
#### `404`

* The Deployment specified by {deployment_id} cannot be found. (code: `deployments.deployment_not_found`)
* The Resource specified by {ref_id} cannot be found. (code: `deployments.deployment_resource_not_found`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `500`

We have failed you. (code: `deployments.metadata_internal_error`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code examples

#### curl

```curl
curl -X GET "${API_URL}/deployments/${DEPLOYMENT_ID}/elasticsearch/${REF_ID}/snapshot/repository" \
  -u "${USERNAME}:${PASSWORD}"
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "repositories": [
    {
      "cluster_id": "string",
      "deployment_id": "string",
      "deployment_name": "string",
      "repository_name": "string"
    }
  ]
}
```

#### 404

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
```

#### 500

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
```

