# Name or Rename a Version

> Give a version a name, or rename a named version

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

---

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.

Naming an automatic version promotes it to a **named version**, which is never pruned and uses one of the plan's named slots. Renaming a named version only changes its label. The in-session checkpoint cannot be named; save first.

## 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 Body

| Field   | Type   | Required | Description                             |
| ------- | ------ | -------- | --------------------------------------- |
| `label` | String | Yes      | Name of the version, 1 to 80 characters |

## Request

**Request**
```js
await fetch("https://api.orshot.com/v1/studio/templates/12345/versions/48", {
  method: "PATCH",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <ORSHOT_API_KEY>",
  },
  body: JSON.stringify({ label: "Before the rebrand" }),
});
```

**Response**
```json
{
  "success": true,
  "version": {
    "id": 48,
    "number": 9,
    "kind": "named",
    "label": "Before the rebrand",
    "protected": true
  }
}
```

## Error Responses

| Status Code | Code                  | Description                                                   |
| ----------- | --------------------- | ------------------------------------------------------------- |
| 400         | `label_required`      | `label` missing or empty                                      |
| 400         | `invalid_label`       | `label` is not a string                                       |
| 400         | `label_too_long`      | `label` is longer than 80 characters                          |
| 400         | `invalid_version_id`  | `versionId` is not a numeric id                               |
| 400         | `NOT_NAMEABLE`        | The in-session checkpoint cannot be named                     |
| 403         | `PLAN_LOCKED`         | Naming versions needs a paid workspace plan                   |
| 403         | `enterprise_required` | API key without the Enterprise version history feature        |
| 404         | `VERSION_NOT_FOUND`   | No such version on this template                              |
| 409         | `NAMED_CAP`           | The plan's named-version slots for this template are used up  |