---
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/4371/api/doc/elasticsearch-serverless/operation/operation-indices-delete-index-template
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/operation/operation-indices-delete-index-template
products:
  - Elasticsearch Serverless
---

# Delete an index template

Availability:

## Paths

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

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/authentication#apikeyauth)

#### Path Parameters

- `name` (union Name | [] Name)
  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`

## Query String Parameters

- `master_timeout` (string Duration · default: 30s)
  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 Duration · default: 30s)
  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"
)
```

