---
title: "POST /api/admin/courses/{id}/mark_draft"
method: POST
path: "/api/admin/courses/{id}/mark_draft"
tags: ["Admin: Courses"]
---

# POST /api/admin/courses/{id}/mark_draft

`POST /api/admin/courses/{id}/mark_draft`

## Request

- The document declares no server URL.
- Auth: API key in cookie `session`

Mark a course as a draft. A state is not an update: each change of Course
      Readiness is its own operation with its own Permission. Any change between two
      distinct values is legal; repeating the current value is a 409 with a localized
      `detail`.

## Path parameters

- `id` integer, required

## Response `200`

The request has succeeded.

- Course: A course (legacy: `Language`). Superset read model: the public catalog embeds it, admin course screens read the full shape.
  - `id` integer, required
  - `slug` string, required
  - `name` string, nullable, required
  - `learnAs` 'first_language' | 'second_language', required: How a course is meant to be learned.
  - `readiness` 'completed' | 'in_development' | 'draft', required: Publication/readiness state of a course.
  - `categoryId` integer, nullable, required
  - `currentVersionId` integer, nullable, required
  - `currentVersion` CourseVersion, required: A build/version of a course's exercises (legacy `LanguageVersion`).
    - `id` integer, required
    - `name` string, nullable, required: The name the course's spec gives this build (e.g. "JavaScript"). Legacy's lesson page opens its meta description with it, in brackets.
    - `result` string, nullable, required
    - `state` string, nullable, required
    - `createdAt` string, date-time, required
  - `createdAt` string, date-time, required
  - `enrollmentsCount` integer, required
  - `lessonsCount` integer, required
  - `ratingCount` integer, required
  - `ratingValue` number, double, required
  - `repositoryUrl` string, nullable, required
  - `hexletProgramLandingPage` string, nullable, required
  - `coverListVariant` string, nullable, required
  - `coverThumbVariant` string, nullable, required

## Other responses

- `default`: Default error response shared by every operation. `@error` emits an OpenAPI `default` response, keeping central transport failures typed without enumerating every status on every operation.

## Changes

- **2026-10-18** `9380d4c85a04`: 3 info
  - removed the non-success response with the status `401`
  - removed the non-success response with the status `403`
  - added the optional property `errors` to the response with the `default` status
- **2026-10-17** `023e7c2cd140`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/hexlet-basics/apis/hexlet-basics-api/changes/api/admin/courses/:id/mark_draft/post.md)

---

[API](https://skmtc.dev/hexlet-basics/apis/hexlet-basics-api.md) · [All operations](https://skmtc.dev/hexlet-basics/apis/hexlet-basics-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hexlet-basics/apis/hexlet-basics-api/revisions/51c7f596b47c?raw)
