# Delete template

`DELETE https://postcraft.io/api/v1/templates/{id}`

Deletes the template. Renders and reads of it stop immediately. Requires an API key that owns the template: a presigned token cannot destroy the template it was handed. Deleting an already-deleted or non-owned template is a 404, so the call is not idempotent.

## Authentication

Send one of these headers:

- `x-api-key: <key>`: Long-lived account credential. Create one from the dashboard.

## Parameters

| Name | In | Type | Required | Description |
| ---- | -- | ---- | -------- | ----------- |
| `id` | path | string | yes |  |

## Responses

### 200

Template deleted.

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `deleted` | boolean | yes |  |

### Errors

Every error answers with `{ "error": { "code": string, "message": string } }`.

| Status | Meaning |
| ------ | ------- |
| 400 | Invalid input. |
| 401 | Missing or invalid credential. |
| 403 | Authenticated but not allowed. |
| 404 | Not found. |
| 413 | Payload exceeds size limit. |
| 422 | Template render failed. |
| 429 | Rate limited. |

The whole API as an OpenAPI document: https://postcraft.io/api/v1/openapi.json
