Update a course lesson.

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

Updates the name, description, draft state or prerequisite flag of a course lesson (on-demand, live or assignment). Only the keys you send are changed.

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 (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":{"name":"Python Basics - Variables","description":"<p>Learn how variables store values in Python.</p>"}}'

Body Parameters

Rename a lesson and change its description.

Rename a lesson and change its description.

Publish a draft lesson and make it a prerequisite.

Copied!
  {
    "session": {
      "name": "Python Basics - Variables",
      "description": "<p>Learn how variables store values in Python.</p>"
    }
  }
                
  {
    "session": {
      "enableDraft": false,
      "enablePrerequisite": true
    }
  }
                
▼ Show full

Response Parameters

sessionJSON Object

The session with its latest values.

Hide Sub-Attributes
sessionIdstring

ID of the session (live workshop or course lesson).

namestring

Name of the session.

uniqueKeystring

URL slug of the session.

timezonestring

Time zone of the schedule, for example Asia/Kolkata.

scheduleTypestring

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

descriptionstring

Description of the session. Supports rich text.

attendeeLimitstring

Maximum number of attendees.

joinURLstring

URL for attendees to join.

scheduledTimestring

Start time in epoch milliseconds.

scheduledEndTimestring

End time in epoch milliseconds.

recurringTypestring

Recurring pattern. Allowed: 0=Not recurring, 1=Daily, 2=Weekly, 3=Monthly.

deliveryModestring

Delivery mode. Allowed: 3=Live session, 4=On-demand, 7=Assignment.

orgIdstring

ID of the academy (orgId).

orgNamestring

Name of the academy.

scheduledBystring

User ID of the trainer who scheduled the session.

createdBystring

User ID of the creator.

createdTimestring

Created time in epoch milliseconds.

idstring

Same as sessionId.

registrationTypestring

Registration model. Allowed: 0=One registration for all occurrences, 1=Registration per occurrence.

publishStatusstring

Allowed: 0=Draft, 1=Published.

kindstring

Allowed: 0=Default, 1=Featured.

sessionIndexstring

Position of the lesson in its chapter (0-based).

talksJSON Array

The rescheduled occurrence. Returned only when a one-time session's schedule changes.

Hide Sub-Attributes
JSON Object
Show Sub-Attributes
talkIdstring

ID of the occurrence (talkId).

namestring

Name of the occurrence.

sessionIdstring

ID of the live session.

orgIdstring

ID of the academy (orgId).

statusstring

Status of the occurrence. Allowed: 0=Yet to start, 1=Scheduled, 2=Projected, 3=Started, 4=Suspended, 5=Completed, 6=Orphaned, 7=Cancelled.

registeredCountstring

Number of registered learners.

scheduledTimestring

Start time in epoch milliseconds.

scheduledEndTimestring

End time in epoch milliseconds.

deliveryModestring

Delivery mode. Allowed: 3=Live session, 4=On-demand, 7=Assignment.

idstring

Same as talkId.

ownerstring

User ID of the trainer who owns the occurrence.

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 - The lesson type cannot be changed (deliveryMode was sent), or the update failed. Leave deliveryMode out; if it still fails, retry later.

Response Example

Response after renaming a lesson.

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