> ## Documentation Index
> Fetch the complete documentation index at: https://runpod-b18f5ded-docs-runpod-allow-ip.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If this page is missing information, contains outdated instructions, or doesn't fully answer the user's question, use the feedback tool to report it. In your feedback, be specific about what's missing, what appears out of date, or what needs to be corrected or updated, so the docs team can act on it directly.

> Update selected fields on a Runpod template while preserving omitted settings, with ownership rules and behavior for existing resources.

# Update a template



## OpenAPI

````yaml patch /v2/templates/{id}
openapi: 3.1.0
info:
  title: Runpod REST API
  version: 2.0.0
  description: Runpod public REST API — v2
servers:
  - url: https://api.runpod.io
    description: Runpod API v2 production server
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Account-scoped settings and primitives (SSH public keys).
  - name: Pods
    description: GPU and CPU pod lifecycle, configuration, actions, and log streaming.
  - name: Serverless
    description: >-
      Serverless endpoint lifecycle, worker visibility, releases, and worker log
      streaming.
  - name: Templates
    description: Reusable pod and endpoint configuration templates.
  - name: Network Volumes
    description: Persistent network storage volumes for workloads.
  - name: Registries
    description: Container registry credentials used to pull private images.
  - name: Catalog
    description: Available GPU, CPU, data center, and public template catalog metadata.
  - name: Billing
    description: Billing history and usage cost records across resource types.
