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

# Delete a template

> DELETE /v1/templates/:slug — soft-delete a template and free its slug for recreation.

<Info>**DELETE** `https://api.craftkit.dev/v1/templates/{slug}`</Info>

Soft-delete the template at `slug`. The row is retained (marked deleted) but its slug is **freed**, so
the same canonical slug can be recreated by [`POST /v1/templates`](/api-reference/create-template) or
[`PUT /v1/templates/:slug`](/api-reference/update-template). This is the cleanup path for idempotent
provisioning and for retiring a template you no longer render.

<Note>
  **Existing renders are untouched.** They pin their own `templateVersionId` and remain fetchable by
  render id (and via any share links). Deleting a template removes it from
  [list](/api-reference/list-templates) and [get](/api-reference/get-template), and blocks new renders
  against that slug.
</Note>

<Tip>
  If you only need the newest layout, prefer [PUT](/api-reference/update-template) — it republishes in
  place and keeps the template `id`, slug, and render history. Reach for DELETE when you genuinely want
  the template gone.
</Tip>

## Authorization

<ParamField header="Authorization" type="string" required>
  `Bearer ck_live_…` — must own the project.
</ParamField>

## Path

<ParamField path="slug" type="string" required>The slug of the template to delete.</ParamField>

## Response

`200`:

<ResponseField name="id" type="string">The deleted template's id.</ResponseField>
<ResponseField name="slug" type="string">The original (now-freed) slug, echoed back.</ResponseField>
<ResponseField name="deletedAt" type="string">ISO-8601 timestamp of the soft-delete.</ResponseField>

A second DELETE of the same slug returns `404` — the operation is idempotent in effect.

## Errors

| Status | code                 | Meaning                                                                              |
| ------ | -------------------- | ------------------------------------------------------------------------------------ |
| 401    | `unauthorized`       | Missing/invalid key.                                                                 |
| 404    | `template_not_found` | No live template with that slug in this project (already deleted, or never existed). |

```bash cURL theme={null}
curl -X DELETE https://api.craftkit.dev/v1/templates/charter-handover \
  -H "Authorization: Bearer $CRAFTKIT_API_KEY"
```

```json 200 theme={null}
{
  "id": "…",
  "slug": "charter-handover",
  "deletedAt": "2026-06-06T00:00:00.000Z"
}
```
