---
title: "Update Course Assignment Classes"
method: PUT
path: "/teacher/courses/{course_id}/assignment/classes"
tags: ["Teacher Courses"]
---

# Update Course Assignment Classes

`PUT /teacher/courses/{course_id}/assignment/classes`

Replace the full set of classes assigned to this course.

Lazy-creates the assignment doc if none exists. Triggers a
`new_course_assigned` notification for students in classes that were newly
added (diff old vs new), skips notifications when classes are removed.

## Path parameters

- `course_id` string, required

## Request body

- UpdateCourseAssignmentClassesRequest — Request model for replacing the full set of classes on the assignment.
  - `class_ids` string[], required

## Response `200`

Successful Response

- CourseAssignmentDetails — Response model for the (single, multi-class) course assignment. Returns `id=None` and empty `class_ids` when no assignment doc exists yet so the frontend can render the management UI without a 404. `class_schedules` is the truth for dates (one per class, decision D11); `start_date` and `knowledge_quiz_settings.start/end` are a legacy mirror.
  - `id` string, nullable
  - `teacher_id` string, nullable
  - `course_id` string, required
  - `class_ids` string[]
  - `class_schedules` CourseClassScheduleOut[]
    - `class_id` string, required
    - `class_name` string
    - `school_year` string, nullable
    - `is_past` boolean
    - `start_date` string, date-time, nullable
    - `quiz_start_date` string, date-time, nullable
    - `quiz_end_date` string, date-time, nullable
  - `frozen_school_years` string[]
  - `assigned_at` string, date-time, nullable
  - `start_date` string, date-time, nullable
  - `is_visible_to_students` boolean
  - `due_date` string, date-time, nullable
  - `instructions` string, nullable
  - `sharing_options` CourseComponentSharingOptions — Model for selective sharing options of course components. Defines what parts of a course are shared with students.
    - `include_content_units` boolean
    - `include_qcm_units` boolean
    - `include_flashcard_units` boolean
    - `include_global_flashcards` boolean
    - `include_knowledge_quiz` boolean
    - `excluded_unit_ids` string[]
  - `knowledge_quiz_settings` KnowledgeQuizSettings — Settings for the knowledge quiz on a course assignment. Configurable by the teacher when assigning a course.
    - `is_enabled` boolean
    - `max_attempts` integer, nullable
    - `show_correct_answers_after` boolean
    - `start_date` string, date-time, nullable
    - `end_date` string, date-time, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/excellence-ai/apis/excellence-learning.md) · [All operations](https://skmtc.dev/excellence-ai/apis/excellence-learning/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/excellence-ai/excellence-learning/revisions/c407f3b5a05b/schema)
