Updates an existing lesson with the provided information.
Body
Required
-
Title of the lesson
Maximum length is
200. -
Lesson content or instructions
-
Subject code
-
Type of lesson
Values are
assignment,material,lecture, orquiz. -
Status of the lesson
Values are
draft,published, orarchived. -
Learning objectives
-
Private teacher notes/plan
-
Maximum points for assignments
-
Due date for assignments
PATCH
/lessons/{id}
curl \
--request PATCH 'https://api.huy-devops.site/api/lessons/{id}' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"title":"Quadratic Equations","content":"Students will learn to solve quadratic equations...","subject":"MATH101","type":"lecture","status":"published","learningObjectives":[{"description":"string","type":"string","isAchieved":true,"notes":"string"}],"lessonPlan":"string","maxPoints":42,"dueDate":"2026-05-04T09:42:00Z"}'
Request examples
{
"title": "Quadratic Equations",
"content": "Students will learn to solve quadratic equations...",
"subject": "MATH101",
"type": "lecture",
"status": "published",
"learningObjectives": [
{
"description": "string",
"type": "string",
"isAchieved": true,
"notes": "string"
}
],
"lessonPlan": "string",
"maxPoints": 42,
"dueDate": "2026-05-04T09:42:00Z"
}
Response examples (200)
{
"success": true,
"code": 200,
"message": "string",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440005",
"classId": "550e8400-e29b-41d4-a716-446655440000",
"authorId": "550e8400-e29b-41d4-a716-446655440001",
"title": "Quadratic Equations",
"subject": "MATH101",
"content": "Students will learn to solve quadratic equations...",
"type": "lecture",
"status": "published",
"learningObjectives": [
{
"description": "Students will be able to solve quadratic equations",
"type": "knowledge",
"isAchieved": false,
"notes": "string"
}
],
"lessonPlan": "Start with examples, then practice problems",
"maxPoints": 100,
"dueDate": "2024-09-30T23:59:59Z",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-09-20T14:45:00Z"
}
}
Response examples (400)
{
"success": false,
"code": 42,
"errorCode": "string",
"message": "string",
"timestamp": "2026-05-04T09:42:00Z"
}
Response examples (404)
{
"success": false,
"code": 42,
"errorCode": "string",
"message": "string",
"timestamp": "2026-05-04T09:42:00Z"
}
Response examples (500)
{
"success": false,
"code": 42,
"errorCode": "string",
"message": "string",
"timestamp": "2026-05-04T09:42:00Z"
}