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

# Delete deployment template

## Paths

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

#### Path parameters

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

## Description

Deletes a deployment template by id.

## Authentication

- Basic: `Authorization: Basic <credentials>`
- Api key: `Authorization: <value>`

## Query string parameters

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

## Responses

#### `200`

The deployment template was successfully deleted.

`application/json`

Type: `object`

#### `400`

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

`application/json`

- `errors` (object[])
  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` (object[])
  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` (object[])
  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

#### curl

```curl
curl -X DELETE "${API_URL}/deployments/templates/${TEMPLATE_ID}?region=${REGION}" \
  -u "${USERNAME}:${PASSWORD}"
```

