Docs Guides

Building the learner experience

The endpoints behind a course player, and the rules they enforce.

Everything a learner does happens inside an enrollment, under /api/v1/me/enrollments/{id}/…. The enrollment must be the caller’s own (otherwise 404, as if it didn’t exist), and active to act. A completed one can still be viewed.

A course player in five calls#

Step Call
List my courses GET /me/enrollments
Show the outline GET /me/enrollments/{e}/course
Open a lesson GET /me/enrollments/{e}/lessons/{l}
Track time PUT /me/enrollments/{e}/lessons/{l}/progress
Mark done POST /me/enrollments/{e}/lessons/{l}/complete

Rules worth knowing#

  • Opening starts. Opening a lesson starts it, and a VIEWED lesson completes right there.
  • Sequential unlock. With unlockMode: AFTER_PREVIOUS, a lesson is locked until the nearest earlier required lesson is complete. The outline tells you which are locked.
  • Progress is completed required lessons divided by required lessons.
  • Completion follows the course’s policy. It completes the enrollment, emits enrollment.completed, issues the certificate, and frees the seat. A completed learner is never re-enrolled automatically.
  • Resume. Send resumeState (for example a video position) in the heartbeat. It comes back when the lesson is opened.

Heartbeat#

ENROLLMENT_ID=8b76f3d8-59e7-4058-910d-15418a61b368
LESSON_ID=3d477cf4-98e8-48b4-997a-a370054d706c
curl -X PUT "$LMS_URL/api/v1/me/enrollments/$ENROLLMENT_ID/lessons/$LESSON_ID/progress" \
  -H "Authorization: Bearer $LMS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "secondsSpent": 30,
  "resumeState": {
    "position": 142
  }
}'

secondsSpent is 0 to 300 per call.

Files#

Fetch course files from GET /me/enrollments/{e}/assets/{assetId}/content. Only files used by the learner’s course version are served.

Expiry#

Enrollments past expiresAt become EXPIRED (seat released). Access is also blocked immediately on read, so correctness never depends on a background job’s timing.

Tip

These endpoints take a learner token, not an API key. If your app has its own users, have your server call POST /learners/{your-user-id}/session to get a token for each (see the Quickstart). People who joined by invitation sign in with their own password instead.

Type to search guides and every endpoint.