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

# /templates/{template_id}/update

> Update an existing template



## OpenAPI

````yaml post /templates/{template_id}/update
openapi: 3.0.0
info:
  description: >-
    Shadeform is a single API and platform for deploying and managing cloud
    GPUs.
  version: 1.0.0
  title: Shadeform API
  contact:
    name: Shadeform
    email: support@shadeform.ai
    url: https://www.shadeform.ai
servers:
  - description: Shadeform Production
    url: https://api.shadeform.ai/v1
security:
  - ApiKeyAuth: []
paths:
  /templates/{template_id}/update:
    parameters:
      - in: path
        name: template_id
        required: true
        schema:
          type: string
        description: The template ID
    post:
      summary: /templates/{template_id}/update
      description: Update an existing template
      operationId: TemplatesUpdate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateSaveRequest'
      responses:
        '200':
          description: Template updated successfully
components:
  schemas:
    TemplateSaveRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          example: My Template
          description: Name of the template
        description:
          type: string
          example: A template for ML workloads
          description: Description of the template
        public:
          type: boolean
          example: true
          description: Whether the template is publicly available
        launch_configuration:
          $ref: '#/components/schemas/LaunchConfiguration'
        auto_delete:
          $ref: '#/components/schemas/AutoDelete'
        alert:
          $ref: '#/components/schemas/Alert'
          description: Alert configuration
        volume_mount:
          $ref: '#/components/schemas/VolumeMount'
          description: Volume mount configuration
        tags:
          type: array
          items:
            type: string
          example:
            - ml
            - pytorch
          description: Tags associated with the template
        envs:
          type: array
          items:
            $ref: '#/components/schemas/Env'
          description: Environment variables for the template
        networking:
          $ref: '#/components/schemas/Networking'
          description: Network and firewall configuration
    LaunchConfiguration:
      type: object
      required:
        - type
      description: Defines automatic actions after the instance becomes active.
      properties:
        type:
          type: string
          example: docker
          enum:
            - docker
            - script
          description: >-
            Specifies the type of launch configuration. See [Launch
            Configuration](/getting-started/concepts#launch-configuration) for
            more details.
        docker_configuration:
          $ref: '#/components/schemas/DockerConfiguration'
        script_configuration:
          $ref: '#/components/schemas/ScriptConfiguration'
    AutoDelete:
      type: object
      description: Set a date or spend threshold to automatically delete the instance
      properties:
        date_threshold:
          $ref: '#/components/schemas/DateThreshold'
        spend_threshold:
          $ref: '#/components/schemas/SpendThreshold'
    Alert:
      type: object
      description: Set a date or spend threshold to receive an email alert
      properties:
        date_threshold:
          $ref: '#/components/schemas/DateThreshold'
        spend_threshold:
          $ref: '#/components/schemas/SpendThreshold'
    VolumeMount:
      type: object
      description: Settings for mounting volumes onto file systems
      properties:
        auto:
          type: boolean
          description: >-
            Set to true to automatically mount unmounted disks to a default
            filesystem.
    Env:
      type: object
      required:
        - name
        - value
      description: Environment variables for the container image.
      properties:
        name:
          type: string
          example: HUGGING_FACE_HUB_TOKEN
          description: Name of the environment variable
        value:
          type: string
          example: hugging_face_api_token
          description: Value of the environment variable
    Networking:
      type: object
      description: Network configuration including firewall rules
      properties:
        ufw_rules:
          type: array
          items:
            $ref: '#/components/schemas/UfwRule'
          description: List of UFW (Uncomplicated Firewall) rules
    DockerConfiguration:
      type: object
      required:
        - image
      description: >-
        May only be used if launch_configuration.type is 'docker'. Use
        docker_configuration to automatically pull and run a docker image. See
        this [tutorial](/guides/dockercontainers) for examples.
      properties:
        image:
          type: string
          example: vllm/vllm-openai:latest
          description: >-
            Specifies the docker image to be pulled and run on the instance at
            startup.
        args:
          type: string
          example: '--model mistralai/Mistral-7B-v0.1'
          description: Specifies the container arguments passed into the image at runtime.
        shared_memory_in_gb:
          type: integer
          example: 8
          description: >-
            Describes the amount of shared memory allocated for the container.
            Equivalent to using the --shm-size flag in the docker cli. If
            shared_memory_in_gb is not specified, then the container will use
            the host namespace which is the equivalent of --ipc=host.
        envs:
          type: array
          description: >-
            List of environment variable name-value pairs that will be passed to
            the docker container.
          items:
            $ref: '#/components/schemas/Env'
        port_mappings:
          type: array
          description: >-
            List of port mappings between the host instance and the docker
            container. Equivalent of -p flag for docker run command.
          items:
            $ref: '#/components/schemas/PortMappings'
        volume_mounts:
          type: array
          description: >-
            List of volume mounts between the host instance and the docker
            container. Equivalent of -v flag for docker run command.
          items:
            $ref: '#/components/schemas/VolumeMounts'
        registry_credentials:
          $ref: '#/components/schemas/RegistryCredentials'
    ScriptConfiguration:
      type: object
      required:
        - base64_script
      description: >-
        May only be used if launch_configuration.type is 'script'. Configures a
        startup script to be run automatically after the instance is active. See
        this [tutorial]/guides/startupscript) for examples.
      properties:
        base64_script:
          type: string
          description: A startup script that is base64 encoded.
          example: >-
            IyEvYmluL2Jhc2gKCiMgRW5kbGVzcyBsb29wCndoaWxlIHRydWUKZG8KICAgICMgRmV0Y2ggYSBjYXQgZmFjdCB3aXRoIGEgbWF4aW11bSBsZW5ndGggb2YgMTQwIGNoYXJhY3RlcnMKICAgIGN1cmwgLS1uby1wcm9ncmVzcy1tZXRlciBodHRwczovL2NhdGZhY3QubmluamEvZmFjdD9tYXhfbGVuZ3RoPTE0MAoKICAgICMgUHJpbnQgYSBuZXdsaW5lIGZvciByZWFkYWJpbGl0eQogICAgZWNobwoKICAgICMgU2xlZXAgZm9yIDMgc2Vjb25kcyBiZWZvcmUgdGhlIG5leHQgaXRlcmF0aW9uCiAgICBzbGVlcCAzCmRvbmUKCgo=
    DateThreshold:
      type: string
      example: '2006-01-02T15:04:05-07:00'
      description: RFC3339 date string
    SpendThreshold:
      type: string
      example: '3.14'
      description: Valid decimal representation of a dollar amount
    UfwRule:
      type: object
      description: Uncomplicated Firewall rule configuration
      properties:
        rule:
          type: string
          example: allow
          description: The UFW rule action
        from_ip:
          type: string
          example: 192.168.1.0/24
          nullable: true
          description: Source IP address or CIDR range
        to_ip:
          type: string
          example: 10.0.0.0/8
          nullable: true
          description: Destination IP address or CIDR range
        port:
          type: string
          example: '80'
          nullable: true
          description: Port number or range (e.g. '80' or '8000:8999')
        proto:
          type: string
          example: tcp
          nullable: true
          description: Protocol (e.g. tcp, udp)
    PortMappings:
      type: object
      required:
        - host_port
        - container_port
      description: Maps the public instance port to a port on the container.
      properties:
        host_port:
          type: integer
          example: 80
          description: Port of the host.
        container_port:
          type: integer
          example: 8000
          description: Port of the container.
    VolumeMounts:
      type: object
      required:
        - host_path
        - container_path
      description: Mounts the host volume to a container file path.
      properties:
        host_path:
          type: string
          example: ~/.cache/huggingface
          description: Filepath of the host.
        container_path:
          type: string
          example: /root/.cache/huggingface
          description: Filepath of the container.
    RegistryCredentials:
      type: object
      properties:
        username:
          type: string
          example: username
          description: The username for the docker registry.
        password:
          type: string
          example: password
          description: The password for the docker registry.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````