---
type: api
title: Delete component templates
description: Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-cluster-delete-component-template
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-cluster-delete-component-template
products:
  - Elasticsearch
---

# Delete component templates

Availability: 7.8+

## Paths

- `DELETE` `/_component_template/{name}`

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

#### Path Parameters

- `name` (union Name | [] Name)
  Comma-separated list or wildcard expression of component template names used to limit the request.

## Description

Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.

## 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 _component_template/template_1
```

#### JavaScript

```javascript
const response = await client.cluster.deleteComponentTemplate({
  name: "template_1",
});
```

#### Python

```python
resp = client.cluster.delete_component_template(
    name="template_1",
)
```

#### curl

```curl
curl -X DELETE "$ELASTICSEARCH_URL/_component_template/template_1" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.cluster().deleteComponentTemplate(d -> d
    .name("template_1")
);
```

#### C#

```c#
var response = await client.Cluster.DeleteComponentTemplateAsync(name: new[] { "template_1" });
```

#### PHP

```php
$resp = $client->cluster()->deleteComponentTemplate([
    "name" => "template_1",
]);
```

#### Ruby

```ruby
response = client.cluster.delete_component_template(
  name: "template_1"
)
```

