> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# VastAI.update_template

Update an existing template.

## Signature

```python theme={null}
VastAI.update_template(
    HASH_ID: str,
    name: Optional[str] = None,
    image: Optional[str] = None,
    env: Optional[str] = None,
    onstart_cmd: Optional[str] = None,
    search_params: Optional[str] = None,
    disk: Optional[float] = None,
    ssh: bool = False,
    direct: bool = False,
    jupyter: bool = False
) -> str
```

## Parameters

<ParamField path="HASH_ID" type="str" required>
  Hash ID of the template to update.
</ParamField>

<ParamField path="name" type="Optional[str]">
  New name for the template.
</ParamField>

<ParamField path="image" type="Optional[str]">
  New Docker image for the template.
</ParamField>

<ParamField path="env" type="Optional[str]">
  Environment variables to set (formatted as Docker -e flags).
</ParamField>

<ParamField path="onstart_cmd" type="Optional[str]">
  Shell command to run on instance start.
</ParamField>

<ParamField path="search_params" type="Optional[str]">
  Default search query parameters for this template.
</ParamField>

<ParamField path="disk" type="Optional[float]">
  Disk space allocation in GB.
</ParamField>

<ParamField path="ssh" type="bool" default="False">
  Enable SSH access for instances created from this template.
</ParamField>

<ParamField path="direct" type="bool" default="False">
  Enable direct (peer-to-peer) connections.
</ParamField>

<ParamField path="jupyter" type="bool" default="False">
  Enable Jupyter notebook server.
</ParamField>

## Returns

`str`, Result from the API call.

## Example

```python theme={null}
from vastai import VastAI

client = VastAI(api_key="YOUR_API_KEY")
result = client.update_template(HASH_ID="...")
print(result)
```
