Lessons
Lessons are the ordered curriculum on a course. A lesson may be a video, text, a downloadable file, or a heading. These routes stay at /players/{id}/files.
Overview
Creates, updates, deletes, and reorders are draft writes. On a published course they are pending edits, and the live course changes when you publish. On a draft course they change the course itself. Lists and gets include pending edits when there are any, and they have no preview_url. See Draft, preview, and publish.
Lessons come back lowest order first. Rows that share an order come back in the order they were created. A lesson with type header is a heading. A lesson with is_hidden true stays in the list and in include=files on Get Course.
List Lessons is paginated. include=files returns every lesson.
Create places the new lesson after the highest order, or at 0 when the course has no lessons. Reorder Lessons is how you change order.
type is chosen on create and stays that type. Sending a different type returns 422. The value file is a downloadable lesson. header is a heading.
Delete Lesson on a draft course removes the lesson for good. On a published course it removes the lesson from the pending edits, and visitors still see it until you publish. is_hidden hides a lesson and leaves it in place.
A course id or a lesson id that is missing, that is not on that course, or that is not a UUID returns 404. See Identifiers.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /players/{id}/files | List lessons |
| POST | /players/{id}/files | Create a lesson |
| GET | /players/{playerId}/files/{id} | Get a lesson |
| PATCH | /players/{playerId}/files/{id} | Update a lesson |
| DELETE | /players/{playerId}/files/{id} | Delete a lesson |
| POST | /players/{id}/files/reorder | Reorder lessons |
Lesson Object
Every field is present. schedule is null when the lesson has no schedule.
| Field | Type | Description |
|---|---|---|
id | string | Immutable identifier (UUID) |
name | string | Display name. 1–255 characters. |
type | string | video, audio, file, pdf, google, embed, text, image, or header |
description | string|null | Longer description. null clears it. Starts null. |
text | string | Body text. Starts as "". |
src_url | string | Address of the lesson. Starts as "". |
video_source | string | youtube, vimeo, wistia, bunny, or other. When omitted on create, the stored value is vimeo. |
info | string | Short note, maximum 255 characters. Starts as "". |
is_free | boolean | Whether the lesson is free. Starts false. |
is_hidden | boolean | Hidden from visitors, and still returned by the API. Starts false. |
order | integer | Position in the curriculum, starting at 0 |
schedule | object|null | Schedule Object, or null |
Schedule Object
Send schedule as an object to set it, or null to clear it. Inside the object, omit a key to leave it unchanged. On a new schedule, an omitted key uses the starting value below. A day count of 0 is valid. null clears a date or a day count.
| Field | Type | Description |
|---|---|---|
release_at | string|null | When the lesson opens. ISO 8601 with a Z suffix. Starts null. |
is_visible_before_release | boolean | Whether the lesson is visible before release_at. Starts true. |
expires_at | string|null | When the lesson closes. ISO 8601 with a Z suffix. Starts null. |
is_visible_after_expiry | boolean | Whether the lesson is visible after expires_at. Starts true. |
release_after_days | integer|null | Days until the lesson opens. Starts null. |
expires_after_days | integer|null | Days until the lesson closes. Starts null. |
Reorder
Reorder Lessons takes the lessons you want to move. A lesson you leave out keeps its order.
items is required and must contain at least one entry. Each id is a lesson on this course. Each order is an integer 0 or greater.
A duplicate id, a duplicate order, or an order that matches a lesson you left out returns 422 and changes nothing. An id that is missing or not a UUID returns 404 and changes nothing. The response is every lesson in the new order, inside data, with no pagination. preview_url, draft_version, and draft_updated_at sit beside data.