---
title: "Link Exercise To Sub Chapitre"
method: POST
path: "/admin/holiday-courses/subchapitres/{sub_chapitre_id}/link-exercise"
tags: ["Admin - Holiday Courses"]
---

# Link Exercise To Sub Chapitre

`POST /admin/holiday-courses/subchapitres/{sub_chapitre_id}/link-exercise`

Link an existing holiday course exercise to a sub-chapitre.

This endpoint:
1. Validates that both the sub-chapitre and exercise exist
2. Prevents duplicate links (same exercise to same sub-chapitre)
3. Manages the default flag (only one exercise can be default per sub-chapitre)
4. Creates the HolidayCourseExerciseLink document

Only accessible by admin users.

## Path parameters

- `sub_chapitre_id` string, required — The ID of the holiday course sub-chapitre

## Request body

- LinkExerciseToSubChapitrePayload — Request model for linking an exercise to a sub-chapitre
  - `holiday_course_exercise_id` string, required
  - `is_default_for_sub_chapitre` boolean, nullable

## Response `200`

Successful Response

- LinkedExerciseDetail — Response model for linked exercise with details
  - `id` string, required
  - `sub_chapitre_id` string, required
  - `holiday_course_exercise_id` string, required
  - `is_default_for_sub_chapitre` boolean, required
  - `created_at` string, date-time, required
  - `exercise_title` string, nullable
  - `exercise_difficulty` string, required
  - `exercise_content` string, nullable
  - `exercise_solution` string, nullable
  - `exercise_hints1` string, nullable
  - `exercise_hints2` string, nullable
  - `exercise_hints3` string, 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.dev/excellence-ai/apis/excellence-learning/revisions/e75413b9576a?raw)
