---
title: "Delete template"
type: reference
method: POST
path: /rest-api/template/delete.do
tag: "Templates"
---

# Delete template

`POST https://YOUR-NETWORK-DOMAIN/rest-api/template/delete.do`

Deletes a creative template by ID. The template cannot be deleted if it is set as the default affiliate template in network preferences. Requires DELETE permission on templates.

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `id` | integer | no | `12` | ID of the template — omit on edit to create a new template; delete and export need it |
| `active` | boolean | no | `true` | Whether the template is active |
| `alwaysRedirect` | boolean | no | `false` | Whether the template always uses redirect mode for click tracking |
| `content` | string | no | `<div>{{BANNER}}</div>` | Template HTML/JS content body |
| `global` | boolean | no | `false` | Whether this is a global (system-wide) template |
| `impressionRecordedByTemplate` | boolean | no | `false` | Whether impression tracking is handled by the template itself |
| `maxRequiredNativeAdsAmount` | integer | no | `1` | Maximum number of native ads supported by this template |
| `minRequiredNativeAdsAmount` | integer | no | `1` | Minimum number of native ads required by this template |
| `placementType` | string | no | `SITE_PLACEMENT` | Placement type this template applies to |
| `title` | string | no | `Standard Banner 300x250` | Template title |
| `type` | string | no | `GENERAL` | Template type |

## Responses

- `200` — Template deleted successfully
- `400` — Bad request — invalid or missing parameters
- `401` — Authentication error
- `403` — Insufficient permissions

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/template/delete.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'id=12'
```

Source: https://epom.com/ad-server/docs/api/templates/post-template-delete