---
type: api
title: Delete an index template
description: The provided <index-template> may contain multiple template names separated by a comma. If multiple template
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch-serverless/operation/operation-indices-delete-index-template
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch-serverless/operation/operation-indices-delete-index-template
products:
  - Elasticsearch Serverless
---

# Delete an index template

## Paths

- `DELETE` `/_index_template/{name}`

#### Path parameters

- `name` (union string | string[]) — required
  Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported.

## Description

The provided <index-template> may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.

## Required authorization

- Cluster privileges: `manage_index_templates`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs use 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}"
  ```
  
  For more information about where to find API keys for the Elasticsearch endpoint (${ES_URL}) for a project, go to [Get started with Elasticsearch Serverless](https://www.elastic.co/docs/solutions/search/serverless-elasticsearch-get-started).

## Query string parameters

- `master_timeout` (string · default: 30s) — optional
  Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
- `timeout` (string · default: 30s) — optional
  Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

## Response

`application/json`

- `acknowledged` (boolean)
  For a successful response, this value is always true. On failure, an exception is returned instead.
## Code examples

#### Console

```console
DELETE /_index_template/my-index-template
```

#### JavaScript

```javascript
const response = await client.indices.deleteIndexTemplate({
  name: "my-index-template",
});
```

#### Python

```python
resp = client.indices.delete_index_template(
    name="my-index-template",
)
```

#### curl

```curl
curl -X DELETE "$ELASTICSEARCH_URL/_index_template/my-index-template" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.indices().deleteIndexTemplate(d -> d
    .name("my-index-template")
);
```

#### C#

```c#
var response = await client.Indices.DeleteIndexTemplateAsync(name: new[] { "my-index-template" });
```

#### PHP

```php
$resp = $client->indices()->deleteIndexTemplate([
    "name" => "my-index-template",
]);
```

#### Ruby

```ruby
response = client.indices.delete_index_template(
  name: "my-index-template"
)
```

