Skip to main content
POST
/
courses
JavaScript
import Whop from '@whop/sdk';

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

const course = await client.courses.create({ experience_id: 'exp_xxxxxxxxxxxxxx', title: 'title' });

console.log(course.id);
{
  "id": "cors_xxxxxxxxxxxxx",
  "title": "Introduction to Technical Analysis",
  "tagline": "Master the fundamentals in 30 days",
  "cover_image": "https://assets.whop.com/images/course-cover.jpg",
  "thumbnail": {
    "id": "<string>",
    "filename": "document.pdf",
    "content_type": "image/jpeg",
    "optimized_url": "https://media.whop.com/abc123/optimized.jpg",
    "source_url": "https://media.whop.com/abc123/original.jpg"
  },
  "description": "Learn advanced trading strategies from industry experts.",
  "language": "en",
  "certificate_after_completion_enabled": true,
  "require_completing_lessons_in_order": true,
  "order": "123.45",
  "visibility": "visible",
  "created_at": "2023-12-01T05:00:00.401Z",
  "updated_at": "2023-12-01T05:00:00.401Z",
  "chapters": [
    {
      "id": "chap_xxxxxxxxxxxxx",
      "title": "Getting Started",
      "order": 42,
      "lessons": [
        {
          "id": "lesn_xxxxxxxxxxxxx",
          "lesson_type": "text",
          "title": "Understanding Candlestick Patterns",
          "order": 42,
          "video_asset": {
            "signed_playback_id": "<string>",
            "signed_thumbnail_playback_token": "<string>",
            "duration_seconds": 42
          },
          "thumbnail": {
            "url": "https://media.whop.com/abc123/optimized.jpg"
          }
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Body

application/json

Parameters for CreateCourse

experience_id
string
required

The unique identifier of the experience to create the course in (e.g., "exp_XXXXX").

Example:

"exp_xxxxxxxxxxxxxx"

title
string
required

The display title of the course (e.g., "Introduction to Web Development").

certificate_after_completion_enabled
boolean | null

Whether the course awards students a PDF certificate after completing all lessons.

order
string | null

The decimal order position of the course within its experience. Use fractional values (e.g., "1.5") to place between existing courses.

Example:

"123.45"

require_completing_lessons_in_order
boolean | null

Whether students must complete each lesson sequentially before advancing to the next one.

tagline
string | null

A short tagline displayed beneath the course title (e.g., "Master the fundamentals of design").

thumbnail
FileInputWithId · object

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

visibility
enum<string> | null

Controls whether this course is visible to students or hidden as a draft.

Available options:
visible,
hidden

Response

A successful response

A structured learning module containing chapters and lessons, belonging to an experience.

id
string
required

The unique identifier for the course.

Example:

"cors_xxxxxxxxxxxxx"

title
string | null
required

The display name of the course shown to students. Null if no title has been set.

Example:

"Introduction to Technical Analysis"

tagline
string | null
required

A short marketing tagline displayed beneath the course title. Null if no tagline has been set.

Example:

"Master the fundamentals in 30 days"

cover_image
string | null
required

The URL of the course cover image shown on preview cards. Null if no cover image has been uploaded.

Example:

"https://assets.whop.com/images/course-cover.jpg"

thumbnail
object
required

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

description
string | null
required

A brief summary of the course content and objectives. Null if no description has been set.

Example:

"Learn advanced trading strategies from industry experts."

language
enum<string>
required

The spoken language of the video content, used to generate accurate closed captions. One of: en, es, it, pt, de, fr, pl, ru, nl, ca, tr, sv, uk, no, fi, sk, el, cs, hr, da, ro, bg.

Available options:
en,
es,
it,
pt,
de,
fr,
pl,
ru,
nl,
ca,
tr,
sv,
uk,
no,
fi,
sk,
el,
cs,
hr,
da,
ro,
bg
certificate_after_completion_enabled
boolean | null
required

Whether students receive a PDF certificate after completing all lessons in this course. Null if the setting has not been configured.

require_completing_lessons_in_order
boolean
required

Whether students must complete each lesson sequentially before advancing to the next one.

order
string
required

The sort position of this course within its parent experience, as a decimal for flexible ordering.

Example:

"123.45"

visibility
enum<string>
required

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

Available options:
visible,
hidden
created_at
string<date-time>
required

The datetime the course was created.

Example:

"2023-12-01T05:00:00.401Z"

updated_at
string<date-time>
required

The datetime the course was last updated.

Example:

"2023-12-01T05:00:00.401Z"

chapters
object[]
required

An ordered list of all chapters in this course, sorted by their display position.