Skip to main content

Get Progress

Retrieves progress records for the authenticated user.

Query Parameters

number
Filter progress by specific course ID

Response

array
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

number
required
Course ID
number
required
Lesson ID
boolean
Whether the lesson is completed
number
Current video playback position in seconds
number
Last known playback position in seconds

Response

object
Updated or created progress object

Example Request

Example Response


Progress Tracking Logic

The API uses an upsert pattern:
  1. Check for existing record: Query by user_id + lesson_id
  2. If exists: Update the record with new values
  3. If not exists: Insert a new progress record
  4. Return: The updated or created record
This ensures:
  • 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

  1. User watches video to 180 seconds
  2. Client sends: { video_progress: 180, last_position: 180 }
  3. User closes browser
  4. User returns to lesson
  5. Client fetches progress: GET /api/progress?courseId=42
  6. Client resumes video at last_position (180 seconds)

Lesson Completion

To mark a lesson as completed:
The API automatically:
  • Sets completed_at timestamp
  • Updates enrollment progress percentage
  • Checks if course is fully completed
  • Triggers certificate generation (if enabled)

Course Completion Calculation

Course progress is calculated as:
Only lessons with is_required = true are counted. When all required lessons are completed:
  1. Enrollment status → “completed”
  2. Enrollment completed_at → current timestamp
  3. Certificate generation triggered (if enabled)
  4. 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

string
required
Learner UUID

Query Parameters

number
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