# deleteEmailTemplate mutation


`deleteEmailTemplate` is a GraphQL mutation of the Chameleoon MAX API. Send it as `POST https://max-api.chameleoon.sk/api/v1/graphql` with your API key, see [Chameleoon MAX](/chameleoon-max).

Deletes the template and returns its code. A message already sent with it keeps its own copy.

- Requires the `emailTemplate.manage` permission.
- `CONFLICT` with reason `TEMPLATE_CHANGED` when somebody saved the template after you read it.
- `NOT_FOUND` (field `code`) when the template does not exist.

## Arguments

- `input`: [`DeleteEmailTemplateInput!`](/chameleoon-max/type/delete-email-template-input) · required

## Returns

`String!`

## Example

**Mutation**

```graphql
mutation deleteEmailTemplate($input: DeleteEmailTemplateInput!) {
  deleteEmailTemplate(input: $input)
}
```

**Variables**

```json
{
  "input": {
    "code": "example",
    "version": 1
  }
}
```

**Response**

```json
{
  "data": {
    "deleteEmailTemplate": "example"
  }
}
```

Values are illustrative: replace IDs and codes with your own before you send the call.
