TagMangoTagMango Docs
Course

Create Module

POST
/api/v1/external/courses/{courseId}/modules

Create a new module (section) inside an existing course with required name, description, and cover image.

If the course uses date- or enrollment-based dripping, follow this call with an Update Course drip request that includes the new module. A module added to a dripped course starts with no unlock schedule of its own, and content with no schedule is treated as unlocked — so the new module is immediately visible to learners until you set its schedule. The drip payload must list every module in the course, so include the existing ones alongside the new one.

Courses that are not dripped, or that drip by completion, need no follow-up.

AuthorizationBearer <token>

In: header

Path Parameters

courseId*string

Course object id

Header Parameters

x-whitelabel-host*string

Host name of the dashboard, ex: mydomain.tagmango.com

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

title*string

Add a clear title for this module.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api-prod-new.tagmango.com/api/v1/external/courses/66c4964c11e7fef26751f3a7/modules" \  -H "x-whitelabel-host: string" \  -H "Content-Type: application/json" \  -d '{    "title": "Introduction"  }'
{
  "createdAt": "2024-11-04T13:05:43.799Z",
  "updatedAt": "2024-11-04T13:05:43.799Z",
  "_id": "66c4964c11e7fef26751f3b1",
  "title": "Introduction",
  "creator": "66c4964c11e7fef26751f3a1",
  "course": "66c4964c11e7fef26751f3a7",
  "chapters": [
    "66c4964c11e7fef26751f3c1",
    "66c4964c11e7fef26751f3c2"
  ]
}
{
  "code": 400,
  "type": "Bad Request",
  "statusMessage": "BAD_REQUEST",
  "success": false,
  "message": "Invalid request",
  "result": "Invalid request"
}
{
  "code": 401,
  "type": "Unauthorized",
  "statusMessage": "UNAUTHORIZED",
  "message": "Invalid token",
  "result": "Invalid token",
  "success": false
}
{
  "code": 403,
  "type": "Forbidden",
  "statusMessage": "FORBIDDEN",
  "errorCode": "WORKSHOP_MANGO_FORBIDDEN",
  "message": "You can not access this api with a TagMango account, only available for whitelabel hosts",
  "result": "You can not access this api with a TagMango account, only available for whitelabel hosts",
  "success": false
}
{
  "code": 404,
  "type": "Not Found",
  "statusMessage": "NOT_FOUND",
  "errorCode": "COURSE_NOT_FOUND",
  "message": "The course does not exist, is deleted, or does not belong to this creator.",
  "result": "The course does not exist, is deleted, or does not belong to this creator.",
  "success": false
}
{
  "code": 429,
  "type": "Too Many Requests",
  "statusMessage": "TOO_MANY_REQUESTS",
  "message": "Request limit exceeded. try after 10 seconds",
  "result": "Request limit exceeded. try after 10 seconds",
  "success": false
}