Create a test in a course lesson.
Creates an empty test (quiz) in a course lesson or live session and attaches it as a session material. Send the query parameter type=3.
Endpoint
post https://{TrainerCentral-API-Domain}/tc/api/v1/trainer/session/{sessionId}/forms.json
OAuth Scope
Headers
ID of the academy (orgId).
Path Parameters
ID of the course lesson or live session (sessionId).
Query Parameters
Form type. Must be 3 (Test).
Request Body
application/jsonThe test to create.
Hide Sub-Attributes
Name of the test. Max 50 characters.
Instructions shown before the test starts. Supports rich text.
curl --request POST \
--url 'https://trainercentral.zoho.com/tc/api/v1/trainer/session/3000000000040/forms.json?type=3' \
--header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
--header 'content-type: application/json' \
--header 'tc-orgId: 51517414' \
--data '{"form":{"name":"Python Basics Quiz","description":"<p>Answer all questions. You can attempt the quiz once.</p>"}}' {
"form": {
"name": "Python Basics Quiz",
"description": "<p>Answer all questions. You can attempt the quiz once.</p>"
}
}
Response Parameters
The test form. Use form.formId in the course test APIs.
Hide Sub-Attributes
Test form ID (formUuid_sessionId). The part before the underscore is the form UUID.
Form UUID of the test. Returned only by Create Course Test.
Same as formId.
ID of the lesson that holds the test.
Name of the test.
Test instructions. Supports rich text.
Form type. Always 3 (Test).
Settings of the test, with defaults.
Hide Sub-Attributes
Test ID. Not the form UUID.
Test form ID (formUuid_sessionId).
Same as formId.
ID of the lesson that holds the test.
Same as sessionId.
Name of the test.
Test instructions. Supports rich text.
Number of questions.
true when grading is on.
true when retakes are allowed.
Number of retakes allowed after the first attempt.
Pass percentage.
true when the test has a time limit.
Time limit in minutes.
true when questions are shuffled.
true when answer options are shuffled.
true when negative marking is on.
Who sees the result. Allowed: 0=Default, 1=All, 2=No one, 3=Passed only, 4=Failed only.
Who sees the score. Allowed: 0=Default, 1=All, 2=No one, 3=Passed only, 4=Failed only.
Who can retake. Allowed: 1=All, 3=Passed only, 4=Failed only.
Who sees their answers. Allowed: 0=Default, 1=All, 2=No one, 3=Passed only, 4=Failed only.
Who sees the correct answers. Allowed: 0=Default, 1=All, 2=No one, 3=Passed only, 4=Failed only.
Who sees answer feedback. Allowed: 0=Default, 1=All, 2=No one, 3=Passed only, 4=Failed only.
Who sees whether each answer is correct. Allowed: 0=Default, 1=All, 2=No one, 3=Passed only, 4=Failed only.
true when learners can change answers after submitting.
true when feedback shows after each question.
Message displayed after submission. Supports rich text.
Message displayed to learners when they pass the assessment. Supports rich text.
Message displayed to learners when they fail the assessment. Supports rich text.
Grace time in seconds after the time limit.
Number of questions picked per attempt when shuffling.
Legacy flag.
Legacy flag.
Marks or percent deducted per wrong answer.
Allowed: 0=Points, 1=Percentage.
The attachment of the test to the session.
Hide Sub-Attributes
Show Sub-Attributes
ID of the attachment that holds the test (sessionMaterialId).
Same as sessionMaterialId.
ID of the lesson or live session (sessionId).
Same value as sessionId.
UUID of the test form (form.formIdValue).
Type of the material. Always 20=Test.
Placement of the material. 2=Assessment for tests.
Name of the test.
Zero-based position among the session materials.
Time attached, in epoch milliseconds.
Questions of the test. Empty on create.
Hide Sub-Attributes
Show Sub-Attributes
Question ID (fieldId).
Test form ID (formUuid_sessionId).
Same as formId.
Question text.
Question type. Allowed: 2=Choice, 7=True or false, 8=Fill in the blank, 16=Essay.
Marks for a correct answer.
true when the question must be answered.
Not used. Always false.
Position of the question.
Not used. Always 0.
Allowed: 0=Default, 1=OCR.
Evaluation data for OCR.
Fill in the blank only. true when answers are case sensitive.
Essay only. Maximum answer length.
Essay only. Allowed: 0=Characters, 1=Words.
true when feedback is on.
Feedback for the question.
Show Sub-Attributes
Feedback mode. Allowed: 0=Same for any answer, 1=Correct and incorrect, 2=Per option.
Feedback texts. Supports rich text.
Error details.
Hide Sub-Attributes
Deprecated numeric error code (for example ST_202). Prefer codeStr; omitted from doc samples.
Error code name (ShowtimeErrorCode / err_code_str), for example MISSING_PARAMETER.
Error message.
Possible Error Codes
| HTTP Code | Error Code | Description |
|---|---|---|
| 500 | ST_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, the primary trainer, or a course admin or trainer. Call with one of these roles; do not retry unchanged. |
{
"sessionMaterials": [
{
"sessionMaterialId": "3000000000130",
"id": "3000000000130",
"sessionId": "3000000000040",
"session": "3000000000040",
"resourceId": "7c1dcd08-2ab8-49de-befa-0c5696f22b9d",
"resourceType": "20",
"viewType": "2",
"topic": "Python Basics Quiz",
"sessionMaterialIndex": "1",
"time": "1782727715513"
}
],
"form": {
"formId": "48224910-b860-478b-97ee-2fcb3b53c8e1_3000000000040",
"formIdValue": "48224910-b860-478b-97ee-2fcb3b53c8e1",
"sessionId": "3000000000040",
"name": "Python Basics Quiz",
"type": "3"
},
"test": {
"formId": "48224910-b860-478b-97ee-2fcb3b53c8e1_3000000000040",
"sessionId": "3000000000040",
"name": "Python Basics Quiz",
"totalQuestions": "0",
"enableGrading": "false",
"attemptsCount": "0"
},
"fields": []
}
{
"error": {
"code": "string",
"codeStr": "string",
"message": "string"
}
}
500 Request failed; see the error code.© 2026, Zoho Corporation Pvt. Ltd. All Rights Reserved.