---
type: api
title: Delete deployment template
description: Deletes a deployment template by id.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/operation/operation-delete-deployment-template-v2
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/operation/operation-delete-deployment-template-v2
products:
  - Elastic Cloud Enterprise
---

# Delete deployment template

## Paths

- `DELETE` `/deployments/templates/{template_id}`

- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/authentication#basicauth)
- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/authentication#apikey)

#### Path Parameters

- `template_id` (string)
  The identifier for the deployment template.

## Description

Deletes a deployment template by id.

## Query String Parameters

- `region` (string)
  Region of the deployment template

## Responses

#### `200`

The deployment template was successfully deleted.

`application/json`

Type: `EmptyResponse`

#### `400`

The requested region is not supported. (code: `templates.region_not_found`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `401`

The user is not authorized to access requested region. (code: `templates.region_not_allowed`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `404`

The deployment template specified by {template_id} cannot be found. (code: `templates.template_not_found`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code Examples

#### Console

```console
DELETE /deployments/templates/{template_id}?region={region}
```

#### curl

```curl
curl -X DELETE "/deployments/templates/{template_id}?region={region}"
```

