JavaScript
import Whop from '@whop/sdk'; const client = new Whop({ 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 } ] }
Creates a new course chapter
Required permissions:
courses:update
The app API key from an app from the /dashboard/developer page
Parameters for CreateChapter
The ID of the course to create the chapter in
"cors_xxxxxxxxxxxxx"
The title of the chapter
A successful response
A chapter from the courses app
The ID of the chapter. Looks like chap_XXX
"chap_xxxxxxxxxxxxx"
The order of the chapter within its course
42
The lessons in this chapter
Show child attributes
The ID of the lesson
"lesn_xxxxxxxxxxxxx"
The title of the lesson
The order of the lesson within its chapter
Was this page helpful?