# Update Template - Documentation

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/api-reference/gpus-v2-update-template

# Update Template

PUT

/

gpus

/

v2

/

templates

/

{template_id}

Try it

Update Template

cURL

```
curl --request PUT \
--url https://api.novita.ai/gpus/v2/templates/{template_id} \
--header 'Authorization: &#x3C;authorization>' \
--header 'Content-Type: &#x3C;content-type>' \
--data '
{
"name": "pytorch-2.3-cuda12",
"type": "instance",
"image": "registry.example.com/ml/pytorch:2.3-cuda12",
"registry_auth_id": "auth-001",
"command": "jupyter lab --ip=0.0.0.0",
"entrypoint": "/bin/bash",
"rootfs_size_gb": 50,
"ports": [
{
"protocol": "http",
"port": 8888
}
],
"envs": [
{
"key": "ENV",
"value": "prod"
}
],
"metadata": {
"readme": "PyTorch 2.3 with CUDA 12",
"logo": "https://example.com/logo.png",
"description": "Updated PyTorch development template",
"tags": [
"pytorch",
"cuda"
]
},
"min_cuda_version": "12.2"
}
'
```

```
import requestsurl = "https://api.novita.ai/gpus/v2/templates/{template_id}"payload = { "name": "pytorch-2.3-cuda12", "type": "instance", "image": "registry.example.com/ml/pytorch:2.3-cuda12", "registry_auth_id": "auth-001", "command": "jupyter lab --ip=0.0.0.0", "entrypoint": "/bin/bash", "rootfs_size_gb": 50, "ports": [ { "protocol": "http", "port": 8888 } ], "envs": [ { "key": "ENV", "value": "prod" } ], "metadata": { "readme": "PyTorch 2.3 with CUDA 12", "logo": "https://example.com/logo.png", "description": "Updated PyTorch development template", "tags": ["pytorch", "cuda"] }, "min_cuda_version": "12.2"}headers = { "Content-Type": "&#x3C;content-type>", "Authorization": "&#x3C;authorization>"}response = requests.put(url, json=payload, headers=headers)print(response.text)
```

```
const options = { method: 'PUT', headers: {'Content-Type': '&#x3C;content-type>', Authorization: '&#x3C;authorization>'}, body: JSON.stringify({ name: 'pytorch-2.3-cuda12', type: 'instance', image: 'registry.example.com/ml/pytorch:2.3-cuda12', registry_auth_id: 'auth-001', command: 'jupyter lab --ip=0.0.0.0', entrypoint: '/bin/bash', rootfs_size_gb: 50, ports: [{protocol: 'http', port: 8888}], envs: [{key: 'ENV', value: 'prod'}], metadata: { readme: 'PyTorch 2.3 with CUDA 12', logo: 'https://example.com/logo.png', description: 'Updated PyTorch development template', tags: ['pytorch', 'cuda'] }, min_cuda_version: '12.2' })};fetch('https://api.novita.ai/gpus/v2/templates/{template_id}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
```

```
&#x3C;?php$curl = curl_init();curl_setopt_array($curl, [ CURLOPT_URL => "https://api.novita.ai/gpus/v2/templates/{template_id}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_POSTFIELDS => json_encode([ 'name' => 'pytorch-2.3-cuda12', 'type' => 'instance', 'image' => 'registry.example.com/ml/pytorch:2.3-cuda12', 'registry_auth_id' => 'auth-001', 'command' => 'jupyter lab --ip=0.0.0.0', 'entrypoint' => '/bin/bash', 'rootfs_size_gb' => 50, 'ports' => [ [ 'protocol' => 'http', 'port' => 8888 ] ], 'envs' => [ [ 'key' => 'ENV', 'value' => 'prod' ] ], 'metadata' => [ 'readme' => 'PyTorch 2.3 with CUDA 12', 'logo' => 'https://example.com/logo.png', 'description' => 'Updated PyTorch development template', 'tags' => [ 'pytorch', 'cuda' ] ], 'min_cuda_version' => '12.2' ]), CURLOPT_HTTPHEADER => [ "Authorization: &#x3C;authorization>", "Content-Type: &#x3C;content-type>" ],]);$response = curl_exec($curl);$err = curl_error($curl);curl_close($curl);if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}
```

```
package mainimport (	"fmt"	"strings"	"net/http"	"io")func main() {	url := "https://api.novita.ai/gpus/v2/templates/{template_id}"	payload := strings.NewReader("{\n \"name\": \"pytorch-2.3-cuda12\",\n \"type\": \"instance\",\n \"image\": \"registry.example.com/ml/pytorch:2.3-cuda12\",\n \"registry_auth_id\": \"auth-001\",\n \"command\": \"jupyter lab --ip=0.0.0.0\",\n \"entrypoint\": \"/bin/bash\",\n \"rootfs_size_gb\": 50,\n \"ports\": [\n {\n \"protocol\": \"http\",\n \"port\": 8888\n }\n ],\n \"envs\": [\n {\n \"key\": \"ENV\",\n \"value\": \"prod\"\n }\n ],\n \"metadata\": {\n \"readme\": \"PyTorch 2.3 with CUDA 12\",\n \"logo\": \"https://example.com/logo.png\",\n \"description\": \"Updated PyTorch development template\",\n \"tags\": [\n \"pytorch\",\n \"cuda\"\n ]\n },\n \"min_cuda_version\": \"12.2\"\n}")	req, _ := http.NewRequest("PUT", url, payload)	req.Header.Add("Content-Type", "&#x3C;content-type>")	req.Header.Add("Authorization", "&#x3C;authorization>")	res, _ := http.DefaultClient.Do(req)	defer res.Body.Close()	body, _ := io.ReadAll(res.Body)	fmt.Println(string(body))}
```

