> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ionworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Report a cell measurement as failed, or clear the report

> Mark one test as failed, e.g. a run stopped early or never started.

Only this measurement is marked; its cell is not, and nothing is sent to
the LIMS. To fail the whole cell, use PATCH /cell_instances/{id}/failure.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json patch /cell_measurements/{measurement_id}/failure
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /cell_measurements/{measurement_id}/failure:
    patch:
      tags:
        - Cell Measurements
      summary: Report a cell measurement as failed, or clear the report
      description: >-
        Mark one test as failed, e.g. a run stopped early or never started.


        Only this measurement is marked; its cell is not, and nothing is sent to

        the LIMS. To fail the whole cell, use PATCH
        /cell_instances/{id}/failure.
      operationId: >-
        report_cell_measurement_failure_cell_measurements__measurement_id__failure_patch
      parameters:
        - name: measurement_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Measurement Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportFailureRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeasurementFailureResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ReportFailureRequest:
      properties:
        failed:
          type: boolean
          title: Failed
          description: True to report the failure, False to clear it.
        reason:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Reason
          description: >-
            Why it failed, e.g. 'sat at open circuit for 30 h'. Ignored when
            clearing.
      type: object
      required:
        - failed
      title: ReportFailureRequest
      description: Mark a cell or a measurement as failed, or clear that verdict.
    MeasurementFailureResponse:
      properties:
        measurement:
          $ref: '#/components/schemas/CellMeasurement'
      type: object
      required:
        - measurement
      title: MeasurementFailureResponse
      description: |-
        The measurement after its verdict changed.

        A measurement's verdict is never sent to the LIMS: Uncountable's cell
        failure output describes the cell, and one failed test does not fail it.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CellMeasurement:
      properties:
        is_failed:
          type: boolean
          title: Is Failed
          description: Whether it was reported as failed.
          default: false
        failure_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Failure Reason
          description: Why it failed.
        failed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Failed At
          description: When it was reported.
        failed_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Failed By
          description: User who reported it.
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        protocol:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Protocol
          description: >-
            Protocol information. Typical keys: 'name' (str),
            'ambient_temperature_degc' (float), 'definition' (dict | str — a UCP
            protocol definition or another protocol format).
        start_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Start Time
          description: >-
            ISO 8601 datetime with timezone (UTC preferred) marking when the
            test started.
        end_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End Time
          description: >-
            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:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Estimated End Time
          description: >-
            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:
          anyOf:
            - type: string
            - type: 'null'
          title: Estimated End Time Note
          description: Free-text explanation of how estimated_end_time was derived.
        estimated_end_time_calculated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Estimated End Time Calculated At
          description: >-
            ISO 8601 datetime with timezone marking when estimated_end_time was
            last computed.
        test_setup:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Test Setup
          description: >-
            Physical test setup. Typical keys: 'cycler' (model), 'operator',
            'lab', 'channel_number'. Readers also record what the cycler header
            carries, drawn from one shared vocabulary so the shape does not vary
            by cycler: 'test_name', 'cell_label' (the cycler's own label for the
            cell, which need not match the cell instance), 'instrument',
            'cycler_serial_number', 'software_version',
            'temperature_setpoint_degc', 'notes', 'end_time', plus export
            provenance -- 'export_date', 'source_file_path', 'barcode_comment',
            and 'source_file_id' (an id in the cycler's own id space, not a
            cross-system identifier). Which of these a file can fill depends on
            its format; keys the header does not carry are omitted rather than
            set empty.
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: Free-text notes about the cell measurement
        measurement_type:
          $ref: '#/components/schemas/MeasurementType'
          description: >-
            What shape of data this measurement holds. Determines which fields
            are populated and which upload flow applies. See the class
            docstring.
          default: time_series
        properties:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Properties
          description: >-
            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:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: File Metadata
          description: Metadata about uploaded files (MIME types, dimensions, etc.)
        channel_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Channel Id
          description: Optional ID of the channel this measurement ran on.
        protocol_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Protocol Id
          description: >-
            Optional ID of the experiment template (protocol) this measurement
            was run against.
        program_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Program Id
          description: >-
            Optional catalog program for this measurement (copied from a linked
            planned measurement when present).
        tags:
          items:
            type: string
          type: array
          title: Tags
          description: >-
            Free-form labels for organising and filtering measurements, e.g.
            ['baseline', 'batch-7']. Whitespace is trimmed, duplicates are
            dropped case-insensitively, and a tag already used in the project
            keeps its existing spelling. At most 50 tags of up to 50 characters.
        id:
          type: string
          title: Id
        cell_instance_id:
          type: string
          title: Cell Instance Id
        organization_id:
          type: string
          title: Organization Id
          description: Organization this measurement belongs to.
        project_id:
          type: string
          title: Project Id
          description: Project this measurement belongs to
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
          description: User ID of the user who created this measurement
        created_by_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By Email
          description: Email of the user who created this measurement
        processing_status:
          $ref: '#/components/schemas/MeasurementProcessingStatus'
          description: >-
            Lifecycle of server-side step processing. 'ready' once steps are
            available; 'pending'/'running' while the upload is being processed
            asynchronously; 'failed' if processing failed (see
            processing_error).
          default: ready
        processing_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Processing Error
          description: >-
            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:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Etag
        row_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Row Count
        time_series_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Time Series Bytes
        recorded_duration_s:
          anyOf:
            - type: number
            - type: 'null'
          title: Recorded Duration S
        accepts_raw_updates:
          type: boolean
          title: Accepts Raw Updates
          default: false
        estimated_end_time_status:
          anyOf:
            - $ref: '#/components/schemas/EstimationStatus'
            - type: 'null'
        estimated_end_time_job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Estimated End Time Job Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        extend_claim_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Extend Claim Id
          description: >-
            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:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Extend In Progress At
          description: Deprecated and always null. Use processing_status.
        extend_claimed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Extend Claimed At
          description: >-
            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.
      type: object
      required:
        - name
        - id
        - cell_instance_id
        - organization_id
        - project_id
        - created_at
        - updated_at
      title: CellMeasurement
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    MeasurementType:
      type: string
      enum:
        - time_series
        - file
        - properties
      title: MeasurementType
      description: |-
        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.
    MeasurementProcessingStatus:
      type: string
      enum:
        - pending
        - running
        - ready
        - failed
        - awaiting_extend
        - extending
      title: MeasurementProcessingStatus
      description: |-
        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``.
    EstimationStatus:
      type: string
      enum:
        - estimating
        - ready
        - failed
      title: EstimationStatus
      description: >-
        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.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.