> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create course lesson

> Create a new lesson within a course chapter. Lessons can contain video, text, or assessment content.

Required permissions:
 - `courses:update`



## OpenAPI

````yaml /openapi/api-v1-stable.json post /course_lessons
openapi: 3.1.0
info:
  description: >-
    The Whop REST API. Please see
    https://docs.whop.com/developer/api/getting-started for more details.
  termsOfService: https://whop.com/tos-developer-api/
  title: Whop API
  version: 1.0.0
  x-api-version-date: '2026-08-21'
servers:
  - description: Production Whop API
    url: https://api.whop.com/api/v1
  - description: Sandbox Whop API
    url: https://sandbox-api.whop.com/api/v1
security: []
tags:
  - description: Products
    name: Products
  - description: Payments
    name: Payments
  - description: Refunds
    name: Refunds
  - description: Disputes
    name: Disputes
  - description: Dispute alerts
    name: Dispute alerts
  - description: Resolution center cases
    name: Resolution center cases
  - description: Checkout configurations
    name: Checkout configurations
  - description: Setup intents
    name: Setup intents
  - description: Payment methods
    name: Payment methods
  - description: Invoices
    name: Invoices
  - description: Promo codes
    name: Promo codes
  - description: Card transactions
    name: Card transactions
  - description: Ledger accounts
    name: Ledger accounts
  - description: Withdrawals
    name: Withdrawals
  - description: Payout methods
    name: Payout methods
  - description: Verifications
    name: Verifications
  - description: Identity profiles
    name: Identity profiles
  - description: Payout accounts
    name: Payout accounts
  - description: Topups
    name: Topups
  - description: Companies
    name: Companies
  - description: Authorized users
    name: Authorized users
  - description: Fee markups
    name: Fee markups
  - description: Members
    name: Members
  - description: Memberships
    name: Memberships
  - description: Leads
    name: Leads
  - description: Entries
    name: Entries
  - description: Shipments
    name: Shipments
  - description: Reviews
    name: Reviews
  - description: Company token transactions
    name: Company token transactions
  - description: Affiliates
    name: Affiliates
  - description: Experiences
    name: Experiences
  - description: Forums
    name: Forums
  - description: Forum posts
    name: Forum posts
  - description: Chat channels
    name: Chat channels
  - description: Support channels
    name: Support channels
  - description: Messages
    name: Messages
  - description: Reactions
    name: Reactions
  - description: Dm members
    name: Dm members
  - description: Dm channels
    name: Dm channels
  - description: Notifications
    name: Notifications
  - description: Courses
    name: Courses
  - description: Course chapters
    name: Course chapters
  - description: Course lessons
    name: Course lessons
  - description: Course students
    name: Course students
  - description: Course lesson interactions
    name: Course lesson interactions
  - description: Apps
    name: Apps
  - description: Webhooks
    name: Webhooks
  - description: App builds
    name: App builds
  - description: Access tokens
    name: Access tokens
  - description: Account links
    name: Account links
  - description: Files
    name: Files
  - description: Ai chats
    name: Ai chats
  - description: Bounties
    name: Bounties
  - description: Stats
    name: Stats
  - description: Conversions
    name: Conversions
  - description: Ad reports
    name: Ad reports
