> ## Documentation Index
> Fetch the complete documentation index at: https://tapace.lk/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a template

> Removes a template and all of its passes in test and live.

Deleting is final and takes effect at once. The API and the dashboard stop returning the template and [its passes](https://tapace.lk/docs/api-reference/passes/delete.md), in both test and live, including voided ones. Active passes are voided first, so holders' wallets show them as void.

A test key can only delete a template that has no live passes. Use a live key for one that does.

**id** `string` *required*

The template ID.

**Idempotency-Key** `string` *required*

A unique value for this request.

### Response

**object** `string`

Always `template_deletion`.

**templateId** `string`

The deleted template.

**erasedPasses** `integer`

How many passes this request deleted, across test and live.

### What happens to the data

TapAce keeps each pass's record for 30 days so phones that were offline can still receive the void, and keeps the template's design until those passes are gone, because the void is built from it. It then removes the template, its history, and any images no other template uses. Google Wallet has no delete, so its copies of the passes stay inactive.

### Errors

| Status | When |
| - | - |
| `403` | The template has live passes and you used a test key. |
| `404` | The template doesn't exist or was already deleted. |

```bash cURL theme={null}
curl -X DELETE https://api.tapace.lk/v1/templates/tmpl_Q4vN8xT2mLr7KpZs3Wd1 \
  -H "Authorization: Bearer $TAPACE_API_KEY" \
  -H "Idempotency-Key: 4a9e2c7b-1d3f-4b6a-8e5c-9f2d1a7b3c80"
```

```json 200 theme={null}
{
  "object": "template_deletion",
  "templateId": "tmpl_Q4vN8xT2mLr7KpZs3Wd1",
  "erasedPasses": 128
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.