# Delete Template Version

> Remove one version from a template's timeline

- **URL**: https://orshot.com/docs/api-reference/template-version-delete

---

Version history endpoints are available to first party clients like the
[Orshot MCP server](https://orshot.com/agents) and workspaces on the
Enterprise plan. Checkout the [Enterprise
Pricing](https://orshot.com/pricing) to get access.

Deletes one version. Deleting a named version frees one of the plan's named slots. The live template is not affected.

## Endpoint

```markdown tab="Endpoint"
https://api.orshot.com/v1/studio/templates/:templateId/versions/:versionId
```

## URL Parameters

| Parameter    | Type    | Required | Description               |
| ------------ | ------- | -------- | ------------------------- |
| `templateId` | Integer | Yes      | ID of the studio template |
| `versionId`  | Integer | Yes      | ID of the version         |

## Request

**Request**
```js
await fetch("https://api.orshot.com/v1/studio/templates/12345/versions/48", {
  method: "DELETE",
  headers: { Authorization: "Bearer <ORSHOT_API_KEY>" },
});
```

**Response**
```json
{ "success": true, "id": 48 }
```

## Error Responses

| Status Code | Code                  | Description                                            |
| ----------- | --------------------- | ------------------------------------------------------ |
| 400         | `invalid_version_id`  | `versionId` is not a numeric id                        |
| 403         | `enterprise_required` | API key without the Enterprise version history feature |
| 404         | `VERSION_NOT_FOUND`   | No such version on this template                       |
| 500         | `DELETE_FAILED`       | Server-side error                                      |