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

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": "66c4964c11e7fef26751f3c1",
  "title": "Variables and scope",
  "description": "How let, const and var differ, and when each one is the right choice.",
  "content": "https://cdn.example.com/variables-and-scope.mp4",
  "contentType": "video",
  "contentFileName": "variables-and-scope.mp4",
  "contentSize": 1024000,
  "module": "66c4964c11e7fef26751f3b1",
  "creator": "66c4964c11e7fef26751f3a1",
  "course": "66c4964c11e7fef26751f3a7",
  "compressedVideoUrl": "https://cdn.example.com/variables-and-scope-720p.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://cdn.example.com/variables-and-scope-thumb.jpg",
  "isFree": false,
  "additionalContents": [
    "https://cdn.example.com/scope-cheatsheet.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",
  "result": "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
}

{
  "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
}