---
title: "Update Optimization Template"
method: PATCH
path: "/optimization_templates/{template_id}"
tags: ["optimization_templates"]
---

# Update Optimization Template

`PATCH /optimization_templates/{template_id}`

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.

## Path parameters

- `template_id` string, required

## Request body

- UpdateOptimizationTemplate — Model for updating an existing optimization template. Validates initial_form_data against DesignOptimizationDataFitConfigSchema when updating to ensure updated templates conform to the current schema.
  - `name` string, nullable — The new name of the template.
  - `description` string, nullable — The new optional description for the template.
  - `initial_form_data` object, nullable — Updated initial form data values.

## Response `200`

Successful Response

- OptimizationTemplate — Model representing an optimization template as returned by the API.
  - `name` string, required — The name of the optimization template.
  - `description` string, nullable — An optional description for the template.
  - `initial_form_data` object, nullable — Initial form data values.
  - `id` string, required — The unique identifier for the template.
  - `organization_id` string, required — The ID of the organization this template belongs to.
  - `project_id` string, nullable — The ID of the owner project (None for system templates).
  - `access_level` string — Template scope: 'system' for built-in, 'project' for user-created.
  - `created_at` string, date-time, required — Timestamp of when the template was created.
  - `updated_at` string, date-time, required — Timestamp of when the template was last updated.
  - `created_by` string, nullable — User ID of the creator.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/ionworks/apis/fastapi.md) · [All operations](https://skmtc.dev/ionworks/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ionworks/fastapi/revisions/7337a3cbdaf2/schema)
