---
title: "Edit Exercise Ai"
method: POST
path: "/teacher_exercises/{exercise_id}/edit-ai"
tags: ["teacher_exercises"]
---

# Edit Exercise Ai

`POST /teacher_exercises/{exercise_id}/edit-ai`

Edit exercise content using AI assistance, creating a new version.

## Path parameters

- `exercise_id` string, required

## Request body

- object

## Response `200`

Successful Response

- TeacherExerciseResponse
  - `id` string, required
  - `teacher_id` string, required
  - `title` string, nullable, required
  - `content` string, required
  - `solution` string, nullable, required
  - `figure_id` string, nullable
  - `solution_figure_id` string, nullable
  - `figure_content` string, nullable
  - `figure_solution` string, nullable
  - `difficulty` string, nullable, required
  - `themes` string[], required
  - `source` string, required
  - `subject` 'maths' | 'physique-chimie'
  - `grade` 'sixieme' | 'cinquieme' | 'quatrieme' | 'troisieme' | 'seconde' | 'premiere' | 'terminale' | 'prepa', nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `is_private` boolean, required
  - `is_saved` boolean, required
  - `folder_id` string, nullable
  - `likes_count` integer

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-07** `0ccba2913cca` — 1 breaking, 1 warning
  - removed the required property `school_year` from the response with the `200` status
  - removed the optional property `is_past` from the response with the `200` status

[Change history](https://skmtc.dev/excellence-ai/apis/excellence-learning/changes/teacher_exercises/:exercise_id/edit-ai/post.md)

---

[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)
