Skip to main content

Schools

Manage school registration, profiles, and logos.

All endpoints require Authorization: Bearer <token>. The X-SCHOOL-ID header is not required for school-level endpoints.


List Schools

GET /schools

Returns a paginated list of all schools.

Query Parameters

ParameterTypeRequiredDefaultDescription
pageNumberintegerYes0Zero-indexed page
pageSizeintegerYes50Results per page

Example

curl -X GET "https://api.vanillatots.com/schools?pageNumber=0&pageSize=25" \
-H "Authorization: Bearer $TOKEN"

Response 200 OK

{
"page_number": 0,
"page_size": 25,
"total_pages": 1,
"total": 3,
"data": [
{
"id": "uuid",
"name": "Sunrise Academy",
"abbreviation": "SA",
"imageUrl": "https://...",
"phoneNumber": "+2348012345678",
"emailAddress": "info@sunrise.edu.ng"
}
]
}

Create School

POST /schools

Register a new school. Accepts both application/json and multipart/form-data.

Request Body

FieldTypeRequiredDescription
namestringYesSchool name
physical_addressstringYesSchool location
email_addressemailYesContact email
phone_numberstringYesContact phone
abbreviationstringYesShort abbreviation (e.g., "SA")

Example

curl -X POST https://api.vanillatots.com/schools \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Sunrise Academy",
"physical_address": "42 School Road, Lagos",
"email_address": "info@sunrise.edu.ng",
"phone_number": "+2348012345678",
"abbreviation": "SA"
}'

Response 200 OK — Returns the created SchoolResponse.


Get School

GET /schools/{id}

Retrieve a single school by ID.

Path Parameters

ParameterTypeDescription
idstringSchool ID

Response 200 OK — Returns a SchoolResponse object.


PATCH /schools/{schoolId}/upload-logo

Upload or replace the school's logo/badge image.

Path Parameters

ParameterTypeDescription
schoolIduuidSchool ID

Request Bodymultipart/form-data

FieldTypeRequiredDescription
logobinaryYesImage file for the school badge

Example

curl -X PATCH https://api.vanillatots.com/schools/{schoolId}/upload-logo \
-H "Authorization: Bearer $TOKEN" \
-F "logo=@/path/to/logo.png"

Response 200 OK — Returns the updated SchoolResponse.