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

# preview



## OpenAPI

````yaml /api-reference/openapi.json post /v1/devices/hvac/{id}/preview
openapi: 3.0.0
info:
  title: WattShift API
  description: An API for the WattShift Service (https://wattshift.com/partners)
  version: '1.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /v1/devices/hvac/{id}/preview:
    post:
      tags:
        - hvac
      summary: preview
      operationId: HvacCompositeAuthController_getPreviewForOptimizedSetPoints_v1
      parameters:
        - name: x-ws-api-key
          in: header
          description: WattShift API Key
          schema:
            type: string
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HvacSchedulePreviewDto'
            example:
              blocks: []
              defaultCoolSetpoint: 74
              defaultHeatSetpoint: 68
              defaultMaxTemp: 75
              defaultMinTemp: 65
              defaultMode: AUTO
              tempUnits: F
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HvacSchedulePreviewResponseDto'
              example:
                setPointSchedule:
                  blocks:
                    - startDatetime: '2025-06-02T00:00:00.000Z'
                      endDatetime: '2025-06-02T08:00:00.000Z'
                      targetTemp: null
                      targetCoolSetpoint: 74
                      targetHeatSetpoint: 68
                      targetMode: AUTO
                    - startDatetime: '2025-06-02T08:00:00.000Z'
                      endDatetime: '2025-06-03T00:00:00.000Z'
                      targetTemp: null
                      targetCoolSetpoint: 76
                      targetHeatSetpoint: 66
                      targetMode: COOL
                  startDatetime: '2025-06-02T00:00:00.000Z'
                  endDatetime: '2025-06-03T00:00:00.000Z'
                  tempUnits: F
                temperatureData:
                  - 68
                  - 69
                  - 70
                  - 71
                rates:
                  - 0.24
                  - 0.26
                  - 0.28
                  - 0.3
                estimatedSavings: 12.45
      security:
        - x-ws-api-key: []
components:
  schemas:
    HvacSchedulePreviewDto:
      description: >-
        HVAC schedule preview. defaultCoolSetpoint and defaultHeatSetpoint are
        required when blocks is empty.
      type: object
      properties:
        blocks:
          description: Array of schedule blocks
          type: array
          items:
            type: object
            properties:
              startTimeMinutes:
                description: >-
                  The number of minutes since midnight that the block starts.
                  I.e. for 1:25 am, this would be 85 (1 * 60 + 25)
                type: integer
                minimum: 0
                exclusiveMinimum: false
                maximum: 1440
                exclusiveMaximum: false
              endTimeMinutes:
                description: >-
                  The number of minutes since midnight that the block ends. MUST
                  be greater than startTimeMinutes
                type: integer
                minimum: 0
                exclusiveMinimum: false
                maximum: 1440
                exclusiveMaximum: false
              targetCoolSetpoint:
                description: >-
                  The target cool setpoint in this block (units determined by
                  parent schedule)
                type: number
              targetHeatSetpoint:
                description: >-
                  The target heat setpoint in this block (units determined by
                  parent schedule)
                type: number
              maxTemp:
                description: >-
                  The max temperature allowed in this block (units determined by
                  parent schedule)
                type: number
              minTemp:
                description: >-
                  The min temperature allowed in this block (units determined by
                  parent schedule)
                type: number
              daysOfWeek:
                description: >-
                  The days of the week that this block applies to. 0 is Sunday,
                  1 is Monday, etc.
                type: array
                items:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: false
                  maximum: 6
                  exclusiveMaximum: false
                default: []
              scheduleType:
                description: The schedule type for this block
                type: string
                enum:
                  - RECURRING
                  - ONE_TIME
                x-enumNames:
                  - RECURRING
                  - ONE_TIME
                default: RECURRING
            required:
              - startTimeMinutes
              - endTimeMinutes
          default: []
        defaultCoolSetpoint:
          description: >-
            The default cool setpoint for the hvac unit. Required when blocks is
            empty (unless the default mode is `OFF`)
          type: number
        defaultHeatSetpoint:
          description: >-
            The default heat setpoint for the hvac unit. Required when blocks is
            empty (unless the default mode is `OFF`)
          type: number
        defaultMaxTemp:
          description: The max default temperature
          type: number
        defaultMinTemp:
          description: The min default temperature
          type: number
        includeEstimatedSavings:
          description: Set true to include estimated savings
          type: boolean
    HvacSchedulePreviewResponseDto:
      type: object
      properties:
        setPointSchedule:
          type: object
          properties:
            blocks:
              type: array
              items:
                type: object
                properties:
                  startDatetime:
                    description: ISO 8601 date time string
                    type: string
                  endDatetime:
                    description: ISO 8601 date time string
                    type: string
                  targetTemp:
                    description: Temperature in units as specified by tempUnits
                    type: number
                    nullable: true
                  targetCoolSetpoint:
                    description: Target cool setpoint in units as specified by tempUnits
                    type: number
                  targetHeatSetpoint:
                    description: Target heat setpoint in units as specified by tempUnits
                    type: number
                  targetMode:
                    type: string
                    enum:
                      - 'OFF'
                      - HEAT
                      - COOL
                      - AUTO
                    x-enumNames:
                      - 'OFF'
                      - HEAT
                      - COOL
                      - AUTO
                required:
                  - startDatetime
                  - endDatetime
                  - targetCoolSetpoint
                  - targetHeatSetpoint
                  - targetMode
            startDatetime:
              description: ISO 8601 date time string
              type: string
            endDatetime:
              description: ISO 8601 date time string
              type: string
            tempUnits:
              type: string
              enum:
                - F
                - C
              x-enumNames:
                - F
                - C
          required:
            - blocks
            - startDatetime
            - endDatetime
            - tempUnits
        temperatureData:
          type: array
          items:
            type: number
        rates:
          type: array
          items:
            type: number
        estimatedSavings:
          type: number
      required:
        - setPointSchedule
        - temperatureData
        - rates
  securitySchemes:
    x-ws-api-key:
      type: apiKey
      in: header
      name: x-ws-api-key
      description: WattShift API key

````