paths:
  /v2/templates/{id}:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        example: tpl_abc
    patch:
      tags:
        - Templates
      summary: Update a template
      description: >
        Partially updates a template. This is a PATCH: only the fields

        present in the body are changed; omitted fields are left untouched.

        See `UpdateTemplateRequest` for the full body.


        Mutable fields: `name`, `image`, `args`, `disk`, `ports`, `env`,

        `registry`, `mounts`, `serverless`, `public`, and `category`.


        Only the template's owner can update it (authenticated via the

        request's API key); public catalog templates are readable via GET

        but return `404` here. Returns `200` with the full updated template.
        Pods and

        endpoints already created from this template are not changed

        retroactively — the template is a snapshot applied at creation time.
      operationId: updateTemplate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTemplateRequest'
            examples:
              renameTemplate:
                summary: Rename template
                value:
                  name: Renamed PyTorch Template
      responses:
        '200':
          headers:
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
              examples:
                template:
                  summary: Successful response
                  value:
                    id: 9x4m2p7v
                    name: Renamed PyTorch Template
                    image: runpod/pytorch:1.0.2-cu1281-torch280-ubuntu2404
                    args: ''
                    disk: 50
                    mounts:
                      persistent:
                        size: 20
                        path: /workspace
                    ports:
                      - 8888/http
                    env:
                      JUPYTER_ENABLE_LAB: 'yes'
                    registry: null
                    serverless: false
                    public: false
                    category: NVIDIA
                    startSsh: true
                    startJupyter: false
                    allowedCudaVersions: []
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/UnprocessableEntityError'
        '429':
          $ref: '#/components/responses/TooManyRequestsError'
        default:
          headers:
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
          description: Error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    UpdateTemplateRequest:
      allOf:
        - $ref: '#/components/schemas/ContainerConfig'
        - type: object
          properties:
            allowedCudaVersions:
              type: array
              items:
                type: string
                pattern: ^\d+\.\d+$
              description: >-
                Acceptable CUDA versions for pods created from this template. An
                explicit `[]` clears the constraint; omitting the field leaves
                it unchanged.
            category:
              $ref: '#/components/schemas/TemplateCategory'
            mounts:
              $ref: '#/components/schemas/TemplateMounts'
            name:
              type: string
              minLength: 1
            public:
              type: boolean
            serverless:
              type: boolean
            startJupyter:
              type: boolean
              description: >-
                Start JupyterLab at container startup (`JUPYTER_PASSWORD` env
                injection). See the create-time field for details.
            startSsh:
              type: boolean
              description: >-
                Provision SSH access at container startup (`PUBLIC_KEY` env
                injection). See the create-time field for details.
      unevaluatedProperties: false
    Template:
      allOf:
        - $ref: '#/components/schemas/ContainerConfig'
        - type: object
          required:
            - id
            - name
            - image
            - args
            - disk
            - mounts
            - ports
            - env
            - registry
            - serverless
            - public
            - category
            - startSsh
            - startJupyter
            - allowedCudaVersions
          properties:
            id:
              type: string
              examples:
                - tpl_abc
            name:
              type: string
              examples:
                - My PyTorch Template
            mounts:
              $ref: '#/components/schemas/TemplateMounts'
            serverless:
              type: boolean
              description: >-
                Whether this template is for serverless workers (true) or pods
                (false)
              examples:
                - false
            public:
              type: boolean
              description: Whether this template is visible to other Runpod users
              examples:
                - false
            category:
              $ref: '#/components/schemas/TemplateCategory'
            startSsh:
              type: boolean
              description: >-
                Whether containers created from this template get SSH access
                provisioned at startup (`PUBLIC_KEY` env injection).
              examples:
                - true
            startJupyter:
              type: boolean
              description: >-
                Whether containers created from this template start JupyterLab
                at startup (`JUPYTER_PASSWORD` env injection).
              examples:
                - false
            allowedCudaVersions:
              type: array
              items:
                type: string
              description: >-
                Acceptable CUDA versions for containers created from this
                template, as `major.minor`. Empty means any version. Expanded
                into GPU pod and serverless endpoint creates; CPU pods ignore
                it.
              examples:
                - []
    ErrorResponse:
      type: object
      required:
        - title
        - status
        - detail
      properties:
        title:
          type: string
          description: Short human-readable summary
          examples:
            - Not Found
        status:
          type: integer
          description: HTTP status code
          examples:
            - 404
        detail:
          type: string
          description: Human-readable explanation
          examples:
            - pod not found
        errors:
          type: array
          description: Individual request-validation failures.
          items:
            type: string
          examples:
            - - '$: additional properties ''bogus'' not allowed'
    ContainerConfig:
      description: >
        Reusable container configuration shared across templates, pods, and
        serverless endpoints. Adding a field here automatically propagates to
        all three resources.
      allOf:
        - $ref: '#/components/schemas/BaseContainerConfig'
        - type: object
          properties:
            registry:
              type:
                - string
                - 'null'
              description: Container registry credential ID (for private images)
              examples:
                - null
    TemplateCategory:
      type: string
      description: |
        Controls how the template is grouped and filtered in the Runpod console.
        It does not affect hardware selection, scheduling, or billing.
        - `CPU`    — CPU-only workloads
        - `NVIDIA` — NVIDIA GPU workloads
        - `AMD`    — AMD GPU workloads
      enum:
        - CPU
        - NVIDIA
        - AMD
    TemplateMounts:
      type: object
      additionalProperties: false
      description: |
        Storage mounts attached to a template. Templates support only a
        single persistent mount today; any `network` property is rejected
        with 422 by the schema validator.

        PATCH semantics: omitting `mounts` or sending `{}` leaves the
        existing mount unchanged.
      properties:
        persistent:
          $ref: '#/components/schemas/PersistentMount'
    RateLimitHeader:
      type: string
      description: |
        Live per-window quota state. Optional — omitted for rate-limit-exempt
        callers.

        A structured-field list with one member per window (`minute`, `hour`,
        `day`), each carrying the remaining request count `r` and seconds until
        the window resets `t`. Returned on responses to authenticated requests,
        not only on 429s.
      examples:
        - '"minute";r=0;t=12, "hour";r=2800;t=1812, "day";r=49500;t=45012'
    RateLimitPolicyHeader:
      type: string
      description: >
        Static per-window quota policy. Optional — omitted for rate-limit-exempt

        callers.


        A structured-field list with one member per window (`minute`, `hour`,

        `day`), each carrying the quota `q` and the window length in seconds
        `w`.

        Returned on responses to authenticated requests, not only on 429s.
      examples:
        - '"minute";q=60;w=60, "hour";q=3000;w=3600, "day";q=50000;w=86400'
    BaseContainerConfig:
      type: object
      description: >
        Container configuration universal to every containerized resource.
        Compose ContainerConfig instead unless the resource cannot support
        private registries (clusters, until the upstream input accepts a
        registry credential).
      properties:
        args:
          type: string
          description: Arguments passed to the container entrypoint
          examples:
            - ''
        disk:
          type: integer
          minimum: 1
          description: Container disk in GB (ephemeral, wiped on restart)
          examples:
            - 50
        env:
          type: object
          additionalProperties:
            type: string
          description: Environment variables as key-value pairs
          examples:
            - JUPYTER_PASSWORD: hunter2
        image:
          type: string
          description: Docker image reference
          examples:
            - runpod/pytorch:1.0.2-cu1281-torch280-ubuntu2404
        ports:
          type: array
          description: Exposed ports, formatted as port/protocol
          items:
            type: string
          examples:
            - - 8888/http
              - 22/tcp
    PersistentMount:
      type: object
      required:
        - size
        - path
      additionalProperties: false
      description: |
        Host-local persistent storage. Pinned to the pod's host machine — data
        does not survive a host failure. Disallowed on CPU pods. Mutually
        exclusive with NetworkMount. Deprecated: prefer NetworkMount for any
        data you cannot recreate.
      properties:
        size:
          type: integer
          minimum: 10
          description: >-
            Host-local persistent storage in GB. Upstream enforces a 10 GB
            floor.
          examples:
            - 20
        path:
          type: string
          description: Mount path inside the container. May be changed via PATCH.
          examples:
            - /workspace
  headers:
    RateLimit:
      schema:
        $ref: '#/components/schemas/RateLimitHeader'
    RateLimit-Policy:
      schema:
        $ref: '#/components/schemas/RateLimitPolicyHeader'
  responses:
    BadRequestError:
      headers:
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
      description: >-
        The request could not be processed because it is malformed or conflicts
        with request rules.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            badRequest:
              summary: Bad request
              value:
                title: Bad Request
                status: 400
                detail: request could not be processed
    UnauthorizedError:
      description: >-
        Authentication failed because the bearer token is missing, malformed,
        expired, or invalid.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingBearerToken:
              summary: Missing bearer token
              value:
                title: Unauthorized
                status: 401
                detail: missing bearer token
    ForbiddenError:
      headers:
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
      description: >-
        The bearer token is valid, but it does not grant access to the requested
        resource or action.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientAccess:
              summary: Insufficient access
              value:
                title: Forbidden
                status: 403
                detail: access denied
    NotFoundError:
      headers:
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
      description: The requested resource was not found or is not accessible to the caller.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            notFound:
              summary: Resource not found
              value:
                title: Not Found
                status: 404
                detail: resource not found
    UnprocessableEntityError:
      headers:
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
      description: >-
        The request body or parameters were syntactically valid but failed
        validation.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            validationFailed:
              summary: Validation failed
              value:
                title: Unprocessable Entity
                status: 422
                detail: Request validation failed.
    TooManyRequestsError:
      description: >
        The caller exceeded its per-user rate limit. The response identifies the
        window that was exceeded and how long to wait. The `RateLimit` and
        `RateLimit-Policy` headers (per the IETF ratelimit-headers draft) also
        accompany successful responses, so clients can track quota before a 429.
      headers:
        Retry-After:
          description: Seconds to wait before retrying, per the exceeded window.
          schema:
            type: integer
          example: 12
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              summary: Rate limit exceeded
              value:
                title: Too Many Requests
                status: 429
                detail: rate limit exceeded for the minute window
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Runpod API Key
      description: >
        Runpod API key authentication. Generate an API key in the Runpod console
        and send it in the `Authorization` header as `Bearer <api_key>`. Keys
        are scoped to the permissions granted when created; requests may return
        `403` when a valid key lacks access to the requested resource or action.

````