Move a lesson within or across chapters.

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

Moves a lesson to a new position (sessionIndex) in its chapter, or to another chapter of the course (sectionId). The response lists all lessons of the course with their new positions.

Endpoint

put https://{TrainerCentral-API-Domain}/tc/api/v1/trainer/sessions/{sessionId}.json

OAuth Scope

TrainerCentral.sessionapi.UPDATECopied!

Headers

tc-orgIdstring(Required)

ID of the academy (orgId).

Example
51517414

Path Parameters

sessionIdstring(Required)

ID of the course lesson to move (sessionId).

Request Body

application/json
sessionJSON Object(Required)

Lesson values to change; omitted keys keep their values.

Hide Sub-Attributes
namestring(Optional)

New name of the lesson. Max 255 characters; cannot be empty.

descriptionstring(Optional)

Description of the lesson. Supports rich text. An empty string removes it.

enablePrerequisiteboolean(Optional)

true makes learners complete this lesson before later lessons.

enableDraftboolean(Optional)

true makes the lesson a draft hidden from learners; false publishes it.

sessionIndexinteger(Optional)

Reorder Course Lesson only. New zero-based position of the lesson in its chapter.

sectionIdlong(Optional)

Reorder Course Lesson only. ID of the chapter (section) to move the lesson to.

Request Example

cURL
cURL
Java
Python
Deluge
Copied!
curl --request PUT \
  --url https://trainercentral.zoho.com/tc/api/v1/trainer/sessions/{sessionId}.json \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/json' \
  --header 'tc-orgId: 51517414' \
  --data '{"session":{"sessionIndex":2}}'

Body Parameters

Move the lesson within its chapter.

Move the lesson within its chapter.

Move the lesson to another chapter.

Copied!
  {
    "session": {
      "sessionIndex": 2
    }
  }
                
  {
    "session": {
      "sectionId": 3000000000027,
      "sessionIndex": 0
    }
  }
                
▼ Show full

Response Parameters

sessionJSON Object

The moved lesson with its new sessionIndex.

Hide Sub-Attributes
sessionIdstring

ID of the lesson (sessionId).

idstring

Same as sessionId.

namestring

Name of the lesson.

descriptionstring

Description of the lesson. Supports rich text.

deliveryModestring

Lesson type. Allowed: 3=Live session, 4=On-demand lesson, 7=Assignment.

sessionIndexstring

Zero-based position of the lesson in its chapter.

sectionIdstring

ID of the chapter (section) that holds the lesson.

courseIdstring

ID of the course the lesson belongs to.

orgIdstring

ID of the academy (orgId).

enableDraftstring

true when the lesson is a draft, hidden from learners.

enablePrerequisitestring

true when learners must complete this lesson before later lessons.

publishStatusstring

Publish status of the lesson. Allowed: 0=Unpublished, 1=Published.

scheduledTimestring

Live lessons only. Start time in epoch milliseconds.

scheduledEndTimestring

Live lessons only. End time in epoch milliseconds.

timezonestring

Live lessons only. IANA time zone, for example Asia/Kolkata.

scheduleTypestring

Schedule type. Allowed: 0=One-time, 1=Recurring. Always 0 for lessons.

kindstring

Visibility. Allowed: 0=Default, 1=Featured.

scheduledBystring

User ID of the trainer who created the lesson.

coursestring

Same as courseId.

createdTimestring

Creation time in epoch milliseconds.

sessionsJSON Array

All lessons of the course with their positions after the move.

Hide Sub-Attributes
JSON Object
Show Sub-Attributes
sessionIdstring

ID of the lesson (sessionId).

idstring

Same as sessionId.

namestring

Name of the lesson.

descriptionstring

Description of the lesson. Supports rich text.

deliveryModestring

Lesson type. Allowed: 3=Live session, 4=On-demand lesson, 7=Assignment.

sessionIndexstring

Zero-based position of the lesson in its chapter.

sectionIdstring

ID of the chapter (section) that holds the lesson.

courseIdstring

ID of the course the lesson belongs to.

orgIdstring

ID of the academy (orgId).

enableDraftstring

true when the lesson is a draft, hidden from learners.

enablePrerequisitestring

true when learners must complete this lesson before later lessons.

publishStatusstring

Publish status of the lesson. Allowed: 0=Unpublished, 1=Published.

scheduledTimestring

Live lessons only. Start time in epoch milliseconds.

scheduledEndTimestring

Live lessons only. End time in epoch milliseconds.

timezonestring

Live lessons only. IANA time zone, for example Asia/Kolkata.

scheduleTypestring

Schedule type. Allowed: 0=One-time, 1=Recurring. Always 0 for lessons.

kindstring

Visibility. Allowed: 0=Default, 1=Featured.

scheduledBystring

User ID of the trainer who created the lesson.

coursestring

Same as courseId.

createdTimestring

Creation 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_79

INVALID_SESSION - The sessionId does not match a session in this academy. Pass a valid sessionId. Do not retry unchanged.

ST_401

SESSION_DELETED - The session was deleted. Use a session that is not deleted. Do not retry unchanged.

ST_102

UNAUTHORISED_ACCESS - The user is not an academy owner or admin, or an admin or trainer of the course. Call with one of these roles; do not retry unchanged.

ST_83

EDIT_SESSION_FAILED - sessionIndex is outside the target chapter, or sectionId is not a chapter of this course. Send a valid sessionIndex and sectionId. Do not retry unchanged.

Response Example

Response after moving a lesson.

200
200
400
500
Copied!
  {
    "session": {
      "sessionId": "3000000000040",
      "id": "3000000000040",
      "name": "Python Basics - Variables",
      "deliveryMode": "4",
      "scheduleType": "0",
      "sessionIndex": "1",
      "publishStatus": "0",
      "kind": "0",
      "orgId": "51517414",
      "scheduledBy": "51456901",
      "createdTime": "1782727568966"
    },
    "sessions": [
      {
        "sessionId": "3000000000041",
        "id": "3000000000041",
        "name": "Course Introduction",
        "deliveryMode": "4",
        "sessionIndex": "0",
        "orgId": "51517414"
      },
      {
        "sessionId": "3000000000040",
        "id": "3000000000040",
        "name": "Python Basics - Variables",
        "deliveryMode": "4",
        "sessionIndex": "1",
        "orgId": "51517414"
      }
    ]
  }
                
  {
    "error": {
      "code": "string",
      "codeStr": "string",
      "message": "string"
    }
  }
                
500 Request failed; see the error code.
▼ Show full