Skip to main content

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​

MethodEndpointDescription
GET/players/{id}/filesList lessons
POST/players/{id}/filesCreate 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/reorderReorder lessons

Lesson Object​

Every field is present. schedule is null when the lesson has no schedule.

FieldTypeDescription
idstringImmutable identifier (UUID)
namestringDisplay name. 1–255 characters.
typestringvideo, audio, file, pdf, google, embed, text, image, or header
descriptionstring|nullLonger description. null clears it. Starts null.
textstringBody text. Starts as "".
src_urlstringAddress of the lesson. Starts as "".
video_sourcestringyoutube, vimeo, wistia, bunny, or other. When omitted on create, the stored value is vimeo.
infostringShort note, maximum 255 characters. Starts as "".
is_freebooleanWhether the lesson is free. Starts false.
is_hiddenbooleanHidden from visitors, and still returned by the API. Starts false.
orderintegerPosition in the curriculum, starting at 0
scheduleobject|nullSchedule 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.

FieldTypeDescription
release_atstring|nullWhen the lesson opens. ISO 8601 with a Z suffix. Starts null.
is_visible_before_releasebooleanWhether the lesson is visible before release_at. Starts true.
expires_atstring|nullWhen the lesson closes. ISO 8601 with a Z suffix. Starts null.
is_visible_after_expirybooleanWhether the lesson is visible after expires_at. Starts true.
release_after_daysinteger|nullDays until the lesson opens. Starts null.
expires_after_daysinteger|nullDays 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.