---
title: "Estimate a running measurement's end time from its remaining protocol"
method: PATCH
path: "/cell_measurements/{measurement_id}/estimate_end_time"
tags: ["Cell Measurements"]
---

# Estimate a running measurement's end time from its remaining protocol

`PATCH /cell_measurements/{measurement_id}/estimate_end_time`

Forecast when this still-running test will finish.

Replays the measured steps onto the protocol's state machine, then simulates
only the remainder with the cell specification's default model. Returns
immediately, marked ``estimating``; ``estimated_end_time`` lands when the
simulation finishes.

## Path parameters

- `measurement_id` string, required

## Response `200`

Successful Response

- CellMeasurement
  - `name` string, required
  - `protocol` object, nullable — Protocol information. Typical keys: 'name' (str), 'ambient_temperature_degc' (float), 'definition' (dict | str — a UCP protocol definition or another protocol format).
  - `start_time` string, date-time, nullable — ISO 8601 datetime with timezone (UTC preferred) marking when the test started.
  - `end_time` string, date-time, nullable — ISO 8601 datetime with timezone (UTC preferred) marking when the test finished. Leave null while the test is still running; set it once the measurement is complete. A null end_time means the cell is still considered 'on test' in the Lab view.
  - `estimated_end_time` string, date-time, nullable — ISO 8601 datetime with timezone (UTC preferred) forecasting when a still-running test will finish. Distinct from end_time (the actual finish): this is an estimate. Null when no estimate has been computed yet.
  - `estimated_end_time_note` string, nullable — Free-text explanation of how estimated_end_time was derived.
  - `estimated_end_time_calculated_at` string, date-time, nullable — ISO 8601 datetime with timezone marking when estimated_end_time was last computed.
  - `test_setup` object, nullable — Physical test setup. Typical keys: 'cycler' (model), 'operator', 'lab', 'channel_number' (int).
  - `step_labels_validated` boolean — Set to true only once step-type labels (Rest, CC charge, CV, discharge, etc.) have been manually reviewed. Server-inferred labels should leave this false.
  - `notes` string, nullable — Free-text notes about the cell measurement
  - `measurement_type` 'time_series' | 'file' | 'properties' — Shape of the data stored in a cell measurement. - ``time_series`` — cycling / diagnostic data uploaded as columnar time series (and optional step summaries). Default for new measurements. - ``file`` — an opaque file upload (raw cycler export, image, other binary). Metadata about the file is captured in ``file_metadata``; the file content lives in object storage. - ``properties`` — a flat key/value set of measured properties (thickness, mass, DCIR, initial capacity, …) with no time-series data. Numeric values use the Quantity format.
  - `properties` object, nullable — Flat key/value measurements, populated only when measurement_type is 'properties'. Numeric values use the Quantity format. Example: {'thickness': {'value': 0.52, 'unit': 'mm'}, 'DCIR': {'value': 12, 'unit': 'mohm'}}.
  - `file_metadata` object, nullable — Metadata about uploaded files (MIME types, dimensions, etc.)
  - `channel_id` string, nullable — Optional ID of the channel this measurement ran on.
  - `protocol_id` string, nullable — Optional ID of the experiment template (protocol) this measurement was run against.
  - `program_id` string, nullable — Optional catalog program for this measurement (copied from a linked planned measurement when present).
  - `id` string, required
  - `cell_instance_id` string, required
  - `organization_id` string, required — Organization this measurement belongs to.
  - `project_id` string, required — Project this measurement belongs to
  - `created_by` string, nullable — User ID of the user who created this measurement
  - `created_by_email` string, nullable — Email of the user who created this measurement
  - `processing_status` 'pending' | 'running' | 'ready' | 'failed' | 'awaiting_extend' | 'extending' — Lifecycle of a measurement's step processing, shared with extend. - ``pending`` — confirm-upload task enqueued. - ``running`` — worker parsing the upload or calculating steps. - ``ready`` — terminal success; default for ``file``/``properties``. - ``failed`` — permanent; see ``processing_error``. - ``awaiting_extend`` — claim held, signed URL out, no task queued. - ``extending`` — delta staged, stitch queued or running. Only ``ready`` may start an extend, so it cannot overlap step processing (both write ``steps.parquet``). A failed extend returns to ``ready``.
  - `processing_error` string, nullable — Reason processing failed, when processing_status is 'failed'. Also carries why an extend did not apply, in which case the status is back to 'ready' and this is advisory only.
  - `source_etag` string, nullable
  - `row_count` integer, nullable
  - `time_series_bytes` integer, nullable
  - `estimated_end_time_status` 'estimating' | 'ready' | 'failed' — Lifecycle of a duration estimate computed by a background simulation. Used by both estimates: a planned test's total duration (``planned_measurements.estimated_duration_*``) and a running test's remaining duration (``cell_measurements.estimated_end_time_*``). One enum because the lifecycle is identical -- only what is being estimated differs. ``estimating`` while the job is in flight, ``ready`` once a value came from it, ``failed`` with the reason in the accompanying note. ``None`` means no estimate was ever requested.
  - `estimated_end_time_job_id` string, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `extend_claim_id` string, nullable — Opaque token identifying the in-flight extend that holds this measurement, and the staging prefix its delta is uploaded to. Non-null exactly while processing_status is 'awaiting_extend' or 'extending'.
  - `extend_in_progress_at` string, date-time, nullable — Deprecated and always null. Use processing_status.
  - `extend_claimed_at` string, date-time, nullable — When the in-flight extend claim was taken. Written only by the claim itself, so an unrelated update to the measurement does not age it. Null when no extend holds the measurement.

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