---
title: "Archive Template"
method: DELETE
path: "/v1/templates/{template_id}"
tags: ["templates"]
---

# Archive Template

`DELETE /v1/templates/{template_id}`

Soft-delete a SPECIFIC VERSION ROW (not the whole lineage).

The 'template' in the URL is one row of a versioning lineage. This
endpoint archives THAT row only — sibling versions in the same lineage
are untouched.

BLOCKED in two cases (each returns 409 with a structured error so the
UI can render an actionable message):

1. Row has flavored CHILD templates (`parent_template_id = $1`). They
   would inherit from an archived parent — weird state. Admin must
   archive or re-parent the children first.

2. Row is the CURRENTLY-ACTIVE version of its lineage AND other
   versions exist. Deleting the active leaves the lineage with no
   active version → `resolve_active_version` degrades to a no-op →
   new sessions could land on archived content. Admin must promote
   another version first.

Allowed: row is the only version of its lineage AND has no children.
Archiving it archives the whole lineage — the expected behavior for
templates that were never versioned.

## Path parameters

- `template_id` string, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/roxels/apis/interviewer.md) · [All operations](https://skmtc.dev/roxels/apis/interviewer/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/roxels/interviewer/revisions/4ef48ed226e1/schema)
