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

# Get index template information


Availability: 5.2+

## Paths

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

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

#### Path Parameters

- `name` (string Name) — optional, leave it out to use `/_cat/templates`
  The name of the template to return.
Accepts wildcard expressions. If omitted, all templates are returned.

## Description

Get information about the index templates in a cluster.
You can use index templates to apply index settings and field mappings to new indices at creation.
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 index template API.

## Required authorization

* Cluster privileges: `monitor`

## Query String Parameters

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

Supported values include:
  - `name` (or `n`): The template name.
  - `index_patterns` (or `t`): The template index patterns.
  - `order` (or `o`, `p`): The template application order or priority number.
  - `version` (or `v`): The version.
  - `composed_of` (or `c`): The component templates comprising the index template.
  Values: `name`, `n`, `index_patterns`, `t`, `order`, `o`, `p`, `version`, `v`, `composed_of`, `c`
- `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[]`
- `local` (boolean · default: false)
  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 Duration · default: 30s)
  Period to wait for a connection to the master node.

## Response

`application/json`

Type: `[] TemplatesRecord`

- `name` (string Name)
  The template name.
- `index_patterns` (string)
  The template index patterns.
- `order` (string)
  The template application order or priority number.
- `version` (union VersionString | string) — nullable
  The template version.
- `composed_of` (string)
  The component templates that comprise the index template.
## Code Examples

#### Console

```console
GET _cat/templates/my-template-*?v=true&s=name&format=json
```

#### JavaScript

```javascript
const response = await client.cat.templates({
  name: "my-template-*",
  v: "true",
  s: "name",
  format: "json",
});
```

#### Python

```python
resp = client.cat.templates(
    name="my-template-*",
    v=True,
    s="name",
    format="json",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_cat/templates/my-template-*?v=true&s=name&format=json" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.cat().templates(t -> t
    .name("my-template-*")
    .s("name")
);
```

#### PHP

```php
$resp = $client->cat()->templates([
    "name" => "my-template-*",
    "v" => "true",
    "s" => "name",
    "format" => "json",
]);
```

#### Ruby

```ruby
response = client.cat.templates(
  name: "my-template-*",
  v: "true",
  s: "name",
  format: "json"
)
```

## Response Examples

#### Cat templates response example1

A successful response from `GET _cat/templates/my-template-*?v=true&s=name&format=json`.

```json
[
  {
    "name": "my-template-0",
    "index_patterns": "[te*]",
    "order": "500",
    "version": null,
    "composed_of": "[]"
  },
  {
    "name": "my-template-1",
    "index_patterns": "[tea*]",
    "order": "501",
    "version": null,
    "composed_of": "[]"
  },
  {
    "name": "my-template-2",
    "index_patterns": "[teak*]",
    "order": "502",
    "version": "7",
    "composed_of": "[]"
  }
]
```

