Skip to main content

Subjects

Manage academic subject definitions within a school.

All endpoints require Authorization: Bearer <token> and X-SCHOOL-ID headers.


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

FieldTypeRequiredDescription
namestringYesSubject name (e.g., "Mathematics")
codestringYesShort 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

ParameterTypeDescription
iduuidSubject ID

Response 200 OK