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

# set user preference



## OpenAPI

````yaml /api-reference/openapi.json post /v1/devices/hvac/{id}/user_preferences/set
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}/user_preferences/set:
    post:
      tags:
        - hvac
      summary: set user preference
      operationId: HvacCompositeAuthController_setUserPreferences_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/CreateHvacScheduleNoIdDto'
            example:
              name: Weekday comfort
              tempUnits: F
              defaultMode: AUTO
              defaultMaxTemp: 75
              defaultMinTemp: 65
              defaultCoolSetpoint: 74
              defaultHeatSetpoint: 68
              scheduleBlocks:
                - startTimeMinutes: 0
                  endTimeMinutes: 480
                  mode: HEAT
                  targetCoolSetpoint: null
                  targetHeatSetpoint: 68
                  maxTemp: 75
                  minTemp: 65
                  daysOfWeek:
                    - 1
                    - 2
                    - 3
                    - 4
                    - 5
                  scheduleType: RECURRING
                - startTimeMinutes: 480
                  endTimeMinutes: 1440
                  mode: AUTO
                  targetCoolSetpoint: 74
                  targetHeatSetpoint: 68
                  maxTemp: 75
                  minTemp: 65
                  daysOfWeek:
                    - 1
                    - 2
                    - 3
                    - 4
                    - 5
                  scheduleType: RECURRING
      responses:
        '201':
          description: ''
      security:
        - x-ws-api-key: []
components:
  schemas:
    CreateHvacScheduleNoIdDto:
      type: object
      properties:
        name:
          description: The human-readable name for the schedule
          type: string
        scheduleBlocks:
          description: >-
            0 or more blocks for this schedule to follow. If no blocks are
            added, the default temp will be followed
          type: array
          items:
            type: object
            properties:
              startTimeMinutes:
                description: >-
                  The number of minutes since midnight that the block starts.
                  For 1:25 am, this would be 85 (1 * 60 + 25)
                type: number
                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: number
                minimum: 0
                exclusiveMinimum: false
                maximum: 1440
                exclusiveMaximum: false
              mode:
                description: The mode for the HVAC unit in this block
                type: string
                enum:
                  - 'OFF'
                  - HEAT
                  - COOL
                  - AUTO
                x-enumNames:
                  - 'OFF'
                  - HEAT
                  - COOL
                  - AUTO
              targetTemp:
                description: This field is deprecated
                type: number
                minimum: -50
                exclusiveMinimum: false
                maximum: 200
                exclusiveMaximum: false
                nullable: true
              targetCoolSetpoint:
                description: The target cool setpoint
                type: number
                minimum: -50
                exclusiveMinimum: false
                maximum: 200
                exclusiveMaximum: false
                nullable: true
              targetHeatSetpoint:
                description: The target heat setpoint
                type: number
                minimum: -50
                exclusiveMinimum: false
                maximum: 200
                exclusiveMaximum: false
                nullable: true
              maxTemp:
                description: >-
                  The max temperature allowed in this block (units determined by
                  parent schedule)
                type: number
                minimum: -50
                exclusiveMinimum: false
                maximum: 200
                exclusiveMaximum: false
                nullable: true
              minTemp:
                description: >-
                  The min temperature allowed in this block (units determined by
                  parent schedule)
                type: number
                minimum: -50
                exclusiveMinimum: false
                maximum: 200
                exclusiveMaximum: false
                nullable: true
              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
              scheduleType:
                type: string
                enum:
                  - RECURRING
                  - ONE_TIME
                x-enumNames:
                  - RECURRING
                  - ONE_TIME
                default: RECURRING
            required:
              - startTimeMinutes
              - endTimeMinutes
              - targetTemp
              - targetCoolSetpoint
              - targetHeatSetpoint
              - maxTemp
              - minTemp
              - daysOfWeek
        weekNumbers:
          description: >-
            The week numbers to apply this schedule. For example, [0,1,2,...,51]
            applies to all 52 weeks of the year. Leave empty to also apply to
            all weeks.
          type: array
          items:
            type: integer
            minimum: 0
            exclusiveMinimum: false
            maximum: 52
            exclusiveMaximum: false
        enabled:
          description: Whether this schedule should be enabled
          type: boolean
        defaultMode:
          description: The default mode for the HVAC unit.
          type: string
          enum:
            - 'OFF'
            - HEAT
            - COOL
            - AUTO
          x-enumNames:
            - 'OFF'
            - HEAT
            - COOL
            - AUTO
        tempUnits:
          description: The units for temperature.
          type: string
          enum:
            - F
            - C
          x-enumNames:
            - F
            - C
        defaultCoolSetpoint:
          description: >-
            The default temperature for the hvac unit. This must be set unless
            the default mode is `OFF` or there are schedule blocks added
          type: number
          minimum: -50
          exclusiveMinimum: false
          maximum: 200
          exclusiveMaximum: false
          nullable: true
        defaultHeatSetpoint:
          description: >-
            The default temperature for the hvac unit. This must be set unless
            the default mode is `OFF` or there are schedule blocks added
          type: number
          minimum: -50
          exclusiveMinimum: false
          maximum: 200
          exclusiveMaximum: false
          nullable: true
        currentTemp:
          type: number
          minimum: -50
          exclusiveMinimum: false
          maximum: 200
          exclusiveMaximum: false
          nullable: true
        targetCoolSetpoint:
          type: number
          minimum: -50
          exclusiveMinimum: false
          maximum: 200
          exclusiveMaximum: false
          nullable: true
        targetHeatSetpoint:
          type: number
          minimum: -50
          exclusiveMinimum: false
          maximum: 200
          exclusiveMaximum: false
          nullable: true
        maxTemp:
          description: The max default temperature
          type: number
          minimum: -50
          exclusiveMinimum: false
          maximum: 200
          exclusiveMaximum: false
          nullable: true
        minTemp:
          description: The min default temperature
          type: number
          minimum: -50
          exclusiveMinimum: false
          maximum: 200
          exclusiveMaximum: false
          nullable: true
      required:
        - name
        - scheduleBlocks
        - enabled
        - defaultMode
        - tempUnits
        - defaultCoolSetpoint
        - defaultHeatSetpoint
        - currentTemp
        - targetCoolSetpoint
        - targetHeatSetpoint
        - maxTemp
        - minTemp
  securitySchemes:
    x-ws-api-key:
      type: apiKey
      in: header
      name: x-ws-api-key
      description: WattShift API key

````