---
title: "Cancel Optimization"
method: POST
path: "/optimizations/{id}/cancel"
tags: ["optimizations"]
---

# Cancel Optimization

`POST /optimizations/{id}/cancel`

## Request

- Base URL: `https://api.ionworks.com`
- URL: `https://api.ionworks.com/optimizations/{id}/cancel`
- Auth: none declared

Cancel an optimization and return the refreshed resource.

## Path parameters

- `id` string, uuid, required

## Response `200`

Successful Response

- OptimizationResource: Frontend-facing view of an optimization. Replaces the job-centric ``{optimization, job}`` payload: the linked job is collapsed into a flat ``status`` plus result ``metrics`` and error fields, so clients never see the underlying job. Heavy config and metadata blobs are served by dedicated sub-resource endpoints rather than inlined here.
  - `id` string, required: Canonical optimization identifier.
  - `name` string, nullable
  - `description` string, nullable
  - `project_id` string, required
  - `organization_id` string, required
  - `status` 'queued' | 'running' | 'succeeded' | 'failed' | 'canceled': Frontend-facing lifecycle status for an async resource.
  - `kind` string, nullable: Optimization kind discriminator (e.g. 'optimize', 'datafit'); determines how the config is interpreted.
  - `created_at` string, date-time, nullable
  - `created_by_email` string, nullable
  - `cell_spec_id` string, nullable
  - `parameterized_model_id` string, nullable
  - `parameterized_model_name` string, nullable: Display name of the parameterized model.
  - `cell_name` string, nullable: Display name of the cell specification.
  - `optimization_template_id` string, nullable
  - `metrics` object, nullable: Result metrics of the optimization, when complete.
  - `objectives` object, nullable: Objectives/constraints from the config, for list display. Populated on list responses only.
  - `error` string, nullable: Error message if the run failed.
  - `error_code` string, nullable: Machine-readable error code.
  - `run_count` integer: Number of multistart runs.

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-30** `ea3d377fec1a`: 1 breaking
  - for the `path` request parameter `id`, the format changed from no format to `uuid`

[Operation history](https://skmtc.dev/ionworks/apis/ionworks-api/changes/optimizations/:id/cancel/post.md)

---

[API](https://skmtc.dev/ionworks/apis/ionworks-api.md) - [All operations](https://skmtc.dev/ionworks/apis/ionworks-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ionworks/apis/ionworks-api/revisions/abebbbc5f60a?raw)
