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

const client = new Whop({
  appID: 'app_xxxxxxxxxxxxxx',
  apiKey: 'My API Key',
});

const courseChapter = await client.courseChapters.create({ course_id: 'cors_xxxxxxxxxxxxx' });

console.log(courseChapter.id);
{
  "id": "chap_xxxxxxxxxxxxx",
  "title": "<string>",
  "order": 42,
  "lessons": [
    {
      "id": "lesn_xxxxxxxxxxxxx",
      "title": "<string>",
      "order": 42
    }
  ]
}

Authorizations

Authorization
string
header
required

The app API key from an app from the /dashboard/developer page

Body

application/json

Parameters for CreateChapter

course_id
string
required

The ID of the course to create the chapter in

Example:

"cors_xxxxxxxxxxxxx"

title
string | null

The title of the chapter

Response

A successful response

A chapter from the courses app

id
string
required

The ID of the chapter. Looks like chap_XXX

Example:

"chap_xxxxxxxxxxxxx"

title
string
required

The title of the chapter

order
integer
required

The order of the chapter within its course

Example:

42

lessons
object[]
required

The lessons in this chapter