Lessons API
GET /api/lessons
List all lessons for the authenticated client.
Query Parameters
clientId: string (required) — The client identifier. Requests without this parameter will return a400error.
Headers:
Authorization: Bearer <JWT>
Response
200 OK:{ data: Array<LessonConfig> }400 Bad Request:{ error: 'clientId is required.' }401 Unauthorized:{ error: string }500 Internal Server Error:{ error: string }
Each LessonConfig object includes (fields may be optional):
id: stringidHtmlEncoded: stringclientId: stringstatus: GENERAL_STATUSuniqueID: stringbaseLessonID: stringimageUrl: stringimageBlurDataUrl: stringthumbImageUrl: stringtitle: Localizable (object with language keys, e.g.{ en: "...", zh_Hans: "..." })description: LocalizablevideoURLs: string[]videoId: stringsubtitleUrl: LocalizableplanEnrollmentId: stringMET: numberduration: number (seconds)isIndividual: booleanintensity: number | stringalgorithm: WORKOUT_ALGORITHMsessions: SessionConfig[] (see below)groupByIntensity: GROUP_INTENSITYgroupByStyles: GROUP_STYLE[]groupByTypes: GROUP_TYPE[]groupByMuscles: GROUP_MUSCLE[]groupByGoals: GROUP_GOAL[]groupByEquipments: GROUP_EQUIPMENT[]groupByTrainers: string[]requiredWarmup: booleanrequiredCooldown: booleansync: booleanbatch: numberrelatedLessons: LessonConfig[]modifiedBy: stringmodifyDatetime:{ _seconds: number, _nanoseconds: number }createdBy: stringcreateDatetime:{ _seconds: number, _nanoseconds: number }
GET /api/lessons/[id]
Fetch a lesson by its ID.
Headers:
Authorization: Bearer <JWT>
Path Parameters:
id: string (required) — The lesson's unique identifier
Response:
200 OK:{ lesson: LessonConfig }404 Not Found:{ error: string }401 Unauthorized:{ error: string }500 Internal Server Error:{ error: string }
SessionConfig (in sessions array)
Each lesson contains an array of SessionConfig objects. See src/types/lesson/session-config.ts for full details, but typical fields include:
index: numbercategory: stringtitle: Localizablestart: number (seconds)end: number (seconds)repPoseId: stringtargetRepCount: number
note
All fields may not be present on every lesson.
For the most up-to-date schema, refer to src/types/lesson/lesson-config.ts and src/types/lesson/session-config.ts.
Only documented fields are guaranteed; additional fields may be present depending on lesson data.