---
type: api
title: Get index shard stores
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v8/operation/operation-indices-shard-stores
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v8/operation/operation-indices-shard-stores
products:
  - Elasticsearch
---

# Get index shard stores


## Paths

- `GET` `/{index}/_shard_stores`
- `GET` `/_shard_stores`

#### Path parameters

- `index` (union string | string[]) — optional, leave it out to use `/_shard_stores`
  List of data streams, indices, and aliases used to limit the request.

## Description

Get store information about replica shards in one or more indices.
For data streams, the API retrieves store information for the stream's backing indices.

The index shard stores API returns the following information:

* The node on which each replica shard exists.
* The allocation ID for each replica shard.
* A unique ID for each replica shard.
* Any errors encountered while opening the shard index or from an earlier failure.

By default, the API returns store information only for primary shards that are unassigned or have one or more unassigned replica shards.

## Required authorization

- Index privileges: `monitor`

## 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/guide/en/elasticsearch/reference/current/token-authentication-services.html)

## Query string parameters

- `allow_no_indices` (boolean) — optional
  If false, the request returns an error if any wildcard expression, index alias, or _all
value targets only missing or closed indices. This behavior applies even if the request
targets other open indices.
- `expand_wildcards` (string · default: open) — optional
  Type of index that wildcard patterns can match. If the request can target data streams,
this argument determines whether wildcard expressions match hidden data streams.

Supported values include:
  - `all`: Match any data stream or index, including hidden ones.
  - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.
  - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
  - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.
  - `none`: Wildcard expressions are not accepted.
  Values: `all`, `open`, `closed`, `hidden`, `none`
- `ignore_unavailable` (boolean · default: false) — optional
  If true, missing or closed indices are not included in the response.
- `status` (union enum | enum[]) — optional
  List of shard health statuses used to limit the request.

Supported values include:
  - `green`: The primary shard and all replica shards are assigned.
  - `yellow`: One or more replica shards are unassigned.
  - `red`: The primary shard is unassigned.
  - `all`: Return all shards, regardless of health status.
  Values: `green`, `yellow`, `red`, `all`

## Response

`application/json`

- `indices` (map string to object)
  Map values (object)
  - `shards` (map string to object)
    Map values (object)
    - `stores` (object[])
      - `allocation` (enum)
        Values: `primary`, `replica`, `unused`
      - `allocation_id` (string)
      - `store_exception` (object)
        - `reason` (string)
        - `type` (string)
## Code examples

#### Console

```console
GET /_shard_stores?status=green
```

#### JavaScript

```javascript
const response = await client.indices.shardStores({
  status: "green",
});
```

#### Python

```python
resp = client.indices.shard_stores(
    status="green",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_shard_stores?status=green" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### C#

```c#
var response = await client.Indices
    .ShardStoresAsync(d1 => d1
        .Status(ShardStoreStatus.Green)
    );
```

#### PHP

```php
$resp = $client->indices()->shardStores([
    "status" => "green",
]);
```

#### Ruby

```ruby
response = client.indices.shard_stores(
  status: "green"
)
```

## Response examples

#### Indices shard stores response example1

An abbreviated response from `GET /_shard_stores?status=green`.

```json
{
  "indices": {
    "my-index-000001": {
      "shards": {
        "0": {
          "stores": [
            {
              "sPa3OgxLSYGvQ4oPs-Tajw": {
                "name": "node_t0",
                "ephemeral_id": "9NlXRFGCT1m8tkvYCMK-8A",
                "transport_address": "local[1]",
                "external_id": "node_t0",
                "attributes": {},
                "roles": [],
                "version": "8.10.0",
                "min_index_version": 7000099,
                "max_index_version": 8100099
              },
              "allocation_id": "2iNySv_OQVePRX-yaRH_lQ",
              "allocation": "primary",
              "store_exception": {}
            }
          ]
        }
      }
    }
  }
}
```

