TagMangoTagMango Docs
Course

Update Chapter

PATCH
/api/v1/external/chapters/{chapterId}

Update fields of an existing chapter. Only provided fields are updated; omitted fields are left unchanged.

  • content and contentType must be provided together. Content processing (video transcoding / image compression) re-runs only when the URL or type changes.
  • additionalContents: [] explicitly clears all additional resources.
AuthorizationBearer <token>

In: header

Path Parameters

chapterId*string

Chapter 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.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://api-prod-new.tagmango.com/api/v1/external/chapters/66c4964c11e7fef26751f3a7" \  -H "x-whitelabel-host: string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "_id": "61e97c146cf2b4d8c68f3a40",
  "title": "Introduction to NestJS",
  "description": "Learn the basics of NestJS framework and its core concepts",
  "content": "https://example.com/video.mp4",
  "contentType": "video",
  "contentFileName": "chapter1_video.mp4",
  "contentSize": 1024000,
  "module": "61e97c146cf2b4d8c68f3a41",
  "creator": "61e97c146cf2b4d8c68f3a42",
  "course": "61e97c146cf2b4d8c68f3a44",
  "compressedVideoUrl": "https://example.com/compressed-video.mp4",
  "totalDuration": 1800,
  "assignment": "61e97c146cf2b4d8c68f3a45",
  "customThumbnail": true,
  "embeddedLink": "https://www.youtube.com/embed/dQw4w9WgXcQ",
  "createdAt": "2025-01-23T12:34:56Z",
  "updatedAt": "2025-01-24T12:34:56Z",
  "defaultThumbnail": "https://example.com/thumbnail.jpg",
  "isFree": false,
  "additionalContents": [
    "https://example.com/supplementary-material.pdf"
  ]
}
{
  "code": 400,
  "type": "Bad Request",
  "statusMessage": "BAD_REQUEST",
  "errorCode": "CHAPTER_USER_ASSET_NOT_FOUND",
  "message": "The content URL must be a TagMango CDN URL with an existing userAsset record. Upload the file via the TagMango upload API first.",
  "result": "The content URL must be a TagMango CDN URL with an existing userAsset record. Upload the file via the TagMango upload API first.",
  "success": false
}
{
  "code": 401,
  "type": "Unauthorized",
  "statusMessage": "UNAUTHORIZED",
  "message": "Invalid token",
  "success": false
}
{
  "code": 403,
  "type": "Forbidden",
  "statusMessage": "FORBIDDEN",
  "errorCode": "CHAPTER_VIDEO_UPLOAD_NOT_ENABLED",
  "message": "The creator does not have video uploading enabled on their account. Contact support to activate.",
  "result": "The creator does not have video uploading enabled on their account. Contact support to activate.",
  "success": false
}

{
  "code": 404,
  "type": "Not Found",
  "statusMessage": "NOT_FOUND",
  "errorCode": "CHAPTER_NOT_FOUND",
  "message": "The chapter does not exist or does not belong to this creator.",
  "result": "The chapter does not exist or does not belong to this creator.",
  "success": false
}