---
title: "Close Draft"
method: POST
path: "/admin/class-list-import/drafts/{draft_id}/close"
tags: ["admin-class-list-import"]
---

# Close Draft

`POST /admin/class-list-import/drafts/{draft_id}/close`

Imported (with the recap of what the class endpoints did) or
discarded. The draft itself is the only thing written here.

## Path parameters

- `draft_id` string, required

## Request body

- ClassListDraftClose
  - `status` 'imported' | 'discarded', required
  - `classes` DraftClassSchema[]
    - `name` string, required
    - `grade` 'sixieme' | 'cinquieme' | 'quatrieme' | 'troisieme' | 'seconde' | 'premiere' | 'terminale' | 'prepa', nullable
    - `teacher` DraftTeacherSchema
      - `first_name` string, nullable
      - `last_name` string, nullable
      - `email` string, nullable
    - `students` DraftStudentSchema[]
      - `first_name` string, required
      - `last_name` string, required
      - `email` string, nullable
    - `teacher_user_id` string, nullable
  - `recap` ClassImportRecapSchema[]
    - `name` string, required
    - `teacher` string, required
    - `created` boolean
    - `pending_teacher` boolean
    - `class_code` string, nullable
    - `students_added` integer
    - `students_skipped` integer
    - `invitations_sent` integer
    - `attached` integer
    - `already_linked` integer
    - `attach_skipped` integer
    - `warnings` string[]
    - `error` string, nullable

## Response `200`

Successful Response

- ClassListImportDraftResponse
  - `id` string, required
  - `status` 'pending' | 'imported' | 'discarded', required
  - `source` 'page' | 'mcp', required
  - `title` string, required
  - `created_by` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `closed_at` string, date-time, nullable
  - `closed_by` string, nullable
  - `source_text` string, required
  - `classes` DraftClassSchema[], required
    - `name` string, required
    - `grade` 'sixieme' | 'cinquieme' | 'quatrieme' | 'troisieme' | 'seconde' | 'premiere' | 'terminale' | 'prepa', nullable
    - `teacher` DraftTeacherSchema
      - `first_name` string, nullable
      - `last_name` string, nullable
      - `email` string, nullable
    - `students` DraftStudentSchema[]
      - `first_name` string, required
      - `last_name` string, required
      - `email` string, nullable
    - `teacher_user_id` string, nullable
  - `notes` string[], required
  - `recap` ClassImportRecapSchema[], required
    - `name` string, required
    - `teacher` string, required
    - `created` boolean
    - `pending_teacher` boolean
    - `class_code` string, nullable
    - `students_added` integer
    - `students_skipped` integer
    - `invitations_sent` integer
    - `attached` integer
    - `already_linked` integer
    - `attach_skipped` integer
    - `warnings` string[]
    - `error` string, nullable
  - `page_url` string, required

## Other responses

- `404` — Resource not found
- `409` — Business rule violated
- `422` — Validation Error

## Changes

> 24 revisions in range; 1 not diffed.

- **2026-09-25** `a8ae0e0c0570` — 2 info
  - added the new optional request property `recap/items/pending_teacher`
  - added the optional property `recap/items/pending_teacher` to the response with the `200` status
- **2026-09-14** `0a41d91c9d20` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/excellence-ai/apis/excellence-learning/changes/admin/class-list-import/drafts/:draft_id/close/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/b9758ca4fea6?raw)
