Skip to main content
PATCH
/
courses
/
{id}
JavaScript
import Whop from '@whop/sdk';

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

const course = await client.courses.update('cors_xxxxxxxxxxxxx');

console.log(course.id);
{
  "id": "cors_xxxxxxxxxxxxx",
  "title": "<string>",
  "tagline": "<string>",
  "cover_image": "<string>",
  "thumbnail": {
    "id": "<string>",
    "filename": "<string>",
    "content_type": "<string>",
    "optimized_url": "<string>",
    "source_url": "<string>"
  },
  "description": "<string>",
  "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": "<string>",
      "order": 42,
      "lessons": [
        {
          "id": "lesn_xxxxxxxxxxxxx",
          "lesson_type": "text",
          "title": "<string>",
          "order": 42
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

The ID of the course to update

Example:

"cors_xxxxxxxxxxxxx"

Body

application/json

Parameters for UpdateCourse

certificate_after_completion_enabled
boolean | null

Whether the course will award its students a PDF certificate after completing all lessons

chapters
object[] | null

The chapters and lessons to update

cover_image
string | null

The cover image URL of the course

description
string | null

A short description of the course

language
enum<string> | null

The language spoken in the video content of the course The available languages for a course

Available options:
en,
es,
it,
pt,
de,
fr,
pl,
ru,
nl,
ca,
tr,
sv,
uk,
no,
fi,
sk,
el,
cs,
hr,
da,
ro,
bg
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 the course requires students to complete the previous lesson before moving on to the next one

tagline
string | null

A short tagline for the course

thumbnail
object | null

The thumbnail for the course in png, jpeg, or gif format Input for an attachment

  • AttachmentInputWithDirectUploadId
  • AttachmentInputWithId
title
string | null

The title of the course

visibility
enum<string> | null

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

Available options:
visible,
hidden

Response

A successful response

A course from the courses app

id
string
required

The ID of the course. Looks like cors_XXX

Example:

"cors_xxxxxxxxxxxxx"

title
string | null
required

The title of the course

tagline
string | null
required

A short tagline for the course. It is displayed under the course title in the UI

cover_image
string | null
required

The URL of the course's cover image, which is shown in course preview cards

thumbnail
object | null
required

The thumbnail for the course

description
string | null
required

A short description of the course

language
enum<string>
required

The language spoken in the video content of the course, used to generate closed captions in the right language

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 the course will award its students a PDF certificate after completing all lessons

require_completing_lessons_in_order
boolean
required

Whether the course requires students to complete the previous lesson before moving on to the next one

order
string
required

The order of the course within its experience

Example:

"123.45"

visibility
enum<string>
required

The visibility of the course. Determines how / whether this course is visible to users.

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

The timestamp of when the course was created

Example:

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

updated_at
string<date-time>
required

The timestamp of when the course was last updated

Example:

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

chapters
object[]
required

The chapters in this course