---
title: "Delete a template or a specific version."
method: DELETE
path: "/template/{templateId-or-versionId}"
tags: ["Template"]
---

# Delete a template or a specific version.

`DELETE /template/{templateId-or-versionId}`

## Request

- Base URL: `https://api.carbone.io`
- URL: `https://api.carbone.io/template/{templateId-or-versionId}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/carbone/apis/carbone-api/docs/template/:templateId-or-versionId/delete.ts> (a function with typed inputs; its response is checked against the schema)

Removes a specific template or a specific version of a template from the Carbone storage. This endpoint accepts both the `templateId` and `versionId`, enabling precise control over which templates or versions are deleted.

### Features
- Template and Version Deletion: Deletes either the entire template, including all its versions, when using a `templateId`, or a specific version of a template when using a `versionId`.
- Soft Deletion Mechanism: The deletion process sets the `expireAt` timestamp to the current time: the template immediately stops being returned by the API, then the file is removed once the server's retention delay has passed (Carbone Cloud: 24 hours). This is equivalent to calling `PATCH /template/{id}` with `expireAt` set to the current timestamp.
- Bulk Version Deletion: When a `templateId` is specified, all versions of the template are marked for deletion unless otherwise specified.

### Parameters
The ID of the template or version to delete. This can be a `templateId` to delete an entire template and its versions, or a `versionId` to delete a specific version.

### Use Case
Ideal for managing the lifecycle of templates, such as cleaning up outdated versions, removing obsolete templates, or archiving specific versions while maintaining the overall template integrity.

## Path parameters

- `templateId-or-versionId` string, required

## Headers

- `carbone-version` '5' | '4' | '3' | 'staging', required

## Response `200`

The template is deleted

- object
  - `success` boolean
  - `message` string

## Other responses

- `400`: The template ID in the URL is not valid, or the template could not be deleted.
- `401`: Unauthorized, please provide a correct API key on the `Authorization` header. The API key is available on your Carbone account: https://account.carbone.io.
- `404`: The template is not found
- `500`: Server or Database Error.

## Changes

- **2026-11-06** `c06cc573e3b0`: 2 breaking, 6 info
  - the `carbone-version` request header's property undefined was restricted to a list of enum values
  - the `header` request parameter `carbone-version` was restricted to a list of enum values
  - added the new enum value `3` to the `header` request parameter `carbone-version`
  - added the new enum value `4` to the `header` request parameter `carbone-version`
  - …4 more

[Operation history](https://skmtc.dev/carbone/apis/carbone-api/changes/template/:templateId-or-versionId/delete.md)

---

[API](https://skmtc.dev/carbone/apis/carbone-api.md) - [All operations](https://skmtc.dev/carbone/apis/carbone-api/llms.txt) - [OpenAPI document](https://skmtc.dev/carbone/apis/carbone-api/revisions/c06cc573e3b0?raw)
