Subjects
Manage academic subject definitions within a school.
All endpoints require
Authorization: Bearer <token>andX-SCHOOL-IDheaders.
List Subjects
GET /templates
Returns all subject templates for the current school.
Example
curl -X GET https://api.vanillatots.com/templates \
-H "Authorization: Bearer $TOKEN" \
-H "X-SCHOOL-ID: $SCHOOL_ID"
Response 200 OK
[
{
"id": "uuid",
"name": "Mathematics",
"code": "MATH",
"school": "school-uuid"
}
]
Create Subject
POST /templates
Create a new subject definition.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Subject name (e.g., "Mathematics") |
code | string | Yes | Short code (e.g., "MATH") |
Example
curl -X POST https://api.vanillatots.com/templates \
-H "Authorization: Bearer $TOKEN" \
-H "X-SCHOOL-ID: $SCHOOL_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "English Language",
"code": "ENG"
}'
Response 200 OK — Returns the created SubjectResponse.
Delete Subject
DELETE /templates/{id}
Remove a subject definition.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | uuid | Subject ID |
Response 200 OK