---
title: "Create Optimization Template"
method: POST
path: "/optimization_templates"
tags: ["optimization_templates"]
---

# Create Optimization Template

`POST /optimization_templates`

Create a new project-level optimization template.

Parameters
----------
body : CreateOptimizationTemplate
    Template creation data including the owner project_id.

Returns
-------
OptimizationTemplate
    Created optimization template.

Raises
------
ConflictError
    If a template with the same name already exists in the project.

## Request body

- CreateOptimizationTemplate — Model for creating a new optimization template. Validates initial_form_data against DesignOptimizationDataFitConfigSchema to ensure new templates conform to the current schema.
  - `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.
  - `project_id` string, required — The ID of the project this template belongs to.

## Response `201`

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)
