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

# Get the lab-view occupancy status for a project

> Return the project's sites, cyclers, and channels with occupancy state.

Each channel carries a derived ``free`` / ``occupied`` / ``stale`` state
(there is no live telemetry; state comes from linked measurements'
``end_time`` and update recency). Includes per-cycler and project-level
occupancy counts.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json get /projects/{project_id}/lab/status
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /projects/{project_id}/lab/status:
    get:
      tags:
        - Lab
      summary: Get the lab-view occupancy status for a project
      description: |-
        Return the project's sites, cyclers, and channels with occupancy state.

        Each channel carries a derived ``free`` / ``occupied`` / ``stale`` state
        (there is no live telemetry; state comes from linked measurements'
        ``end_time`` and update recency). Includes per-cycler and project-level
        occupancy counts.
      operationId: get_lab_status_projects__project_id__lab_status_get
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            title: Project Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabStatus'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LabStatus:
      properties:
        sites:
          items:
            $ref: '#/components/schemas/LabSite'
          type: array
          title: Sites
          description: Sites with this project's cyclers
        occupied:
          type: integer
          title: Occupied
          description: Total occupied channels across the project
          default: 0
        stale:
          type: integer
          title: Stale
          description: Total stale channels across the project
          default: 0
        free:
          type: integer
          title: Free
          description: Total free channels across the project
          default: 0
        out_of_commission:
          type: integer
          title: Out Of Commission
          description: Total out-of-commission channels across the project
          default: 0
      type: object
      title: LabStatus
      description: >-
        The full Lab-view tree for a project: sites -> cyclers -> channels.


        Returned by ``GET /projects/{project_id}/lab/status`` in a single call
        so

        the wall can render without N per-channel round-trips.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LabSite:
      properties:
        id:
          type: string
          title: Id
          description: Site ID
        name:
          type: string
          title: Name
          description: Site name
        cyclers:
          items:
            $ref: '#/components/schemas/LabCycler'
          type: array
          title: Cyclers
          description: Cyclers at this site owned by the project
      type: object
      required:
        - id
        - name
      title: LabSite
      description: A site grouping its cyclers for the Lab wall.
    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
    LabCycler:
      properties:
        id:
          type: string
          title: Id
          description: Cycler ID
        name:
          type: string
          title: Name
          description: Cycler name
        manufacturer:
          anyOf:
            - type: string
            - type: 'null'
          title: Manufacturer
          description: Cycler manufacturer
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
          description: Cycler model
        channel_count:
          type: integer
          title: Channel Count
          description: Total number of channels
        occupied:
          type: integer
          title: Occupied
          description: Channels in the occupied state
        stale:
          type: integer
          title: Stale
          description: Channels in the stale state
        free:
          type: integer
          title: Free
          description: Channels in the free state
        out_of_commission:
          type: integer
          title: Out Of Commission
          description: Channels that are out of commission
          default: 0
        channels:
          items:
            $ref: '#/components/schemas/LabChannel'
          type: array
          title: Channels
          description: Channels on this cycler
      type: object
      required:
        - id
        - name
        - channel_count
        - occupied
        - stale
        - free
      title: LabCycler
      description: A cycler with its channels and occupancy counts for the Lab wall.
    LabChannel:
      properties:
        id:
          type: string
          title: Id
          description: Channel ID
        name:
          type: string
          title: Name
          description: Channel name
        state:
          $ref: '#/components/schemas/ChannelState'
          description: Derived occupancy state
        measurement:
          anyOf:
            - $ref: '#/components/schemas/LabMeasurementSummary'
            - type: 'null'
          description: The measurement driving the state (occupied/stale). Null when free.
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: Free-text notes on the channel
        out_of_commission:
          type: boolean
          title: Out Of Commission
          description: Whether the channel is out of service
          default: false
        max_amps:
          anyOf:
            - type: number
            - type: 'null'
          title: Max Amps
          description: Maximum rated current (A)
        min_volts:
          anyOf:
            - type: number
            - type: 'null'
          title: Min Volts
          description: Minimum rated voltage (V)
        max_volts:
          anyOf:
            - type: number
            - type: 'null'
          title: Max Volts
          description: Maximum rated voltage (V)
      type: object
      required:
        - id
        - name
        - state
      title: LabChannel
      description: A channel with its derived occupancy state for the Lab wall.
    ChannelState:
      type: string
      enum:
        - free
        - occupied
        - stale
        - out_of_commission
      title: ChannelState
      description: >-
        Derived occupancy state of a channel in the Lab view.


        There is no live telemetry; state is derived from the channel's linked

        measurements (a measurement references its channel via ``channel_id``):


        - ``free`` — no linked measurement, or every linked measurement has an
          ``end_time`` set (all tests finished). The channel is available.
        - ``occupied`` — a linked measurement has ``end_time`` null and was
        updated
          within the staleness window (data is fresh); a cell is on test now.
        - ``stale`` — a linked measurement has ``end_time`` null but has not
        been
          updated within the staleness window. Likely a stopped or silently failed
          test, or one someone forgot to mark complete; needs a human to resolve
          (mark it complete to free the channel).
        - ``out_of_commission`` — the channel is deliberately out of service
          (broken / maintenance). This overrides any derived state above.
    LabMeasurementSummary:
      properties:
        id:
          type: string
          title: Id
          description: Measurement ID
        name:
          type: string
          title: Name
          description: Measurement name
        start_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Start Time
          description: When the test started, if known
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: When the measurement was last updated (drives recency)
        cell_instance_id:
          type: string
          title: Cell Instance Id
          description: ID of the cell instance on test
        cell_instance_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Cell Instance Name
          description: Name of the cell instance on test
        protocol_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Protocol Name
          description: Protocol name from the measurement's protocol dict
      type: object
      required:
        - id
        - name
        - updated_at
        - cell_instance_id
      title: LabMeasurementSummary
      description: |-
        Slim view of the measurement occupying a channel, for the Lab wall.

        Carries only what a channel tile needs; the full measurement is fetched
        separately on the channel detail page.

````