Get Progress
Retrieves progress records for the authenticated user.Query Parameters
Response
Example Request
Example Response
Update Progress
Updates or creates a progress record for a lesson. This endpoint is used to:- Track video playback position
- Mark lessons as completed
- Update overall course progress
Request Body
Response
Example Request
Example Response
Progress Tracking Logic
The API uses an upsert pattern:- Check for existing record: Query by
user_id+lesson_id - If exists: Update the record with new values
- If not exists: Insert a new progress record
- Return: The updated or created record
- No duplicate progress records
- Seamless updates without checking existence first
- Automatic progress resumption
Video Progress Tracking
For video lessons:- video_progress: Current playback position (updated frequently)
- last_position: Last saved position (for resume functionality)
- Allows users to resume from where they left off
- Progress is saved every few seconds during playback
Example: Video Resume Flow
- User watches video to 180 seconds
- Client sends:
{ video_progress: 180, last_position: 180 } - User closes browser
- User returns to lesson
- Client fetches progress: GET
/api/progress?courseId=42 - Client resumes video at
last_position(180 seconds)
Lesson Completion
To mark a lesson as completed:- Sets
completed_attimestamp - Updates enrollment progress percentage
- Checks if course is fully completed
- Triggers certificate generation (if enabled)
Course Completion Calculation
Course progress is calculated as:is_required = true are counted.
When all required lessons are completed:
- Enrollment status → “completed”
- Enrollment
completed_at→ current timestamp - Certificate generation triggered (if enabled)
- Completion email sent
Progress States
Sequential Progress
Some courses require sequential progress (requires_sequential_progress = true):
- Users must complete lessons in order
- Can’t skip ahead to later lessons
- Progress API doesn’t enforce this (enforced in frontend)
- Backend only tracks completion state
Get Learner Progress (Admin)
Admins can view any learner’s progress.Path Parameters
Query Parameters
Progress Analytics
Progress data can be used for:- Course completion rates: % of enrolled users who complete
- Lesson difficulty: Lessons with low completion rates
- Drop-off points: Where users stop progressing
- Engagement metrics: Average video watch time
- Time to completion: Days from enrollment to completion