Create a chapter in a course.

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

Creates a chapter (section) in a course. Other chapters are not moved, so send the current chapter count as sectionIndex to add it at the end.

Endpoint

post https://{TrainerCentral-API-Domain}/tc/api/v1/trainer/sections.json

OAuth Scope

TrainerCentral.sectionapi.CREATECopied!

Headers

tc-orgIdstring(Required)

ID of the academy (orgId).

Example
51517414

Request Body

application/json
sectionJSON Object(Required)

Chapter to create.

Hide Sub-Attributes
namestring(Required)

Name of the chapter (min 3 characters).

courseIdlong(Required)

ID of the course.

sectionIndexinteger(Optional)

Position of the chapter, starting at 0. Default 0. Send the current chapter count to add it at the end.

Request Example

cURL
cURL
Java
Python
Deluge
Copied!
curl --request POST \
  --url https://trainercentral.zoho.com/tc/api/v1/trainer/sections.json \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/json' \
  --header 'tc-orgId: 51517414' \
  --data '{"section":{"name":"Working with Files","courseId":3000000000022,"sectionIndex":2}}'

Body Parameters

Add a chapter at the end.

Copied!
  {
    "section": {
      "name": "Working with Files",
      "courseId": 3000000000022,
      "sectionIndex": 2
    }
  }
                
▼ Show full

Response Parameters

sectionJSON Object

The new chapter (name returned as sectionName).

Hide Sub-Attributes
sectionIdstring

ID of the chapter (sectionId).

idstring

Same as sectionId.

namestring

Name of the chapter.

sectionNamestring

Name of the chapter (returned by Create Course Chapter).

sectionIndexstring

Position of the chapter, starting at 0.

statusstring

Status of the chapter. Allowed: 0=Default (visible), 1=Draft.

courseIdstring

ID of the course.

coursestring

Same as courseId.

sessionsCountstring

Number of lessons in the chapter.

createdBystring

User ID of the creator.

createdTimestring

Creation time in epoch milliseconds.

lastUpdatedBystring

User ID of the last editor.

lastUpdatedTimestring

Last update time in epoch milliseconds.

errorJSON Object

Error details.

Hide Sub-Attributes
codestring

Deprecated numeric error code (for example ST_202). Prefer codeStr; omitted from doc samples.

codeStrstring

Error code name (ShowtimeErrorCode / err_code_str), for example MISSING_PARAMETER.

messagestring

Error message.

Possible Error Codes

HTTP CodeError CodeDescription
500ST_94

INVALID_COURSE - section.courseId is missing, not found or deleted. Pass a valid courseId. Do not retry unchanged.

ST_102

UNAUTHORISED_ACCESS - The user is not an academy owner, admin or trainer of this course. Do not retry with the same token.

Response Example

Chapter created.

200
200
400
500
Copied!
  {
    "section": {
      "sectionId": "3000000000080",
      "id": "3000000000080",
      "sectionName": "Working with Files",
      "sectionIndex": "2",
      "status": "0",
      "createdBy": "51456901",
      "createdTime": "1782727609141",
      "lastUpdatedBy": "51456901",
      "lastUpdatedTime": "1782727609141"
    }
  }
                
  {
    "error": {
      "code": "string",
      "codeStr": "string",
      "message": "string"
    }
  }
                
500 Request failed; see the error code.
▼ Show full