Developer Docs

API Reference

Shulevo's web, Windows, and Android apps all talk to the same JSON REST API. This page explains how it works; the full, always-current list of endpoints is in the interactive reference.

/api

Overview

The API is a RESTful HTTP API. Requests and responses use JSON, and HTTPS is required. Every endpoint lives under /api on the same address you use to open Shulevo.

There are no separate API keys or third-party developer accounts yet. A script or integration signs in with a normal Shulevo user account and can do exactly what that user can do in the app. If you want to connect another system, talk to us first.

Base URL

https://<your Shulevo address>/api

Interactive reference

Every endpoint, its parameters, and its response shape are listed in the OpenAPI reference served by the app itself at /api/docs.

Content Type

All POST, PUT, and PATCH requests must include the header:

Content-Type: application/json

Authentication

Sign in with an email and password to receive a JWT access token, valid for 24 hours, and a refresh token, valid for 30 days. Send the access token on every other request:

Request Header
Authorization: Bearer <token>
POST /auth/login Sign in with email and password
Request Body
{
  "email": "[email protected]",
  "password": "your_password"
}
200 OK
Response
{
  "token": "eyJhbGciOi...",
  "refreshToken": "9f2c...",
  "user": { "id": 12, "name": "…", "role": "admin", "school_id": 3 }
}

If the account has two-factor authentication on, the response is instead { "requires2fa": true, "tempToken": "…" }. Finish signing in with:

POST /auth/2fa/login Complete a two-factor sign-in
Request Body
{
  "tempToken": "…",
  "totpCode": "123456"
}

Returns the same token, refreshToken, and user as a normal sign-in.

POST /auth/refresh Get a new access token
Request Body
{
  "refreshToken": "9f2c..."
}
Tokens carry the user's full permissions. Keep them out of client-side code and public repositories, and use a dedicated account with the narrowest role that does the job.

Roles & Plans

Every request is checked twice:

  • Role — the signed-in user's role (Head Teacher, Teacher, Bursar, Parent, and so on) decides what they may see and change. A teacher, for example, only reaches their own classes.
  • Plan — each module belongs to a plan. Calling a module your school's plan does not include returns 403 with "code": "FEATURE_LOCKED" and the name of the feature.

All data is scoped to the signed-in user's school; one school can never read another's records.

Errors

The API uses standard HTTP status codes. Error responses carry a JSON body with a human-readable error message, and some add a machine-readable code.

StatusMeaning
200OK — request succeeded
201Created — record created
400Bad Request — invalid or missing fields
401Unauthorised — missing, expired, or invalid token
403Forbidden — your role or plan does not allow this
404Not Found — the record does not exist in your school
429Too Many Requests — rate limit exceeded
500Internal Server Error — something went wrong on our end
Error Response Shape
{
  "error": "year is required"
}

Rate Limits

Limits apply per signed-in user (or per IP address before sign-in):

  • All requests: 2,000 per 15 minutes
  • Changes (POST, PUT, PATCH, DELETE): 200 per minute
  • Sign-in attempts: 20 failed attempts per 15 minutes

When a limit is exceeded you receive a 429 response. The standard RateLimit headers say how long to wait before retrying.

Common Endpoints

A few of the endpoints most integrations start with. See the interactive reference for parameters, request bodies, and every other module.

EndpointWhat it does
GET /studentsList learners; filter with class and status
GET /students/{id}One learner's record
GET /classesThe school's classes and streams
GET /marksMarks, filtered by learner, class, subject, term, and year
GET /attendanceDaily attendance records
GET /attendance/summaryAttendance totals and rates
GET /transactionsFee payments and other transactions
GET /transactions/outstanding-feesLearners with fee balances