Invite a learner.

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

Invites a learner to the academy and, optionally, to a course, group or live workshop. Send courseId for a course or group (with courseType=2), or sessionId for a live workshop.

Endpoint

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

OAuth Scope

TrainerCentral.userapi.CREATECopied!

Headers

tc-orgIdstring(Required)

ID of the academy (orgId).

Example
51517414

Query Parameters

courseTypeinteger(Optional)

Type of courseAttendee.courseId; must match it. Allowed: 0=Course, 1=Course bundle, 2=Group.

Example
2
groupLearnerinteger(Optional)

Group invites only. Send 3 to add a group learner; leave it out to add a moderator.

Example
3

Request Body

application/json
courseAttendeeJSON Object(Required)

The learner to invite (one per call).

Hide Sub-Attributes
emailstring(Required)

Email address of the learner.

firstNamestring(Optional)

First name of the learner. Required for a new learner.

lastNamestring(Optional)

Last name of the learner.

courseIdlong(Optional)

ID of the course, course bundle or group to invite to. For a group, also send courseType=2.

sessionIdlong(Optional)

ID of the live workshop to invite to.

isAccessGrantedboolean(Optional)

true gives access without payment. Default false.

expiryTimelong(Optional)

Time the course access ends, in epoch milliseconds. Send expiryTime or expiryDuration, not both.

expiryDurationinteger(Optional)

Length of course access, in expiryFrequency units (1-2000).

expiryFrequencyinteger(Optional)

Unit of expiryDuration. Allowed: 0=Days, 4=Hours.

passwordstring(Optional)

Password for a new learner account.

Request Example

cURL
cURL
Java
Python
Deluge
Copied!
curl --request POST \
  --url 'https://trainercentral.zoho.com/tc/api/v1/trainer/addCourseAttendee.json?courseType=2&groupLearner=3' \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/json' \
  --header 'tc-orgId: 51517414' \
  --data '{"courseAttendee":{"email":"learner@example.com","firstName":"John","lastName":"Doe"}}'

Body Parameters

Invite to the academy.

Invite to the academy.

Invite to a course.

Invite to a course with free access.

Add a learner to a group (courseType=2, groupLearner=3).

Invite to a live workshop.

Copied!
  {
    "courseAttendee": {
      "email": "learner@example.com",
      "firstName": "John",
      "lastName": "Doe"
    }
  }
                
  {
    "courseAttendee": {
      "email": "learner@example.com",
      "firstName": "John",
      "lastName": "Doe",
      "courseId": 3000000000022
    }
  }
                
  {
    "courseAttendee": {
      "email": "learner@example.com",
      "firstName": "John",
      "lastName": "Doe",
      "courseId": 3000000000022,
      "isAccessGranted": true
    }
  }
                
  {
    "courseAttendee": {
      "email": "learner@example.com",
      "firstName": "John",
      "lastName": "Doe",
      "courseId": 3000000000070
    }
  }
                
  {
    "courseAttendee": {
      "email": "learner@example.com",
      "firstName": "John",
      "lastName": "Doe",
      "sessionId": 3000000000200
    }
  }
                
▼ Show full

Response Parameters

portalMemberJSON Object

Academy member record of the learner.

Hide Sub-Attributes
orgMemberIdstring

Academy member ID of the learner.

zuidstring

Zoho user ID (zuid) of the learner.

emailIdstring

Email address of the learner.

firstNamestring

First name of the learner.

lastNamestring

Last name of the learner.

rolestring

Academy role. Allowed: 4=Learner.

statusstring

Membership status. Allowed: 1=Active, 2=Invited.

orgIdstring

ID of the academy (orgId).

courseMemberJSON Array

Course or group membership of the learner. Returned only when courseId is sent.

Hide Sub-Attributes
JSON Object
Show Sub-Attributes
courseMembersIdstring

ID of the course member (courseMemberId).

idstring

Same as courseMembersId.

courseIdstring

ID of the course or 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 course. Allowed: 0=Course admin, 1=Trainer, 3=Learner, 4=Previewer.

statusstring

Membership status. Allowed: 0=None, 1=Access requested, 2=Approved, 3=Rejected, 10=Invited, 11=Prospect, 50=Enrolled, 51=Blocked.

currentStatusstring

Learner progress status. Allowed: 1=Invited, 2=Access requested, 3=Access rejected, 4=Access approved, 5=Free preview, 6=Prospect, 7=Enrolled, 8=Accessed, 9=Access revoked, 10=Blocked, 11=Preview user, 12=Deleted.

