Skip to main content
This page documents two related endpoints for managing course progress:
  1. Update course progress (mark lectures as completed)
  2. 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. The userId 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 $addToSet to prevent duplicate lecture completions
  • Creates a CourseProgress document 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. The userId 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

Request Example

Response Examples

Error Codes

Validation Schema