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

# Update

> Updates one schedule, or multiple schedules if `when` is a LocalDateInterval or an RRULE. The person you're scheduling and the schedule template should belong to the team provided.



## OpenAPI

````yaml preview post /api/schedule/schedules.update
openapi: 3.1.0
info:
  title: tipee
  version: preview
servers: []
security:
  - basicAuth: []
tags:
  - name: Activity
    description: Activity
  - name: Balances
    description: Balances
  - name: Directory
    description: Directory
  - name: Schedule
    description: Schedule
  - name: Timeclock
    description: Timeclock
paths:
  /api/schedule/schedules.update:
    post:
      tags:
        - Schedule
      summary: Update
      description: >-
        Updates one schedule, or multiple schedules if `when` is a
        LocalDateInterval or an RRULE. The person you're scheduling and the
        schedule template should belong to the team provided.
      operationId: post_app_ui_api_schedule_schedulecommand_updateschedule
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateScheduleCommand'
      responses:
        '204':
          description: Schedule updated.
        '409':
          description: Dates overlap with existing schedules, or the sector is hidden
          content:
            application/json:
              schema:
                oneOf:
                  - properties:
                      error:
                        type: string
                        example: OVERLAPPING
                      body:
                        $ref: >-
                          #/components/schemas/OverlappingSchedulesConflictResponseBodyDTO
                    type: object
                  - properties:
                      error:
                        type: string
                        example: SCHEDULE_SECTOR_MASKED
                      body:
                        $ref: '#/components/schemas/MaskedSectorResponseBodyDTO'
                    type: object
components:
  schemas:
    UpdateScheduleCommand:
      required:
        - id
      properties:
        id:
          $ref: '#/components/schemas/Snowflake'
        schedule_template_id:
          oneOf:
            - $ref: '#/components/schemas/Snowflake'
            - type: 'null'
        team_id:
          $ref: '#/components/schemas/Snowflake'
        when:
          description: >-
            A single date (YYYY-MM-DD), a date interval (YYYY-MM-DD/YYYY-MM-DD),
            or an
            [RRULE](https://www.rfc-editor.org/rfc/rfc5545.html#section-3.3.10)
            string. When using a date interval or RRULE,
            options.schedule_on_bank_holidays is required.
          type: string
          example: >-
            RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR;DTSTART=20260101T120000;UNTIL=20260105T120000
        hour_ranges:
          type: array
          items:
            $ref: '#/components/schemas/HourRange'
        adjustment:
          oneOf:
            - $ref: '#/components/schemas/ScheduleTemplateUpdateAdjustment'
            - type: 'null'
        break_time:
          oneOf:
            - $ref: '#/components/schemas/ScheduleTemplateUpdateBreakTime'
            - type: 'null'
        remark:
          type:
            - string
            - 'null'
        options:
          $ref: '#/components/schemas/ScheduleOptions'
      type: object
    OverlappingSchedulesConflictResponseBodyDTO:
      required:
        - conflicting_dates
      properties:
        conflicting_dates:
          type: array
          items:
            $ref: '#/components/schemas/OverlappingSchedulesConflictsDTO'
      type: object
    MaskedSectorResponseBodyDTO:
      required:
        - masked_sector
      properties:
        masked_sector:
          type: array
          items:
            $ref: '#/components/schemas/MaskedSectorDTO'
      type: object
    Snowflake:
      type: string
      format: snowflake
      example: '872815618512410358'
    HourRange:
      required:
        - hour_range
        - auto_correct
        - paid_break
      properties:
        hour_range:
          $ref: '#/components/schemas/LocalTimeInterval'
        auto_correct:
          oneOf:
            - $ref: '#/components/schemas/Autocorrect'
            - type: 'null'
        paid_break:
          oneOf:
            - $ref: '#/components/schemas/ScheduleTemplatePaidBreakTime'
            - type: 'null'
      type: object
    ScheduleTemplateUpdateAdjustment:
      properties:
        value:
          $ref: '#/components/schemas/Duration'
        time:
          oneOf:
            - $ref: '#/components/schemas/LocalTime'
            - type: 'null'
      type: object
    ScheduleTemplateUpdateBreakTime:
      properties:
        min_duration:
          $ref: '#/components/schemas/Duration'
        hour_range:
          $ref: '#/components/schemas/LocalTimeInterval'
      type: object
    ScheduleOptions:
      required:
        - employee_resident_ratio
        - text_color
        - special_hour_range
        - schedule_on_bank_holidays
        - allow_partial
      properties:
        employee_resident_ratio:
          type: boolean
        text_color:
          type:
            - string
            - 'null'
        special_hour_range:
          oneOf:
            - $ref: '#/components/schemas/LocalTimeInterval'
            - type: 'null'
        schedule_on_bank_holidays:
          type: boolean
        allow_partial:
          type: boolean
          default: false
      type: object
    OverlappingSchedulesConflictsDTO:
      required:
        - resource
        - date
      properties:
        resource:
          $ref: '#/components/schemas/Snowflake'
        date:
          $ref: '#/components/schemas/LocalDate'
      type: object
    MaskedSectorDTO:
      required:
        - sector_name
        - date_start
        - date_end
      properties:
        sector_name:
          type: string
        date_start:
          type: string
        date_end:
          type:
            - string
            - 'null'
      type: object
    LocalTimeInterval:
      type: string
      format: local-time-interval
      example: 12:34:56/PT2H
    Autocorrect:
      required:
        - before_start
        - after_start
        - before_end
        - after_end
      properties:
        before_start:
          oneOf:
            - $ref: '#/components/schemas/Duration'
            - type: 'null'
        after_start:
          oneOf:
            - $ref: '#/components/schemas/Duration'
            - type: 'null'
        before_end:
          oneOf:
            - $ref: '#/components/schemas/Duration'
            - type: 'null'
        after_end:
          oneOf:
            - $ref: '#/components/schemas/Duration'
            - type: 'null'
      type: object
    ScheduleTemplatePaidBreakTime:
      required:
        - max_duration
        - hour_range
      properties:
        max_duration:
          $ref: '#/components/schemas/Duration'
        hour_range:
          oneOf:
            - $ref: '#/components/schemas/LocalTimeInterval'
            - type: 'null'
      type: object
    Duration:
      description: '[ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations)'
      type: string
      format: duration
      example: PT1H30M20S
    LocalTime:
      type: string
      format: local-time
      example: '12:34:56'
    LocalDate:
      type: string
      format: local-date
      example: '2019-11-11'

````