---
type: api
title: Get aliases
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-cat-aliases
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-cat-aliases
products:
  - Elasticsearch
---

# Get aliases


Availability:

## Paths

- `GET` `/_cat/aliases/{name}`
- `GET` `/_cat/aliases`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#bearerauth)

#### Path Parameters

- `name` (union Name | [] Name) — optional, leave it out to use `/_cat/aliases`
  A comma-separated list of aliases to retrieve. Supports wildcards (`*`).  To retrieve all aliases, omit this parameter or use `*` or `_all`.

## Description

Get the cluster's index aliases, including filter and routing information.
This API does not return data stream aliases.

IMPORTANT: CAT APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API.

## Required authorization

* Index privileges: `view_index_metadata`

## Query String Parameters

- `h` (union CatAliasesColumns)
  A comma-separated list of columns names to display. It supports simple wildcards.

Supported values include:
  - `alias` (or `a`): The name of the alias.
  - `index` (or `i`, `idx`): The name of the index the alias points to.
  - `filter` (or `f`, `fi`): The filter applied to the alias.
  - `routing.index` (or `ri`, `routingIndex`): Index routing value for the alias.
  - `routing.search` (or `rs`, `routingSearch`): Search routing value for the alias.
  - `is_write_index` (or `w`, `isWriteIndex`): Indicates if the index is the write index for the alias.
  Values: `alias`, `a`, `index`, `i`, `idx`, `filter`, `f`, `fi`, `routing.index`, `ri`, `routingIndex`, `routing.search`, `rs`, `routingSearch`, `is_write_index`, `w`, `isWriteIndex`
- `s` (union Names)
  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: `Name` or `Name[]`
- `expand_wildcards` (string ExpandWildcards · default: all)
  The 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.
It supports comma-separated values, such as `open,hidden`.

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`
- `master_timeout` (string Duration · default: 30s)
  The period to wait for a connection to the master node.
If the master node is not available before the timeout expires, the request fails and returns an error.
To indicated that the request should never timeout, you can set it to `-1`.

## Response

`application/json`

Type: `[] AliasesRecord`

- `alias` (string)
  alias name
- `index` (string IndexName)
  index alias points to
- `filter` (string)
  filter
- `routing.index` (string)
  index routing
- `routing.search` (string)
  search routing
- `is_write_index` (string)
  write index
## Code Examples

#### Console

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

#### JavaScript

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

#### Python

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

#### curl

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

#### Java

```java
client.cat().aliases(a -> a);
```

#### PHP

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

#### Ruby

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

## Response Examples

#### Cat aliases response example1

A successful response from `GET _cat/aliases?format=json&v=true`. This response shows that `alias2` has configured a filter and `alias3` and `alias4` have routing configurations.

```json
[
  {
    "alias": "alias1",
    "index": "test1",
    "filter": "-",
    "routing.index": "-",
    "routing.search": "-",
    "is_write_index": "true"
  },
  {
    "alias": "alias1",
    "index": "test1",
    "filter": "*",
    "routing.index": "-",
    "routing.search": "-",
    "is_write_index": "true"
  },
  {
    "alias": "alias3",
    "index": "test1",
    "filter": "-",
    "routing.index": "1",
    "routing.search": "1",
    "is_write_index": "true"
  },
  {
    "alias": "alias4",
    "index": "test1",
    "filter": "-",
    "routing.index": "2",
    "routing.search": "1,2",
    "is_write_index": "true"
  }
]
```

