Skip to main content

Live Classes

info

Admin APIs require authorization token with admin privileges. You can check the following link to generate an authorization token. You need to provide an admin username and password to generate token with admin privileges.

Authentication

Live Classes API lets you create live classes for your institute. You choose the provider and, optionally, the course chapter the live class belongs to.

  • To create a live class on its own, call the endpoint without course_id and chapter_id.
  • To attach a live class to a course chapter, also send course_id and chapter_id.

Providers​

Every live class uses one of the following providers. Choose the provider based on how the class is delivered:

ProviderWhen to useNotes
FermionInteractive live classes that need two-way communication, where the instructor and students can talk to and see each other.Fully managed by Testpress; no external streaming software is required.
TpStreamsOne-way broadcasts, where students only watch the instructor's stream.Depends on external streaming software such as OBS to broadcast the class.

Both providers must be enabled and configured for your institute in the LMS portal before they can be used in a live class.

Permissions​

  • The instructor must be an owner, moderator, or mentor of the institute.
  • For a live class attached to a course, the user must be an owner, staff member, or a user with edit-contents permission on the course.
  • For a live class without a course, the user must be an owner, moderator, or staff member of the institute.

Rate Limit​

This endpoint is throttled to 10 requests per minute per institute and user.

Create A Live Class​

This endpoint creates a live class, optionally attached to a course chapter.

HTTP Request​

POST /api/v3/admin/live-classes/

Fields​

NameTypeDescription
titlestringTitle of the live class. Required, maximum 255 characters.
startstringStart time in ISO 8601 format. Required.
durationintegerDuration in minutes. Required, minimum 1.
providerstringfermion or tpstreams. Required. TpStreams is only supported when a course is provided.
instructorintegerUser ID of the staff member acting as instructor. Required.
course_idintegerCourse ID. Optional. Provide together with chapter_id.
chapter_idintegerChapter ID belonging to course_id. Optional. Provide together with course_id.
descriptionstringDescription of the live class.
send_reminder_emailbooleanSend reminder emails to participants. Default: false.
instructionsstringInstructions for the live class. Used only without a course; falls back to description when omitted.
session_typestringUsed only without a course. one_on_one, group_class, public, or guest_only. Default: group_class.
audience_usersarrayUsed only without a course. Student User IDs.
audience_batchesarrayUsed only without a course. Batch IDs.
allow_guest_accessbooleanUsed only without a course. Allow guests to join. Default: false.
is_instantbooleanUsed only without a course. Start the live class instantly. Default: false.
session_settingsjsonUsed only without a course. Allowed keys: add_everyone_on_stage, should_skip_join_screen_for_students.
guest_settingsjsonUsed only without a course. Allowed keys: name, email, phone_number.
enable_chatbooleanUsed only with a course. Enable the chat room. Defaults to true for TpStreams, and is always false for Fermion.
show_recorded_videobooleanUsed only with a course. Allow viewing the recording after the stream ends. Default: true.
latencyintegerUsed only with a course. 0 for Normal Latency (default) or 1 for Low Latency.
free_previewbooleanUsed only with a course. Allow the content as a free preview. Default: false.
add_everyone_on_stagebooleanUsed only with a course and the Fermion provider. Defaults to the cached institute preference when omitted.
should_skip_join_screen_for_studentsbooleanUsed only with a course and the Fermion provider. Defaults to the cached institute preference when omitted.

Live Class Without A Course​

curl --request POST \
--url https://your-institute.testpress.in/api/v3/admin/live-classes/ \
--header 'authorization: JWT <your-token>' \
--header 'content-type: application/json' \
--data '{
"title": "Weekly Doubt Clearing",
"start": "2023-10-15T10:00:00Z",
"duration": 60,
"provider": "fermion",
"instructor": 12,
"session_type": "group_class",
"audience_batches": [3]
}'

Live Class Attached To A Course​

curl --request POST \
--url https://your-institute.testpress.in/api/v3/admin/live-classes/ \
--header 'authorization: JWT <your-token>' \
--header 'content-type: application/json' \
--data '{
"title": "Chapter 1 Live Class",
"start": "2023-10-15T10:00:00Z",
"duration": 45,
"provider": "tpstreams",
"instructor": 12,
"course_id": 10,
"chapter_id": 20
}'

Responses​

201 Live class created without a course
{
"id": 1,
"title": "Weekly Doubt Clearing",
"start": "2023-10-15T10:00:00Z",
"end": "2023-10-15T11:00:00Z",
"duration": 60,
"provider": "Fermion",
"is_course_live_class": false,
"course_id": null,
"chapter_id": null,
"meeting_id": "fermion-123",
"status": "Not Started",
"instructor": {
"id": 12,
"display_name": "John Doe"
},
"public_join_url": "",
"created": "2023-10-10T09:00:00Z"
}
201 Live class created with a course
{
"id": 100,
"title": "Chapter 1 Live Class",
"start": "2023-10-15T10:00:00Z",
"end": null,
"duration": 45,
"provider": "TpStreams",
"is_course_live_class": true,
"course_id": 10,
"chapter_id": 20,
"meeting_id": "channel-123",
"status": "Not Started",
"instructor": {
"id": 12,
"display_name": "John Doe"
},
"public_join_url": null,
"created": "2023-10-10T09:00:00Z"
}
400 Validation error
{
"course_id and chapter_id must be provided together."
}
403 Forbidden
{
"detail": "You do not have permission to create this live class."
}

Response Fields​

NameTypeDescription
idintegerUnique ID of the live class.
titlestringTitle of the live class.
startstringStart time in ISO 8601 format.
endstringEnd time. null for a live class created with a course.
durationintegerDuration in minutes.
providerstringFermion or TpStreams.
is_course_live_classbooleanWhether the live class is attached to a course.
course_idintegerCourse ID when attached to a course, otherwise null.
chapter_idintegerChapter ID when attached to a course, otherwise null.
meeting_idstringProvider meeting/channel identifier.
statusstringLive class status, for example Not Started.
instructorobjectInstructor with id and display_name.
public_join_urlstringPublic join URL for a live class with guest access; otherwise null or an empty string.
createdstringCreation time in ISO 8601 format.

Validation Rules​

  • course_id and chapter_id must be provided together.
  • TpStreams requires course_id and chapter_id; without a course only Fermion is supported.
  • The provider must be configured for the institute. Fermion must be configured, and live streaming (TpStreams) must be enabled.
  • enable_chat: true is rejected for Fermion live classes attached to a course.
  • one_on_one live classes require exactly one audience_users entry, and the instructor must be a different user.
  • group_class live classes require at least one audience user or batch, and the instructor cannot be part of the audience.
  • session_settings and guest_settings only accept the keys listed above.
  • The instructor must be an owner, moderator, or mentor of the institute.