---
type: api
title: Get the items in the Elasticsearch resource keystore
description: Fetches the current fields and metadata (but not the values) of the keystore for the Elasticsearch resource.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/v3/operation/operation-get-deployment-es-resource-keystore
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/v3/operation/operation-get-deployment-es-resource-keystore
products:
  - Elastic Cloud Enterprise
---

# Get the items in the Elasticsearch resource keystore

Authentication: required

## Paths

- `GET` `/deployments/{deployment_id}/elasticsearch/{ref_id}/keystore`

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

Fetches the current fields and metadata (but not the values) of the keystore for the Elasticsearch resource.

## Responses

#### `200`

The contents of the Elasticsearch keystore, with values redacted

`application/json`

- `secrets` (map string to object)
  List of secrets
  Map values (object)
  - `value` (object)
    Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore. NOTE: When the keystore secret is unspecified, it is removed.
  - `as_file` (boolean)
    Stores the keystore secret as a file. The default is false, which stores the keystore secret as string when value is a plain string, or true when value is an object.
#### `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}/keystore" \
  -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
{
  "secrets": {
    "key": {
      "value": {},
      "as_file": false
    }
  }
}
```

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

