---
title: "Update attendance schedule"
method: PUT
path: "/v2/attendance_schedules/{attendance_schedule_id}"
tags: ["attendance_schedules"]
---

# Update attendance schedule

`PUT /v2/attendance_schedules/{attendance_schedule_id}`

## Request

- Base URL: `https://api.hubstaff.com`
- URL: `https://api.hubstaff.com/v2/attendance_schedules/{attendance_schedule_id}`
- Auth: OAuth 2
  - Authorization code: `https://account.hubstaff.com/authorizations/new`
  - Token URL: `https://account.hubstaff.com/access_tokens` scopes: `hubstaff:read`, `hubstaff:write`
- TypeScript: <https://skmtc.dev/hubstaff/apis/hubstaff-v2-api/docs/v2/attendance_schedules/:attendance_schedule_id/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates an attendance schedule.

Returns the updated attendance schedule.

Only pass in the fields you want to change. Use add_excluded_dates/remove_excluded_dates to modify exclusions incrementally, or excluded_dates to replace them entirely.

## Path parameters

- `attendance_schedule_id` integer, required

## Request body

- PutV2AttendanceSchedulesAttendanceScheduleId: Update attendance schedule
  - `start_date` string, date: Attendance Schedule Start Date
  - `start_time` string: Attendance Schedule Start Time, 24 hour time in 30 minutes intervals (h:mm)
  - `use_time_zone` 'organization' | 'user': What time zone to use
  - `duration` integer: Shift duration in seconds
  - `minimum_time` integer: Minimum shift time in seconds
  - `repeat_schedule` 'never' | 'weekly' | 'bi_weekly': Shift repetition schedule
  - `repeat_until` string, date: Shift end date
  - `weekdays` string[]: Shift repetition week days
  - `excluded_dates` string[]: Excluded dates from the repetition schedule
  - `add_excluded_dates` string[]: Excluded dates to add
  - `remove_excluded_dates` string[]: Excluded dates to remove

## Response `200`

An attendance schedule

- object
  - `attendance_schedule` AttendanceSchedule: AttendanceSchedule model
    - `id` integer, required: Attendance schedule ID
    - `user_id` integer, required: User ID
    - `organization_id` integer, required: Organization ID
    - `created_at` string, date-time, required: When the record was created
    - `updated_at` string, date-time, required: When the record was last updated
    - `start_date` string, date, required: Shift start date
    - `use_time_zone` string, required: What time zone to use
    - `start_time` string, date-time, required: Shift start time (only hh:mm:ss
    - `duration` integer, required: Shift duration
    - `minimum_time` integer, required: Minimum shift time
    - `repeat_schedule` string, required: Shift repetition schedule
    - `repeat_until` string, date: Shift end date
    - `weekdays` string[]: Shift repetition week days
    - `excluded_dates` string[]: Excluded dates from the repetition schedule

## Other responses

- `400`: Invalid parameters
- `401`: Unauthorized
- `403`: API access is only for organizations on an active plan
- `404`: Could not find record
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/hubstaff/apis/hubstaff-v2-api.md) - [All operations](https://skmtc.dev/hubstaff/apis/hubstaff-v2-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hubstaff/apis/hubstaff-v2-api/revisions/c6b90e4e4bdc?raw)