namestring

Full name of the member.

emailstring

Email of the member; * when hidden from trainers.

imageUrlstring

Profile image URL.

completionPercentagestring

Course completion percentage (0-100).

completionTypestring

How the course was completed. Allowed: 0=By the learner, 1=Marked by a trainer.

completedLessonstring

Number of lessons completed.

totalLessonstring

Total number of lessons in the course.

timestring

Last membership change in epoch milliseconds.

invitedTimestring

Invite time in epoch milliseconds.

enrolledTimestring

First enrollment time in epoch milliseconds.

completedTimestring

Completion time in epoch milliseconds.

accessedTimestring

Last time the learner opened the course, in epoch milliseconds.

lastLoginstring

Last sign-in time in epoch milliseconds.

ipAddressstring

IP address of the last sign-in.

countrystring

Country of the last sign-in.

isCertificateIssuedstring

true when a certificate has been issued.

isBadgeIssuedstring

true when a badge has been issued.

totalRevenuestring

Amount the learner paid, in the academy base currency.

formattedTotalRevenuestring

totalRevenue with the currency symbol.

expiryTimestring

Access expiry time in epoch milliseconds.

sessionMembersarray

Live workshop registration. Returned only when sessionId is sent.

ticketPaymentsarray

Payment records created for the invite; often empty.

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_102

UNAUTHORISED_ACCESS - The user is not an academy owner or admin, or courseType does not match courseId. Do not retry unchanged.

ST_565

USER_EMAIL_UNCONFIRMED - The caller's Zoho account email is not confirmed. Confirm it, then retry.

TC_1401

ZOHOONE_CLIENTPORTAL_ACCESS_RESTRICTED - Learners of a Zoho One client portal cannot be invited here. Manage them in Zoho One. Do not retry.

ST_913

NAME_FIELDS_MANDATORY - firstName is missing for a new learner. Send a non-empty firstName.

ST_94

INVALID_COURSE - Course or group not found or deleted. Pass a valid courseId. Do not retry unchanged.

ST_79

INVALID_SESSION - Live workshop not found. Pass a valid sessionId. Do not retry unchanged.

ST_1302

LEARNER_BLOCKED - The learner is blocked in this academy. Unblock them first.

ST_371

INVALID_USER_INVITE - The learner was removed from this academy. Use another email or restore the learner.

ST_556

EMAIL_ALREADY_REGISTERED - The learner is already in the academy. Send a courseId or sessionId to invite them further.

ST_822

ALREADY_PORTAL_MEMBER - The person is already in this group. Do not retry unchanged.

ST_824

MODERATOR_ALREADY_IN_GROUP - The person is already a moderator of this group. Do not retry unchanged.

ST_825

LEARNER_ALREADY_IN_GROUP - The learner is already in this group. Do not retry unchanged.

ST_95

INVALID_USER_EMAIL - Invalid email address. Send a valid email.

ST_364

PASSWORD_DATA_BREACH - The password appears in a known data breach. Send a different password.

ST_372

SEQUENTIAL_CHARACTERS_NOT_ALLOWED - The password has sequential characters (like 1234). Send a different password.

ST_373

CONTINUOUS_CHARACTERS_NOT_ALLOWED - The password repeats one character. Send a different password.

TC_1506

USER_NOT_CONFIRMED_TO_DO_THIS_ACTION - Setting a password needs a confirmed Zoho account for the caller. Confirm it or leave password out.

Response Example

Learner invited to a course.

200
200
400
500
Copied!
  {
    "portalMember": {
      "orgMemberId": "3000000000055",
      "zuid": "51456902",
      "emailId": "learner@example.com",
      "firstName": "John",
      "lastName": "Doe",
      "role": "4",
      "status": "2",
      "orgId": "51517414"
    },
    "courseMember": [
      {
        "courseMembersId": "3000000000056",
        "courseId": "3000000000022",
        "orgMemberId": "3000000000055",
        "userId": "51456902",
        "role": "3",
        "status": "10",
        "currentStatus": "1"
      }
    ],
    "ticketPayments": []
  }
                
  {
    "error": {
      "code": "string",
      "codeStr": "string",
      "message": "string"
    }
  }
                
500 Request failed; see the error code.
▼ Show full

Rate Limits

Duration1 minute
Threshold10

Duration - Time window for the threshold.
Threshold - Number of API calls allowed within the specified duration.
Lock Period - Wait time before consecutive API requests.