---
title: "Delete a template"
description: "Deletes a template."
version: "v2"
---

> Documentation Index
> Fetch the complete documentation index at: https://dev.messageport.com.au/llms.txt
> Use this file to discover all available pages before exploring further.

Path: MessagePort API › Templates

`DELETE /v2/templates/{template}`

Deletes a template.

## Authentication

- `basicAuth`, http, header `Authorization`

## Path parameters

- `template` (`deleteTemplate.path.template`; integer, required) — Template ID.

## Code samples

### cURL

```bash
curl --request DELETE \
  --url https://app.messageport.com.au/api/v2/templates/1234 \
  --header 'Authorization: Basic <credentials>'
```

### TypeScript

```typescript
const url = 'https://app.messageport.com.au/api/v2/templates/1234';
const options = {method: 'DELETE', headers: {Authorization: 'Basic <credentials>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://app.messageport.com.au/api/v2/templates/1234"

headers = {"Authorization": "Basic <credentials>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 204

The template was deleted.

### 401

Missing, malformed or invalid API credentials.

#### Example

```json
{
  "message": "Unauthenticated."
}
```

- `message` (`deleteTemplate.response.401.message`; string, required)

### 403

The resource exists but does not belong to you, or you lack permission.

#### Example

```json
{
  "message": "This action is unauthorized."
}
```

- `message` (`deleteTemplate.response.403.message`; string, required)

### 404

The resource does not exist.

#### Example

```json
{
  "message": "Not Found"
}
```

- `message` (`deleteTemplate.response.404.message`; string, required)


Source: https://dev.messageport.com.au/api/templates/delete/index.md
