Create a learner group.

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 learner group in the academy. A group is stored as a course of type 2, so its id is used as courseId in the group APIs.

Endpoint

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

OAuth Scope

TrainerCentral.courseapi.CREATECopied!

Headers

tc-orgIdstring(Required)

ID of the academy (orgId).

Example
51517414

Request Body

application/json
courseJSON Object(Required)

Details of the group to create.

Hide Sub-Attributes
courseNamestring(Required)

Name of the group.

descriptionstring(Optional)

Description of the group. Supports rich text.

typeinteger(Required)

Record type. Allowed: 2=Group.

Request Example

cURL
cURL
Java
Python
Deluge
Copied!
curl --request POST \
  --url https://trainercentral.zoho.com/tc/api/v1/trainer/courses.json \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/json' \
  --header 'tc-orgId: 51517414' \
  --data '{"course":{"courseName":"Beginner Batch","description":"<p>Learners who joined in January.</p>","type":2}}'

Body Parameters

Create a group.

Copied!
  {
    "course": {
      "courseName": "Beginner Batch",
      "description": "<p>Learners who joined in January.</p>",
      "type": 2
    }
  }
                
▼ Show full

Response Parameters

courseJSON Object

The new group.

Hide Sub-Attributes
courseIdstring

ID of the group (used as courseId in group APIs).

idstring

Same as courseId.

courseNamestring

Name of the group.

typestring

Record type. Always 2 (Group).

orgIdstring

ID of the academy (orgId).

descriptionstring

Description of the group. Supports rich text.

enrolledCountstring

Number of learners in the group.

createdBystring

User ID of the creator.

timestring

Creation time in epoch milliseconds.

lastUpdatedBystring

User ID of the last editor.

lastUpdatedTimestring

Last update time in epoch milliseconds.

courseMembersJSON Array

Members created with the group: the caller as group admin.

Hide Sub-Attributes
JSON Object
Show Sub-Attributes
courseMembersIdstring

ID of the group membership (courseMemberId).

idstring

Same as courseMembersId.

courseIdstring

ID of the group.

coursestring

Same as courseId.

userIdstring

User ID (zuid) of the member.

orgMemberIdstring

Academy member ID.

orgIdstring

ID of the academy (orgId).

rolestring

Role in the group. Allowed: 0=Group admin, 1=Moderator, 3=Learner.

statusstring

Membership status. Allowed: 0=Active, 10=Invited, 50=Enrolled, 51=Unenrolled.

namestring

Full name of the member.

emailstring

Email of the member; * when hidden from trainers.

imageUrlstring

Profile image URL.

timestring

Last membership change in epoch milliseconds.

invitedTimestring

Invite time in epoch milliseconds.

enrolledTimestring

Enrollment 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_821

GROUP_FEATURE_UNAVAILABLE - The plan does not include groups. Upgrade the plan.

ST_102

UNAUTHORISED_ACCESS - The user is not an academy owner or admin. Do not retry with the same token.

ST_811

COURSE_LIMIT_EXCEEDED - Course limit of the plan reached (groups count too). Delete unused courses or upgrade the plan.

Response Example

Group created.

200
200
400
500
Copied!
  {
    "course": {
      "courseId": "3000000000070",
      "id": "3000000000070",
      "courseName": "Beginner Batch",
      "type": "2",
      "orgId": "51517414",
      "createdBy": "51456901",
      "lastUpdatedBy": "51456901",
      "time": "1782727568966",
      "lastUpdatedTime": "1782727568966"
    },
    "courseMembers": [
      {
        "courseMembersId": "3000000000072",
        "id": "3000000000072",
        "courseId": "3000000000070",
        "userId": "51456901",
        "role": "0",
        "status": "0"
      }
    ]
  }
                
  {
    "error": {
      "code": "string",
      "codeStr": "string",
      "message": "string"
    }
  }
                
500 Request failed; see the error code.
▼ Show full