---
title: "Delete Unit"
method: DELETE
path: "/teacher/courses/{course_id}/units/{unit_id}"
tags: ["Teacher Course Structure"]
---

# Delete Unit

`DELETE /teacher/courses/{course_id}/units/{unit_id}`

Delete a unit from the course.

Optionally preserve the unit's flashcards and QCMs as global course content.

## Path parameters

- `course_id` string, required
- `unit_id` string, required

## Request body

- DeleteUnitRequest — Request model for unit deletion with optional content preservation.
  - `preserve_content` boolean — Whether to preserve flashcards/QCMs as global content

## Response `200`

Successful Response

- CourseStructureResponse — Response model for course structure operations.
  - `status` string, required
  - `message` string, required
  - `course` Course, required — Represents a user course created through image uploads.
    - `_id` string
    - `user_id` string, required
    - `is_teacher_course` boolean
    - `folder_id` string, nullable
    - `title` string, required
    - `subject` string, nullable
    - `status` 'UPLOADING' | 'PROCESSING_IMAGES' | 'STRUCTURING' | 'GENERATING_CONTENT' | 'COMPLETED' | 'FAILED'
    - `original_image_paths` string[]
    - `raw_content_blob` string, nullable
    - `units` CourseUnit[], nullable
      - `unit_id` string
      - `type` 'chapter' | 'section' | 'topic' | 'concept_explanation' | 'introduction' | 'conclusion' | 'content' | 'flashcards' | 'qcm', required — Valid unit types for course content
      - `title` string, required
      - `unit_summary` string, required
      - `suggested_content_type` 'chapter' | 'section' | 'topic' | 'concept_explanation' | 'introduction' | 'conclusion' | 'content' | 'flashcards' | 'qcm' — Valid unit types for course content
      - `brief_description` string, nullable
      - `generated_content` string, nullable
    - `generated_course_content` string, nullable
    - `revision_deck_status` 'GENERATING' | 'COMPLETED' | 'FAILED', nullable
    - `knowledge_quiz_status` 'GENERATING' | 'COMPLETED' | 'FAILED', nullable
    - `error_message` string, nullable
    - `warnings` string[], nullable
    - `figures_crop` object, nullable
    - `processing_options` object, nullable
    - `source_type` 'student_upload' | 'teacher_assigned' | 'holiday_workbook', nullable
    - `holiday_course_context` object, nullable
    - `created_at` string, date-time
    - `updated_at` string, date-time

## 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.dev/excellence-ai/apis/excellence-learning/revisions/2a0c1636fd3b?raw)
