Skip to main content

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 a 400 error.

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: string
  • idHtmlEncoded: string
  • clientId: string
  • status: GENERAL_STATUS
  • uniqueID: string
  • baseLessonID: string
  • imageUrl: string
  • imageBlurDataUrl: string
  • thumbImageUrl: string
  • title: Localizable (object with language keys, e.g. { en: "...", zh_Hans: "..." })
  • description: Localizable
  • videoURLs: string[]
  • videoId: string
  • subtitleUrl: Localizable
  • planEnrollmentId: string
  • MET: number
  • duration: number (seconds)
  • isIndividual: boolean
  • intensity: number | string
  • algorithm: WORKOUT_ALGORITHM
  • sessions: SessionConfig[] (see below)
  • groupByIntensity: GROUP_INTENSITY
  • groupByStyles: GROUP_STYLE[]
  • groupByTypes: GROUP_TYPE[]
  • groupByMuscles: GROUP_MUSCLE[]
  • groupByGoals: GROUP_GOAL[]
  • groupByEquipments: GROUP_EQUIPMENT[]
  • groupByTrainers: string[]
  • requiredWarmup: boolean
  • requiredCooldown: boolean
  • sync: boolean
  • batch: number
  • relatedLessons: LessonConfig[]
  • modifiedBy: string
  • modifyDatetime: { _seconds: number, _nanoseconds: number }
  • createdBy: string
  • createDatetime: { _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: number
  • category: string
  • title: Localizable
  • start: number (seconds)
  • end: number (seconds)
  • repPoseId: string
  • targetRepCount: 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.