Course lessons

Update course lesson

Changed on

Update a lesson's content, type, visibility, assessment questions, or media attachments.

Required permissions:

  • courses:update
patch/course_lessons/{id}

Request

  • Base URL
    https://api.whop.com/api/v1
  • Auth
    HTTP bearer

Path parameters

id, string required
Example:lesn_xxxxxxxxxxxxx

The unique identifier of the lesson to update (for example, "lesn_XXXXX").

Request body

object required

Parameters for UpdateLesson

assessment_completion_requirement, object nullable

The passing criteria for quiz or knowledge check lessons, such as minimum grade or correct answers.

assessment_questions, object[] nullable

The full list of assessment questions for quiz or knowledge check lessons. Replaces all existing questions.

attachments, object[] nullable

File attachments for the lesson such as PDFs or documents. Replaces all existing attachments.

content, string nullable

The Markdown content body of the lesson.

days_from_course_start_until_unlock, integer nullable

The number of days after a student starts the course before this lesson becomes accessible.

embed_id, string nullable

The external video identifier for embedded content (e.g., a YouTube video ID or Loom share ID).

embed_type, 'youtube' | 'loom' nullable

The type of embed for a lesson

lesson_type, 'text' | 'video' | 'pdf' | 'multi' | 'quiz' | 'knowledge_check' nullable

The available types for a lesson

main_pdf, object nullable

The primary PDF document attached to this lesson for student reference.

max_attempts, integer nullable

The maximum number of attempts a student is allowed for assessment lessons.

mux_asset_id, string nullable

The identifier of a Mux video asset to attach to this lesson (e.g., "mux_XXXXX").

thumbnail, object nullable

The thumbnail image for the lesson in PNG, JPEG, or GIF format.

title, string nullable

The display title of the lesson (e.g., "Getting Started with APIs").

visibility, 'visible' | 'hidden' nullable

The available visibilities for a lesson. Determines how / whether a lesson is visible to users.

Example request

{
  "assessment_completion_requirement": {
    "minimum_grade_percent": 6.9,
    "minimum_questions_correct": 42
  },
  "days_from_course_start_until_unlock": 42,
  "max_attempts": 42,
  "mux_asset_id": "mux_xxxxxxxxxxxxxx"
}

Response

A successful response

CourseLesson required

An individual learning unit within a chapter, which can contain text, video, PDF, or assessment content.

assessment_questions, object[] required

The list of questions for quiz or knowledge check lessons. Empty for non-assessment lesson types.

attachments, object[] required

All supplementary files attached to this lesson returned as a flat array rather than a paginated connection.

content, string nullable required

The Markdown content body of the lesson. Null if the lesson has no text content.

created_at, string date-time required

The datetime the lesson was created.

days_from_course_start_until_unlock, integer nullable required

The number of days after a student starts the course before this lesson becomes accessible. Null if the lesson is available immediately.

embed_id, string nullable required

The external video identifier for embedded video lessons, such as a YouTube video ID or Loom share ID. Null if the lesson has no embed.

embed_type, 'youtube' | 'loom' nullable required

The type of embed for a lesson

id, string required

The unique identifier for the lesson.

lesson_type, 'text' | 'video' | 'pdf' | 'multi' | 'quiz' | 'knowledge_check' required

The content format of this lesson. One of: text, video, pdf, multi, quiz, knowledge_check.

main_pdf, object nullable required

The primary PDF document for PDF-type lessons. Null if this lesson is not a PDF lesson or no PDF has been uploaded.

order, integer required

The sort position of this lesson within its parent chapter, starting from zero.

thumbnail, object nullable required

The thumbnail image displayed on lesson cards and previews. Null if no thumbnail has been uploaded.

title, string required

The display name of the lesson shown to students. Maximum 120 characters.

video_asset, object nullable required

The Mux video asset for video-type lessons, used for streaming playback. Null if this lesson has no hosted video.

visibility, 'visible' | 'hidden' required

The visibility setting that controls whether this lesson appears to students. One of: visible, hidden.

Example response

{
  "assessment_questions": [
    {
      "created_at": "2023-12-01T05:00:00.401Z",
      "id": "crsaq_xxxxxxxxxxxx",
      "image": {
        "content_type": "image/jpeg",
        "filename": "document.pdf",
        "url": "https://media.whop.com/abc123/optimized.jpg"
      },
      "options": [
        {
          "id": "crsaqo_xxxxxxxxxxx",
          "order": 42
        }
      ],
      "order": 42
    }
  ],
  "attachments": [
    {
      "content_type": "image/jpeg",
      "filename": "document.pdf",
      "url": "https://media.whop.com/abc123/optimized.jpg"
    }
  ],
  "content": "In this lesson, we will cover washing, decontamination, and paint preparation before ceramic coating.",
  "created_at": "2023-12-01T05:00:00.401Z",
  "days_from_course_start_until_unlock": 42,
  "embed_id": "dQw4w9WgXcQ",
  "id": "lesn_xxxxxxxxxxxxx",
  "main_pdf": {
    "content_type": "image/jpeg",
    "filename": "document.pdf",
    "url": "https://media.whop.com/abc123/optimized.jpg"
  },
  "order": 42,
  "thumbnail": {
    "url": "https://media.whop.com/abc123/optimized.jpg"
  },
  "title": "Preparing Paint for Ceramic Coating",
  "video_asset": {
    "created_at": "2023-12-01T05:00:00.401Z",
    "duration_seconds": 42,
    "finished_uploading_at": "2023-12-01T05:00:00.401Z",
    "id": "mux_xxxxxxxxxxxxxx",
    "updated_at": "2023-12-01T05:00:00.401Z"
  }
}

Changes