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

# Update user availability schedule

> Modify an existing schedule by updating its rules, timezone, and name All fields are optional - only provided fields will be updated.



## OpenAPI

````yaml /api-reference/calendars/openapi.json put /calendars/schedules/{id}
openapi: 3.0.0
info:
  title: Calendars API
  description: Documentation for Calendars API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Calendars
    description: Documentation for Calendars API
  - name: Calendar Groups
    description: Documentation for Calendars API
  - name: Calendar Events
    description: Documentation for Calendars API
  - name: Appointment Notes
    description: Documentation for Calendars API
  - name: Calendar Resources - Rooms and Equipment
    description: Documentation for Calendars API
  - name: Calendar Notifications
    description: Documentation for Calendars API
  - name: Availability
    description: Documentation for Calendars API
paths:
  /calendars/schedules/{id}:
    put:
      tags:
        - Availability
      summary: Update user availability schedule
      description: >-
        Modify an existing schedule by updating its rules, timezone, and name
        All fields are optional - only provided fields will be updated.
      operationId: updateSchedule
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-04-15'
        - name: id
          required: true
          in: path
          description: Unique identifier of the schedule to update
          schema:
            example: sch123def456ghi789
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateScheduleDTO'
      responses:
        '200':
          description: Schedule updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduleResponseDTO'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: User not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
        '404':
          description: Schedule with the specified ID was not found
        '422':
          description: Validation errors in schedule rules or conflicting data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableDTO'
      security:
        - bearer:
            - calendars.write
components:
  schemas:
    UpdateScheduleDTO:
      type: object
      properties:
        name:
          type: string
          description: Human-readable name for the schedule
          example: Updated Business Hours
        rules:
          description: Updated schedule rules defining when the schedule is active
          example:
            - type: wday
              day: monday
              intervals:
                - from: '08:00'
                  to: '18:00'
          type: array
          items:
            $ref: '#/components/schemas/ScheduleRuleDTO'
        timezone:
          type: string
          description: Updated timezone for the schedule (IANA timezone identifier)
          example: America/Los_Angeles
          pattern: ^[A-Za-z_]+/[A-Za-z_]+$
    ScheduleResponseDTO:
      type: object
      properties:
        schedule:
          $ref: '#/components/schemas/ScheduleObjectResponseDTO'
      required:
        - schedule
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
    UnauthorizedDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: 'Invalid token: access token is invalid'
        error:
          type: string
          example: Unauthorized
      required:
        - statusCode
        - message
        - error
    UnprocessableDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 422
        message:
          type: array
          items:
            type: string
          example:
            - Unprocessable Entity
        error:
          type: string
          example: Unprocessable Entity
      required:
        - statusCode
        - message
        - error
    ScheduleRuleDTO:
      type: object
      properties:
        type:
          type: string
          enum:
            - wday
            - date
          description: Type of schedule rule - weekday (recurring) or date (specific date)
          example: wday
        intervals:
          description: Time intervals for the rule (e.g., 9 AM to 5 PM)
          example:
            - from: '09:00'
              to: '17:00'
          type: array
          items:
            $ref: '#/components/schemas/ScheduleIntervalDTO'
        date:
          type: string
          description: Specific date in YYYY-MM-DD format (only for date-type rules)
          example: '2023-04-15'
          pattern: ^\d{4}-\d{2}-\d{2}$
        day:
          type: string
          enum:
            - sunday
            - monday
            - tuesday
            - wednesday
            - thursday
            - friday
            - saturday
          description: Day of week (only for weekday-type rules)
          example: monday
      required:
        - type
        - intervals
    ScheduleObjectResponseDTO:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the schedule
          example: IkqiJlXJ7o9h61tCHHod
        name:
          type: string
          description: Human-readable name for the schedule
          example: Business Hours Schedule
        locationId:
          type: string
          description: Location ID where this schedule applies
          example: IkqiJlXJ7o9h61tCHHod
        rules:
          description: Schedule rules defining when the schedule is active
          type: array
          items:
            $ref: '#/components/schemas/ScheduleRuleDTO'
        timezone:
          type: string
          description: Timezone for the schedule (IANA timezone identifier)
          example: America/New_York
        dateAdded:
          type: string
          description: ISO date string when the schedule was created
          example: '2023-01-15T10:30:00.000Z'
        dateUpdated:
          type: string
          description: ISO date string when the schedule was last updated
          example: '2023-01-20T14:45:00.000Z'
        userId:
          type: string
          description: User ID associated with the schedule
          example: IkqiJlXJ7o9h61tCHHod
        calendarIds:
          description: Calendar IDs associated with the schedule
          type: array
          items:
            type: string
        deleted:
          type: boolean
          description: Whether the schedule has been deleted
          example: false
      required:
        - id
        - name
        - locationId
        - rules
        - timezone
        - dateAdded
        - dateUpdated
        - userId
        - deleted
    ScheduleIntervalDTO:
      type: object
      properties:
        from:
          type: string
          description: Start time in HH:MM format (24-hour format)
          example: '09:00'
          pattern: ^([01]?[0-9]|2[0-3]):[0-5][0-9]$
        to:
          type: string
          description: End time in HH:MM format (24-hour format)
          example: '17:00'
          pattern: ^([01]?[0-9]|2[0-3]):[0-5][0-9]$
      required:
        - from
        - to
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Use the Access Token generated with user type as Sub-Account (OR)
        Private Integration Token of Sub-Account.
      type: http

````