Add a new lesson to a specific topic within the unit. Lessons are the primary learning content units. Only admins and lecturers can create lessons.
POST
/api/v1/unit-instance/{unit}/{topic}/new-lesson
curl \
--request POST 'https://api.echoplain.social/api/v1/unit-instance/123e4567-e89b-12d3-a456-426614174000/topic-123/new-lesson' \
--header "Content-Type: application/json" \
--data '{"type":"NORMAL","title":"Introduction to Binary Search","duration":45,"orderIndex":1,"description":"Learn how binary search works with examples"}'
Request example
{
"type": "NORMAL",
"title": "Introduction to Binary Search",
"duration": 45,
"orderIndex": 1,
"description": "Learn how binary search works with examples"
}
Response examples (201)
{
"lesson": {
"id": "lesson-456",
"type": "NORMAL",
"title": "Introduction to Binary Search",
"topicId": "topic-123",
"duration": 45,
"createdAt": "2025-11-17T10:30:00Z"
},
"message": "Lesson created successfully"
}