---
title: "edit template"
method: PUT
path: "/api/v0/template/"
tags: ["Templates"]
---

# edit template

`PUT /api/v0/template/`

Edits an existing template in place.

Templates are mutable. Use PUT with the template's `hash_id` to update it. You only need to include the fields you want to change - unchanged fields retain their existing values.

Note: The template's `hash_id` will change after editing (since it's content-based), but the numeric `id` stays the same.

For detailed usage, see [Creating and Using Templates with API](/api-reference/creating-and-using-templates-with-api).

CLI Usage: `vastai update template <hash_id> [options]`

## Request body

- object
  - `hash_id` string, required — Hash ID of the template to edit. Required for identifying which template to update.
  - `name` string — Name of the template
  - `image` string — Docker image path
  - `desc` string — Short description of the template
  - `recommended_disk_space` number — Recommended disk space in GB

## Response `200`

Template updated successfully

- object
  - `success` boolean
  - `template` object
    - `id` integer — Template numeric ID (unchanged after edit)
    - `hash_id` string — Updated template hash ID (changes based on content)

## Other responses

- `401` — Unauthorized - invalid or missing API key
- `404` — Template not found

---

[API](https://skmtc.net/vast/apis/vast-ai-api.md) · [All operations](https://skmtc.net/vast/apis/vast-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vast/vast-ai-api/revisions/4ed14f79f796/schema)