```
HttpResponse&#x3C;String> response = Unirest.put("https://api.novita.ai/gpus/v2/templates/{template_id}") .header("Content-Type", "&#x3C;content-type>") .header("Authorization", "&#x3C;authorization>") .body("{\n \"name\": \"pytorch-2.3-cuda12\",\n \"type\": \"instance\",\n \"image\": \"registry.example.com/ml/pytorch:2.3-cuda12\",\n \"registry_auth_id\": \"auth-001\",\n \"command\": \"jupyter lab --ip=0.0.0.0\",\n \"entrypoint\": \"/bin/bash\",\n \"rootfs_size_gb\": 50,\n \"ports\": [\n {\n \"protocol\": \"http\",\n \"port\": 8888\n }\n ],\n \"envs\": [\n {\n \"key\": \"ENV\",\n \"value\": \"prod\"\n }\n ],\n \"metadata\": {\n \"readme\": \"PyTorch 2.3 with CUDA 12\",\n \"logo\": \"https://example.com/logo.png\",\n \"description\": \"Updated PyTorch development template\",\n \"tags\": [\n \"pytorch\",\n \"cuda\"\n ]\n },\n \"min_cuda_version\": \"12.2\"\n}") .asString();
```

```
require 'uri'require 'net/http'url = URI("https://api.novita.ai/gpus/v2/templates/{template_id}")http = Net::HTTP.new(url.host, url.port)http.use_ssl = truerequest = Net::HTTP::Put.new(url)request["Content-Type"] = '&#x3C;content-type>'request["Authorization"] = '&#x3C;authorization>'request.body = "{\n \"name\": \"pytorch-2.3-cuda12\",\n \"type\": \"instance\",\n \"image\": \"registry.example.com/ml/pytorch:2.3-cuda12\",\n \"registry_auth_id\": \"auth-001\",\n \"command\": \"jupyter lab --ip=0.0.0.0\",\n \"entrypoint\": \"/bin/bash\",\n \"rootfs_size_gb\": 50,\n \"ports\": [\n {\n \"protocol\": \"http\",\n \"port\": 8888\n }\n ],\n \"envs\": [\n {\n \"key\": \"ENV\",\n \"value\": \"prod\"\n }\n ],\n \"metadata\": {\n \"readme\": \"PyTorch 2.3 with CUDA 12\",\n \"logo\": \"https://example.com/logo.png\",\n \"description\": \"Updated PyTorch development template\",\n \"tags\": [\n \"pytorch\",\n \"cuda\"\n ]\n },\n \"min_cuda_version\": \"12.2\"\n}"response = http.request(request)puts response.read_body
```

200

```
{
"template_id": "tpl-001"
}
```

#### Headers

[​](#parameter-content-type)

Content-Type

string

required

Allowed value: application/json.

[​](#parameter-authorization)

Authorization

string

required

Bearer authentication format, e.g.: `Bearer {{API_KEY}}`.

#### Path Parameters

[​](#parameter-template-id)

template_id

string

required

Template ID. String, length: 1-255 characters.

#### Body

application/json

[​](#body-name)

name

string

Template name.

Example:

`"pytorch-2.3-cuda12"`

[​](#body-type)

type

string

Template type.

Example:

`"instance"`

[​](#body-image)

image

string

Image address.

Example:

`"registry.example.com/ml/pytorch:2.3-cuda12"`

[​](#body-registry-auth-id)

registry_auth_id

string

Registry authentication ID.

Example:

`"auth-001"`

[​](#body-command)

command

string

Startup command.

Example:

`"jupyter lab --ip=0.0.0.0"`

[​](#body-entrypoint)

entrypoint

string

Image entrypoint.

Example:

`"/bin/bash"`

[​](#body-rootfs-size-gb)

rootfs_size_gb

integer

Root disk size. Unit: GB.

Example:

`50`

[​](#body-ports)

ports

object[]

Exposed port configuration.

Show child attributes

[​](#body-envs)

envs

object[]

Environment variables.

Show child attributes

[​](#body-metadata)

metadata

object

Template metadata.

Show child attributes

[​](#body-min-cuda-version)

min_cuda_version

string

Minimum CUDA version.

Example:

`"12.2"`

#### Response

200 - application/json

OK

[​](#response-template-id)

template_id

string

Template ID

Example:

`"tpl-001"`

Last modified on June 23, 2026
