---
title: "Create Draft"
method: POST
path: "/admin/class-list-import/drafts"
tags: ["admin-class-list-import"]
---

# Create Draft

`POST /admin/class-list-import/drafts`

A draft to review on the page. Writes the draft only, never a class.

## Request body

- ClassListDraftCreate — A draft from raw input (text or file: the server structures it) or from classes the caller already structured (`classes` wins).
  - `text` string, nullable
  - `file_content` string, nullable
  - `file_name` string, nullable
  - `content_type` string, nullable
  - `classes` DraftClassSchema[], nullable
    - `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[]
  - `title` string
  - `source` 'page' | 'mcp'

## 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
    - `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

- `400` — Malformed identifier
- `422` — Validation Error
- `502` — Upstream LLM returned unusable output

## Changes

- **2026-09-14** `0a41d91c9d20` — 1 info
  - endpoint added

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