---
title: "Permanently delete a template record"
method: DELETE
path: "/templates/{id}"
tags: ["Template"]
---

# Permanently delete a template record

`DELETE /templates/{id}`

Deletes the template identified by `{id}` and all of its column-mapping records from the data layer. This is a hard delete and cannot be undone.

**When to use:** Call this to retire a template that is no longer needed. Ensure no roster uploads still reference the template before deleting.

**How:** Supply `{id}` and the required `tenant-id` header. The template's existence is verified first; an unknown ID returns 404 without deleting anything.

**Returns:** `204 No Content` on success; the response has no body. Only the data-layer records are removed - the template's GCS artifacts (`template.csv`, `mappings.csv`, `schema.json`) are left in place and remain reachable through any still-valid signed URLs until those expire. The operation is not idempotent: repeating it returns 404.

## Path parameters

- `id` string, required

## Headers

- `tenant-id` string, required

## Response `204`

The template and its column records were deleted. No response body.

## Other responses

- `401` — Authentication required - supply a valid bearer token.
- `403` — The authenticated user lacks the `DELETE_TEMPLATE` permission.
- `404` — No template with the given `{id}` exists for the tenant - either it was never created or it was already deleted. The body carries a single `error` message field. Verify the ID against `GET /templates`.
- `500` — Unexpected server-side failure (for example a data-layer outage). Verify whether the delete took effect with `GET /templates/{id}` before retrying.

---

[API](https://skmtc.net/certifyos/apis/certify-api-layer.md) · [All operations](https://skmtc.net/certifyos/apis/certify-api-layer/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/certifyos/certify-api-layer/revisions/563848e0ecc0/schema)
