Get Progress
Retrieves progress records for the authenticated user.Query Parameters
Filter progress by specific course ID
Response
Array of progress objects
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
Course ID
Lesson ID
Whether the lesson is completed
Current video playback position in seconds
Last known playback position in seconds
Response
Updated or created progress object
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
| State | Conditions | Description |
|---|---|---|
| Not Started | No progress record exists | User hasn’t accessed the lesson |
| In Progress | completed = false, video_progress > 0 | User started but hasn’t completed |
| Completed | completed = true, completed_at set | User finished the lesson |
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
Learner UUID
Query Parameters
Filter by specific course
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
Error Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Missing required fields |
| 401 | Unauthorized - Authentication required |
| 500 | Internal Server Error |