paths:
  /course_lessons:
    post:
      tags:
        - Course lessons
      summary: Create course lesson
      description: >-
        Create a new lesson within a course chapter. Lessons can contain video,
        text, or assessment content.


        Required permissions:
         - `courses:update`
      operationId: createCourseLesson
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              description: Parameters for CreateLesson
              properties:
                chapter_id:
                  description: >-
                    The unique identifier of the chapter to create the lesson in
                    (e.g., "chap_XXXXX").
                  example: chap_xxxxxxxxxxxxx
                  type: string
                content:
                  description: The Markdown content body of the lesson.
                  type:
                    - string
                    - 'null'
                days_from_course_start_until_unlock:
                  description: >-
                    The number of days after a student starts the course before
                    this lesson becomes accessible.
                  example: 42
                  type:
                    - integer
                    - 'null'
                embed_id:
                  description: >-
                    The external video identifier for embedded content (e.g., a
                    YouTube video ID or Loom share ID).
                  type:
                    - string
                    - 'null'
                embed_type:
                  description: >-
                    The type of video embed for this lesson, such as YouTube or
                    Loom.
                  oneOf:
                    - $ref: '#/components/schemas/EmbedTypes'
                    - type: 'null'
                lesson_type:
                  $ref: '#/components/schemas/LessonTypes'
                  description: >-
                    The content type of the lesson, such as video, text, quiz,
                    or knowledge check.
                thumbnail:
                  description: >-
                    The thumbnail image for the lesson in PNG, JPEG, or GIF
                    format.
                  properties:
                    id:
                      description: The ID of an existing file object.
                      type: string
                  required:
                    - id
                  title: FileInputWithId
                  type:
                    - object
                    - 'null'
                title:
                  description: >-
                    The display title of the lesson (e.g., "Getting Started with
                    APIs").
                  type:
                    - string
                    - 'null'
              required:
                - chapter_id
                - lesson_type
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseLesson'
          description: A successful response
        '400':
          content:
            application/json:
              example:
                error:
                  code: parameter_missing
                  message: 'Missing required parameter: amount.'
                  param: amount
                  type: invalid_request_error
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Bad request
        '401':
          content:
            application/json:
              example:
                error:
                  message: Invalid or missing API key
                  type: unauthorized
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Unauthorized
        '403':
          content:
            application/json:
              example:
                error:
                  message: You do not have permission to access this resource
                  type: forbidden
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Forbidden
        '404':
          content:
            application/json:
              example:
                error:
                  message: Resource not found
                  type: not_found
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Not found
        '422':
          content:
            application/json:
              example:
                error: null
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Verification required
        '429':
          content:
            application/json:
              example:
                error: null
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Too many requests
        '500':
          content:
            application/json:
              example:
                error:
                  message: An unexpected error occurred
                  type: internal_server_error
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Internal server error
      security:
        - bearerAuth:
            - courses:update
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Whop from '@whop/sdk';

            const client = new Whop({
              apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
            });

            const lesson = await client.courseLessons.create({
              chapter_id: 'chap_xxxxxxxxxxxxx',
              lesson_type: 'text',
            });

            console.log(lesson.id);
components:
  schemas:
    EmbedTypes:
      description: The type of embed for a lesson
      enum:
        - youtube
        - loom
      type: string
    LessonTypes:
      description: The available types for a lesson
      enum:
        - text
        - video
        - pdf
        - multi
        - quiz
        - knowledge_check
      type: string
    CourseLesson:
      description: >-
        An individual learning unit within a chapter, which can contain text,
        video, PDF, or assessment content.
      properties:
        assessment_questions:
          description: >-
            The list of questions for quiz or knowledge check lessons. Empty for
            non-assessment lesson types.
          items:
            description: An assessment question in a course quiz or knowledge check
            properties:
              correct_answer:
                description: >-
                  The correct answer for the question. Used for short answer
                  questions. Only visible to admins (users with courses:update
                  permission)
                type:
                  - string
                  - 'null'
              created_at:
                description: The datetime the assessment question was created.
                example: '2023-12-01T05:00:00.401Z'
                format: date-time
                type: string
              id:
                description: The unique identifier for the assessment question.
                example: crsaq_xxxxxxxxxxxx
                type: string
              image:
                description: Optional image attachment for the question
                properties:
                  content_type:
                    description: >-
                      Uploaded file MIME type, such as image/jpeg, video/mp4, or
                      audio/mpeg.
                    example: image/jpeg
                    type:
                      - string
                      - 'null'
                  filename:
                    description: >-
                      The original filename of the uploaded attachment,
                      including its file extension.
                    example: document.pdf
                    type:
                      - string
                      - 'null'
                  id:
                    description: >-
                      Represents a unique identifier that is Base64 obfuscated.
                      It is often used to refetch an object or as key for a
                      cache. The ID type appears in a JSON response as a String;
                      however, it is not intended to be human-readable. When
                      expected as an input type, any string (such as
                      `"VXNlci0xMA=="`) or integer (such as `4`) input value
                      will be accepted as an ID.
                    type: string
                  url:
                    description: >-
                      A pre-optimized URL for rendering this attachment on the
                      client. This should be used for displaying attachments in
                      apps.
                    example: https://media.whop.com/abc123/optimized.jpg
                    type:
                      - string
                      - 'null'
                required:
                  - id
                  - filename
                  - content_type
                  - url
                type:
                  - object
                  - 'null'
              options:
                description: The answer options for multiple choice/select questions
                items:
                  description: >-
                    An answer option for a multiple choice or multiple select
                    assessment question
                  properties:
                    id:
                      description: >-
                        The unique identifier for the assessment question
                        option.
                      example: crsaqo_xxxxxxxxxxx
                      type: string
                    is_correct:
                      description: >-
                        Whether this option is a correct answer. Only visible to
                        admins (users with courses:update permission)
                      type:
                        - boolean
                        - 'null'
                    option_text:
                      description: The text of the answer option
                      type: string
                    order:
                      description: The order of this option within the question
                      example: 42
                      type: integer
                  required:
                    - id
                    - option_text
                    - is_correct
                    - order
                  type: object
                type: array
              order:
                description: The order of the question within its lesson
                example: 42
                type: integer
              question_text:
                description: The text of the question
                type: string
              question_type:
                $ref: '#/components/schemas/CoursesAssessmentQuestionTypes'
                description: The type of the question
            required:
              - id
              - question_text
              - question_type
              - correct_answer
              - order
              - created_at
              - image
              - options
            type: object
          type: array
        attachments:
          description: >-
            All supplementary files attached to this lesson returned as a flat
            array rather than a paginated connection.
          items:
            description: Represents an image attachment
            properties:
              content_type:
                description: >-
                  Uploaded file MIME type, such as image/jpeg, video/mp4, or
                  audio/mpeg.
                example: image/jpeg
                type:
                  - string
                  - 'null'
              filename:
                description: >-
                  The original filename of the uploaded attachment, including
                  its file extension.
                example: document.pdf
                type:
                  - string
                  - 'null'
              id:
                description: >-
                  Represents a unique identifier that is Base64 obfuscated. It
                  is often used to refetch an object or as key for a cache. The
                  ID type appears in a JSON response as a String; however, it is
                  not intended to be human-readable. When expected as an input
                  type, any string (such as `"VXNlci0xMA=="`) or integer (such
                  as `4`) input value will be accepted as an ID.
                type: string
              url:
                description: >-
                  A pre-optimized URL for rendering this attachment on the
                  client. This should be used for displaying attachments in
                  apps.
                example: https://media.whop.com/abc123/optimized.jpg
                type:
                  - string
                  - 'null'
            required:
              - id
              - filename
              - content_type
              - url
            type: object
          type: array
        content:
          description: >-
            The Markdown content body of the lesson. Null if the lesson has no
            text content.
          example: In this lesson, we will cover the basics of technical analysis...
          type:
            - string
            - 'null'
        created_at:
          description: The datetime the lesson was created.
          example: '2023-12-01T05:00:00.401Z'
          format: date-time
          type: string
        days_from_course_start_until_unlock:
          description: >-
            The number of days after a student starts the course before this
            lesson becomes accessible. Null if the lesson is available
            immediately.
          example: 42
          type:
            - integer
            - 'null'
        embed_id:
          description: >-
            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.
          example: dQw4w9WgXcQ
          type:
            - string
            - 'null'
        embed_type:
          description: >-
            The platform type for the embedded video. One of: youtube, loom.
            Null if the lesson has no embed.
          oneOf:
            - $ref: '#/components/schemas/EmbedTypes'
            - type: 'null'
        id:
          description: The unique identifier for the lesson.
          example: lesn_xxxxxxxxxxxxx
          type: string
        lesson_type:
          $ref: '#/components/schemas/LessonTypes'
          description: >-
            The content format of this lesson. One of: text, video, pdf, multi,
            quiz, knowledge_check.
        main_pdf:
          description: >-
            The primary PDF document for PDF-type lessons. Null if this lesson
            is not a PDF lesson or no PDF has been uploaded.
          properties:
            content_type:
              description: >-
                Uploaded file MIME type, such as image/jpeg, video/mp4, or
                audio/mpeg.
              example: image/jpeg
              type:
                - string
                - 'null'
            filename:
              description: >-
                The original filename of the uploaded attachment, including its
                file extension.
              example: document.pdf
              type:
                - string
                - 'null'
            id:
              description: >-
                Represents a unique identifier that is Base64 obfuscated. It is
                often used to refetch an object or as key for a cache. The ID
                type appears in a JSON response as a String; however, it is not
                intended to be human-readable. When expected as an input type,
                any string (such as `"VXNlci0xMA=="`) or integer (such as `4`)
                input value will be accepted as an ID.
              type: string
            url:
              description: >-
                A pre-optimized URL for rendering this attachment on the client.
                This should be used for displaying attachments in apps.
              example: https://media.whop.com/abc123/optimized.jpg
              type:
                - string
                - 'null'
          required:
            - id
            - filename
            - content_type
            - url
          type:
            - object
            - 'null'
        order:
          description: >-
            The sort position of this lesson within its parent chapter, starting
            from zero.
          example: 42
          type: integer
        thumbnail:
          description: >-
            The thumbnail image displayed on lesson cards and previews. Null if
            no thumbnail has been uploaded.
          properties:
            url:
              description: >-
                A pre-optimized URL for rendering this attachment on the client.
                This should be used for displaying attachments in apps.
              example: https://media.whop.com/abc123/optimized.jpg
              type:
                - string
                - 'null'
          required:
            - url
          type:
            - object
            - 'null'
        title:
          description: >-
            The display name of the lesson shown to students. Maximum 120
            characters.
          example: Understanding Candlestick Patterns
          type: string
        video_asset:
          description: >-
            The Mux video asset for video-type lessons, used for streaming
            playback. Null if this lesson has no hosted video.
          properties:
            asset_id:
              description: The Mux-provided ID of the asset
              type:
                - string
                - 'null'
            audio_only:
              description: Whether this asset contains only audio
              type: boolean
            created_at:
              description: The datetime the mux asset was created.
              example: '2023-12-01T05:00:00.401Z'
              format: date-time
              type: string
            duration_seconds:
              description: The duration of the video in seconds
              example: 42
              type:
                - integer
                - 'null'
            finished_uploading_at:
              description: The time at which the video finished uploading
              example: '2023-12-01T05:00:00.401Z'
              format: date-time
              type:
                - string
                - 'null'
            id:
              description: The unique identifier for the mux asset.
              example: mux_xxxxxxxxxxxxxx
              type: string
            playback_id:
              description: The public playback ID of the Mux asset
              type:
                - string
                - 'null'
            signed_playback_id:
              description: The signed playback ID of the Mux asset
              type:
                - string
                - 'null'
            signed_storyboard_playback_token:
              description: The signed storyboard playback token of the Mux asset
              type:
                - string
                - 'null'
            signed_thumbnail_playback_token:
              description: The signed thumbnail playback token of the Mux asset
              type:
                - string
                - 'null'
            signed_video_playback_token:
              description: The signed video playback token of the Mux asset
              type:
                - string
                - 'null'
            status:
              $ref: '#/components/schemas/MuxAssetStatuses'
              description: The status of the Mux asset
            updated_at:
              description: The datetime the mux asset was last updated.
              example: '2023-12-01T05:00:00.401Z'
              format: date-time
              type: string
          required:
            - id
            - asset_id
            - playback_id
            - signed_playback_id
            - status
            - audio_only
            - duration_seconds
            - signed_video_playback_token
            - signed_thumbnail_playback_token
            - signed_storyboard_playback_token
            - created_at
            - updated_at
            - finished_uploading_at
          type:
            - object
            - 'null'
        visibility:
          $ref: '#/components/schemas/LessonVisibilities'
          description: >-
            The visibility setting that controls whether this lesson appears to
            students. One of: visible, hidden.
      required:
        - id
        - title
        - order
        - lesson_type
        - visibility
        - content
        - days_from_course_start_until_unlock
        - embed_type
        - embed_id
        - created_at
        - thumbnail
        - video_asset
        - main_pdf
        - assessment_questions
        - attachments
      type: object
    CoursesAssessmentQuestionTypes:
      description: The available types for an assessment question
      enum:
        - short_answer
        - true_false
        - multiple_choice
        - multiple_select
      type: string
    MuxAssetStatuses:
      description: Mux asset statuses
      enum:
        - uploading
        - created
        - ready
      type: string
    LessonVisibilities:
      description: >-
        The available visibilities for a lesson. Determines how / whether a
        lesson is visible to users.
      enum:
        - visible
        - hidden
      type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: auth-scheme
      description: >-
        An Account API key, account-scoped JWT, App API key, or user OAuth
        token. Prepend the key or token with `Bearer`, for example `Bearer
        ***************************`.
      scheme: bearer
      type: http

````