---
title: "Generate Structured Subject"
method: POST
path: "/teacher-exams/{exam_id}/subjects/generate-structured-subject"
tags: ["Teacher Exams Subjects"]
---

# Generate Structured Subject

`POST /teacher-exams/{exam_id}/subjects/generate-structured-subject`

Generate a structured exam subject with exercises using teacher input.
If direct_accept is True, saves directly as official exercises.
Otherwise, returns the generated exercises without saving.

## Path parameters

- `exam_id` string, required

## Request body

- GenerateSubjectRequest
  - `class_level` string, required
  - `chapters` string, required
  - `thematics` string, required
  - `difficulty` integer, required
  - `number_of_exercises` integer, required
  - `direct_accept` boolean, nullable

## Response `200`

Successful Response

- object

## 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/c81ed506912f?raw)
