---
title: "Fit Ecm"
method: POST
path: "/ecm/fit"
tags: ["ecm"]
---

# Fit Ecm

`POST /ecm/fit`

Fit an ECM to either an example dataset or an uploaded file.

Provide exactly one of ``example_id`` (query param) or ``file`` (multipart
upload). Returns model-vs-data traces and OCV/R0 parameter curves. RC-pair
parameters are included for superadmins and users in organizations with ECM
results access enabled via nav_config.

When ``fit_ocv`` is False and the data contains an
``Open-circuit voltage [V]`` column, the provided OCV is used directly
and only R0 + RC parameters are fitted.

## Query parameters

- `num_rcs` integer
- `example_id` string, nullable
- `fit_ocv` boolean
- `initial_soc` number, nullable
- `capacity` number, nullable
- `max_points` integer, nullable — Width-derived row ceiling for the returned fit traces. Omitted, the server's own default applies.

## Response `200`

Successful Response

- object

## 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)
