Skip to main content
POST
https://api.novita.ai
/
gpu-instance
/
openapi
/
v1
/
template
/
update
Edit Template
curl --request POST \
  --url https://api.novita.ai/gpu-instance/openapi/v1/template/update \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "template": {
    "Id": "<string>",
    "name": "<string>",
    "readme": "<string>",
    "type": "<string>",
    "channel": "<string>",
    "image": "<string>",
    "imageAuth": "<string>",
    "startCommand": "<string>",
    "entrypoint": "<string>",
    "rootfsSize": 123,
    "ports": [
      {
        "type": "<string>",
        "ports": [
          123
        ]
      }
    ],
    "envs": [
      {
        "key": "<string>",
        "value": "<string>"
      }
    ],
    "minCudaVersion": "<string>"
  }
}
'
{
  "templateId": "<string>"
}

Request Headers

Content-Type
string
required
Enum: application/json
Authorization
string
required
Bearer authentication format, for example: Bearer {{API Key}}.

Request Body

template
object
required
Template settings.

Response

templateId
string
ID of the updated template.

Example

Request
curl --request POST \
  --url 'https://api.novita.ai/gpu-instance/openapi/v1/template/update' \
  --header 'Authorization: Bearer {{API Key}}' \
  --header 'Content-Type: application/json' \
  --data '{
    "template": {
      "Id": "1",
      "name": "test",
      "readme": "readme",
      "type": "instance",
      "channel": "private",
      "readme": "test create template",
      "image": "nginx",
      "imageAuth": "",
      "startCommand": "echo test",
      "entrypoint": "",
      "rootfsSize": 60,
      "ports": [
        {
          "type": "http",
          "ports": [80, 443]
        },
        {
          "type": "tcp",
          "ports": [90, 95]
        }
      ],
      "envs": [
        {
          "key": "test1",
          "value": "template1"
        },
        {
          "key": "test2",
          "value": "test2"
        }
      ],
      "minCudaVersion": "11.8"
    }
  }'
Response
{
  "templateId": "1"
}