Cohort Subjects
Assign subjects to cohorts and manage student enrollment in those subjects.
All endpoints require
Authorization: Bearer <token>andX-SCHOOL-IDheaders unless noted otherwise.
List Cohort Subjects
GET /cohort-subjects
Returns a paginated list of subject assignments for cohorts.
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
pageNumber | integer | Yes | 0 | Zero-indexed page |
pageSize | integer | Yes | 50 | Results per page |
batch | uuid | No | — | Filter by batch ID |
base | uuid | No | — | Filter by base subject ID |
session | string | No | — | Filter by session |
Example
curl -X GET "https://api.vanillatots.com/cohort-subjects?pageNumber=0&pageSize=25&batch=batch-uuid" \
-H "Authorization: Bearer $TOKEN" \
-H "X-SCHOOL-ID: $SCHOOL_ID"
Response 200 OK
{
"page_number": 0,
"page_size": 25,
"total_pages": 2,
"total": 30,
"data": [
{
"id": "uuid",
"elective": false,
"subject": "Mathematics",
"code": "MATH",
"cohort": "cohort-uuid"
}
]
}
Create Cohort Subject
POST /cohort-subjects
Assign a subject to a cohort.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
cohort_id | uuid | Yes | Cohort ID |
subject_id | uuid | Yes | Subject template ID |
elective | boolean | Yes | Whether the subject is elective |
Example
curl -X POST https://api.vanillatots.com/cohort-subjects \
-H "Authorization: Bearer $TOKEN" \
-H "X-SCHOOL-ID: $SCHOOL_ID" \
-H "Content-Type: application/json" \
-d '{
"cohort_id": "cohort-uuid",
"subject_id": "subject-uuid",
"elective": false
}'
Response 200 OK — Returns the created CohortSubjectResponse.
Get Cohort Subject
GET /cohort-subjects/{id}
Retrieve a single cohort subject assignment.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | uuid | Cohort subject ID |
Response 200 OK — Returns a CohortSubjectResponse object.
Add Students to Subject
PATCH /cohort-subjects/{id}/students
Enroll students into a specific cohort subject.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | uuid | Cohort subject ID |
Request Body — An array of student UUIDs.
["student-uuid-1", "student-uuid-2", "student-uuid-3"]
Example
curl -X PATCH https://api.vanillatots.com/cohort-subjects/{id}/students \
-H "Authorization: Bearer $TOKEN" \
-H "X-SCHOOL-ID: $SCHOOL_ID" \
-H "Content-Type: application/json" \
-d '["student-uuid-1", "student-uuid-2"]'
Response 200 OK — Returns the updated CohortSubjectResponse.
Remove Student from Subject
DELETE /cohort-subjects/{id}/students/{student_id}
Remove a single student from a cohort subject.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | uuid | Cohort subject ID |
student_id | uuid | Student ID |
Response 200 OK