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

# Update Optimization Template

> Update the name and/or description of a project-level optimization template.

Parameters
----------
template_id : str
    The ID of the template to update.
body : UpdateOptimizationTemplate
    Fields to update (name, description).

Returns
-------
OptimizationTemplate
    The updated template.

Raises
------
NotFoundError
    If no template with the given ID exists.
ConflictError
    If a template with the new name already exists in the project.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json patch /optimization_templates/{template_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /optimization_templates/{template_id}:
    patch:
      tags:
        - optimization_templates
      summary: Update Optimization Template
      description: >-
        Update the name and/or description of a project-level optimization
        template.


        Parameters

        ----------

        template_id : str
            The ID of the template to update.
        body : UpdateOptimizationTemplate
            Fields to update (name, description).

        Returns

        -------

        OptimizationTemplate
            The updated template.

        Raises

        ------

        NotFoundError
            If no template with the given ID exists.
        ConflictError
            If a template with the new name already exists in the project.
      operationId: update_optimization_template_optimization_templates__template_id__patch
      parameters:
        - name: template_id
          in: path
          required: true
          schema:
            type: string
            title: Template Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOptimizationTemplate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OptimizationTemplate'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpdateOptimizationTemplate:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: The new name of the template.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: The new optional description for the template.
        initial_form_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Initial Form Data
          description: Updated initial form data values.
      type: object
      title: UpdateOptimizationTemplate
      description: >-
        Model for updating an existing optimization template.


        Validates initial_form_data against
        DesignOptimizationDataFitConfigSchema

        when updating to ensure updated templates conform to the current schema.
    OptimizationTemplate:
      properties:
        name:
          type: string
          title: Name
          description: The name of the optimization template.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: An optional description for the template.
        initial_form_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Initial Form Data
          description: Initial form data values.
        id:
          type: string
          title: Id
          description: The unique identifier for the template.
        organization_id:
          type: string
          title: Organization Id
          description: The ID of the organization this template belongs to.
        project_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Project Id
          description: The ID of the owner project (None for system templates).
        access_level:
          type: string
          title: Access Level
          description: 'Template scope: ''system'' for built-in, ''project'' for user-created.'
          default: project
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp of when the template was created.
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Timestamp of when the template was last updated.
      type: object
      required:
        - name
        - id
        - organization_id
        - created_at
        - updated_at
      title: OptimizationTemplate
      description: Model representing an optimization template as returned by the API.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````