Update Chapter
Update fields of an existing chapter. Only provided fields are updated; omitted fields are left unchanged.
contentandcontentTypemust be provided together. Content processing (video transcoding / image compression) re-runs only when the URL or type changes.additionalContents: []explicitly clears all additional resources.
Authorization
bearer In: header
Path Parameters
Chapter object id
Header Parameters
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
}Create Chapter POST
Create a new chapter inside an existing module. - When `content` and `contentType` are supplied, content processing (video transcoding / image compression) runs transparently. - Chapter `name` and `description` are required. - Course progress is recalculated automatically after each chapter creation.
Delete Chapter DELETE
Permanently delete a chapter along with its QnA, assignment, and all assignment submissions. Course progress is recalculated automatically.