- Update course progress (mark lectures as completed)
- Get current course progress
Update Course Progress
Mark a lecture as completed and update the user’s course progress. Automatically generates a certificate when course is completed.Authentication
Requires authentication via Clerk. TheuserId is automatically extracted from the authentication token.
Request Body
string
required
The unique identifier of the course
string
required
The unique identifier of the lecture to mark as completed
Response
boolean
required
Indicates whether the request was successful
string
required
Status message (e.g., “Progress Updated”)
boolean
required
True if all lectures in the course are now completed
boolean
required
True if a certificate has been generated and is available for download
Request Example
Response Examples
Error Codes
Behavior Notes
- Uses
$addToSetto prevent duplicate lecture completions - Creates a
CourseProgressdocument if it doesn’t exist (upsert) - Automatically marks course as completed when all lectures are finished
- Generates a certificate PDF and uploads to Cloudinary when course is completed
- Certificate includes QR code for verification
Validation Schema
Get Course Progress
Retrieve the user’s progress for a specific course.Authentication
Requires authentication via Clerk. TheuserId is automatically extracted from the authentication token.
Request Body
string
required
The unique identifier of the course
Response
boolean
required
Indicates whether the request was successful
object | null
Course progress data or null if no progress exists
string
Error message if success is false