> ## 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 a project's channel-hours by state per calendar period

> Return channel-hours by state for each calendar period from start to now.

Each point splits the period's channel-hours into occupied, stale, free, and
out of service, with the Lab wall's precedence, so it describes the whole
period rather than one instant. The last point is the period in progress,
computed up to now and flagged ``partial``. At most 400 points.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json get /projects/{project_id}/lab/utilization-history
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/utilization-history:
    get:
      tags:
        - Lab
      summary: Get a project's channel-hours by state per calendar period
      description: >-
        Return channel-hours by state for each calendar period from start to
        now.


        Each point splits the period's channel-hours into occupied, stale, free,
        and

        out of service, with the Lab wall's precedence, so it describes the
        whole

        period rather than one instant. The last point is the period in
        progress,

        computed up to now and flagged ``partial``. At most 400 points.
      operationId: >-
        get_utilization_history_projects__project_id__lab_utilization_history_get
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
        - name: start
          in: query
          required: true
          schema:
            type: string
            format: date-time
            description: >-
              Start of the range, ISO 8601 (a date is read as UTC midnight).
              Snapped back to its period's boundary; at most 3660 days ago.
            title: Start
          description: >-
            Start of the range, ISO 8601 (a date is read as UTC midnight).
            Snapped back to its period's boundary; at most 3660 days ago.
        - name: granularity
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/UtilizationGranularity'
            description: Calendar period each point covers, in UTC
            default: month
          description: Calendar period each point covers, in UTC
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UtilizationHistory'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UtilizationGranularity:
      type: string
      enum:
        - day
        - week
        - month
        - quarter
        - year
      title: UtilizationGranularity
      description: The calendar period each history point covers, in UTC.
    UtilizationHistory:
      properties:
        project_id:
          type: string
          title: Project Id
          description: Project the history covers
        granularity:
          $ref: '#/components/schemas/UtilizationGranularity'
          description: Calendar period each point covers
        start:
          type: string
          format: date-time
          title: Start
          description: >-
            Start of the first point: the requested start snapped back to its
            period's boundary, or later if no channel existed yet
        trimmed_to_first_channel:
          type: boolean
          title: Trimmed To First Channel
          description: >-
            Whether periods before the project's first channel were dropped, so
            the series starts later than requested
          default: false
        generated_at:
          type: string
          format: date-time
          title: Generated At
          description: When the history was computed
        points:
          items:
            $ref: '#/components/schemas/UtilizationHistoryPoint'
          type: array
          title: Points
          description: One point per period, oldest first
      type: object
      required:
        - project_id
        - granularity
        - start
        - generated_at
      title: UtilizationHistory
      description: >-
        Utilization per calendar period, oldest first, ending with the current
        one.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UtilizationHistoryPoint:
      properties:
        period_start:
          type: string
          format: date-time
          title: Period Start
          description: Inclusive start of the period
        period_end:
          type: string
          format: date-time
          title: Period End
          description: >-
            Exclusive end of the period; the current time for the period still
            in progress
        partial:
          type: boolean
          title: Partial
          description: Whether the period is still in progress
          default: false
        occupied_hours:
          type: number
          title: Occupied Hours
          description: Channel-hours running a test
        stale_hours:
          type: number
          title: Stale Hours
          description: >-
            Channel-hours of still-open runs after they stopped uploading;
            finished runs count as occupied throughout
        free_hours:
          type: number
          title: Free Hours
          description: Channel-hours idle and in service
        out_of_service_hours:
          type: number
          title: Out Of Service Hours
          description: Channel-hours under an outage
        available_hours:
          type: number
          title: Available Hours
          description: Channel-hours of channels that existed during the period
        utilization_percent:
          type: number
          title: Utilization Percent
          description: Occupied plus stale over available — the wall's headline rule
        utilization_of_available_percent:
          type: number
          title: Utilization Of Available Percent
          description: Occupied plus stale over the hours not out of service
      type: object
      required:
        - period_start
        - period_end
        - occupied_hours
        - stale_hours
        - free_hours
        - out_of_service_hours
        - available_hours
        - utilization_percent
        - utilization_of_available_percent
      title: UtilizationHistoryPoint
      description: >-
        Channel-hours by state over one calendar period.


        The four state hours partition ``available_hours`` with the Lab wall's

        precedence: out of service, then stale, then occupied, then free. A
        channel

        contributes only from when it existed — the earlier of its
        ``created_at`` and

        its first run. Stale is known only for runs still open (see the
        service).
    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

````

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