> ## 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 instance as failed, or clear the report

> Mark a whole cell as failed; every one of its measurements counts as failed.

For an organization linked to Uncountable, the verdict is also written to the
cell's recipe ("Failed", or "Passed" when cleared). ``lims`` in the response
says whether that write happened; the verdict is saved either way.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json patch /cell_instances/{cell_instance_id}/failure
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /cell_instances/{cell_instance_id}/failure:
    patch:
      tags:
        - Cell Instances
      summary: Report a cell instance as failed, or clear the report
      description: >-
        Mark a whole cell as failed; every one of its measurements counts as
        failed.


        For an organization linked to Uncountable, the verdict is also written
        to the

        cell's recipe ("Failed", or "Passed" when cleared). ``lims`` in the
        response

        says whether that write happened; the verdict is saved either way.
      operationId: >-
        report_cell_instance_failure_cell_instances__cell_instance_id__failure_patch
      parameters:
        - name: cell_instance_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Cell Instance Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportFailureRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CellInstanceFailureResponse'
        '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.
    CellInstanceFailureResponse:
      properties:
        cell_instance:
          $ref: '#/components/schemas/CellInstance'
        lims:
          $ref: '#/components/schemas/LimsPush'
      type: object
      required:
        - cell_instance
        - lims
      title: CellInstanceFailureResponse
      description: The cell after its verdict changed, and what the LIMS was told.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CellInstance:
      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
          title: Name
          description: Name of the cell instance (serial number)
        batch_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Batch Id
          description: >-
            Manufacturing lot (cell batch) this cell came from. Must be a batch
            of the same cell specification.
        date_manufactured:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Date Manufactured
          description: Date of manufacture
        measured_properties:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Measured Properties
          description: >-
            Measured (not designed) properties of this specific cell, grouped by
            component. Numeric values use the Quantity format. Example:
            {'cathode': {'loading': {'value': 7.06, 'unit': 'mg.cm-2'}}, 'cell':
            {'initial_capacity': {'value': 1.08, 'unit': 'A.h'}}}. Designed
            properties (target loading, rated capacity) belong on the cell
            specification.
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: Free-text notes about the cell instance
        id:
          type: string
          title: Id
          description: Unique identifier for the cell instance
        cell_specification_id:
          type: string
          title: Cell Specification Id
          description: Foreign key to the cell specification
        organization_id:
          type: string
          title: Organization Id
          description: Organization this cell instance belongs to.
        project_id:
          type: string
          title: Project Id
          description: Project this cell instance belongs to
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
          description: User ID of the user who created this instance
        created_by_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By Email
          description: Email of the user who created this instance
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when the instance was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Timestamp when the instance was last updated
        batch_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Batch Name
          description: Name of the batch ``batch_id`` points at. Read-only.
        measurement_ids:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Measurement Ids
          description: List of measurement IDs associated with the cell instance
      type: object
      required:
        - name
        - id
        - cell_specification_id
        - organization_id
        - project_id
        - created_at
        - updated_at
      title: CellInstance
      description: Model representing a cell instance as returned by the API.
    LimsPush:
      properties:
        status:
          $ref: '#/components/schemas/LimsPushStatus'
        value:
          anyOf:
            - type: string
            - type: 'null'
          title: Value
          description: Value written to the cell failure output, when sent.
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: Why it was skipped, or what went wrong.
      type: object
      required:
        - status
      title: LimsPush
      description: Outcome of mirroring a cell's verdict to Uncountable.
    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
    LimsPushStatus:
      type: string
      enum:
        - sent
        - skipped
        - error
      title: LimsPushStatus
      description: What became of the verdict in the organization's LIMS.

````

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