---
title: "Create lesson"
method: POST
path: "/chapters/{chapter_id}/lessons"
tags: ["Lessons"]
---

# Create lesson

`POST /chapters/{chapter_id}/lessons`

## Request

- Base URL: `https://api.crevio.co/v1`
- URL: `https://api.crevio.co/v1/chapters/{chapter_id}/lessons`
- Auth: API key in header `Authorization`

Adds a lesson to a chapter

## Path parameters

- `chapter_id` string, required

## Headers

- `Idempotency-Key` string

## Request body

- LessonRequest
  - `title` string: Lesson title (defaults to "Lesson N")
  - `lesson_type` string: Lesson type (defaults to `multimedia`)
  - `html_content` string, nullable: Rich-text lesson body
  - `video_url` string, nullable: URL of the lesson's video
  - `is_published` boolean

## Response `201`

Lesson created

- Lesson
  - `id` string, required
  - `object` string, required
  - `title` string, required
  - `position` integer, required
  - `lesson_type` string, required
  - `published` boolean, required
  - `published_at` string, date-time, nullable, required
  - `html_content` string, nullable, required
  - `chapter` string, required
  - `video_url` string, nullable, required
  - `files` object[], required
    - `id` string, required
    - `filename` string, nullable, required
    - `content_type` string, nullable
    - `byte_size` integer, required
    - `url` string, required

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Resource not found
- `422`: Validation error
- `429`: Rate limit exceeded — 600 requests per minute per credential. Retry after the number of seconds in `Retry-After`.
- `500`: Internal server error

---

[API](https://skmtc.dev/crevio/apis/crevio-api-v1.md) · [All operations](https://skmtc.dev/crevio/apis/crevio-api-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/crevio/apis/crevio-api-v1/revisions/2219f18ad651?raw)
