AVT School ERP API Documentation
Complete School Management System - Multi-Tenant SaaS Platform
Introduction
The AVT School ERP API provides a comprehensive REST API for managing all aspects of school operations. The system is designed as a multi-tenant SaaS platform where each school operates on their own subdomain.
Base URL
Development: http://localhost:5012/api/v1 Production: https://school.avterp.com/api/v1
Response Format
All responses follow a consistent JSON structure:
{
"ok": true,
"data": { ... }
}
// Error response
{
"ok": false,
"error": {
"code": "ERROR_CODE",
"message": "Human readable message"
}
}
Request Headers
| Header | Required | Description |
|---|---|---|
| Content-Type | Yes | application/json |
| Authorization | For protected routes | Bearer <access_token> |
| x-tenant-id | For multi-tenant routes | Tenant identifier (school subdomain) |
Quick Navigation
Authentication
The API uses JWT-based authentication with access and refresh tokens.
Token Flow
- Login with credentials to receive access + refresh tokens
- Include access token in Authorization header for API calls
- When access token expires, use refresh endpoint to get new tokens
- On logout, revoke the refresh token
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
User Roles & Permissions
The system supports 7 user roles with different permission levels:
Platform Owner
Full access to all features across all tenants. Can manage subscriptions and plans.School Administrator
Full access within school: masters, students, fees, attendance, exams, reports, notifications.School Principal
Read access to masters, attendance, exams. Can manage exam configs and notifications.Teaching Staff
Can mark attendance, create homework, enter marks, view timetable and reports.Finance Staff
Full access to fees module, can generate invoices, receipts, and financial reports.Parent/Guardian
Read access to child's profile, attendance, marks, and fee dues.Student User
Read access to own profile, timetable, homework, and marks.Error Codes
| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | INVALID_INPUT | Request validation failed - check required fields |
| 401 | UNAUTHORIZED | Missing or invalid bearer token |
| 401 | INVALID_TOKEN | Token is expired or malformed |
| 401 | INVALID_REFRESH_TOKEN | Refresh token is invalid or revoked |
| 403 | FORBIDDEN | User lacks required permission |
| 403 | TENANT_MISMATCH | Token tenant doesn't match request tenant |
| 403 | MODULE_DISABLED | Module not enabled for tenant subscription |
| 404 | NOT_FOUND | Requested resource not found |
| 409 | DUPLICATE | Resource already exists |
| 429 | RATE_LIMIT | Too many requests - try again later |
| 500 | INTERNAL_ERROR | Server error - contact support |
Auth API
Authenticate user and receive access + refresh tokens
Request Body
{
"username": "admin@school.com",
"tenantId": "demo-school",
"role": "school_admin"
}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| username | string | Yes | User email or username (3-64 chars) |
| tenantId | string | Yes | School tenant identifier |
| role | string | Yes | One of: super_admin, school_admin, principal, teacher, accountant, parent, student |
Response (200 OK)
{
"ok": true,
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"refreshToken": "abc123.xyz789",
"user": {
"userId": "admin@school.com",
"tenantId": "demo-school",
"role": "school_admin",
"permissions": ["masters:read", "masters:write", "student:read", ...]
}
}
}
Exchange refresh token for new access token
Request Body
{
"refreshToken": "abc123.xyz789"
}
Response (200 OK)
{
"ok": true,
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"refreshToken": "new123.token789",
"user": { ... }
}
}
Revoke refresh token and end session
Auth Required: Bearer Token
Request Body
{
"refreshToken": "abc123.xyz789"
}
Response (200 OK)
{
"ok": true,
"data": { "success": true }
}
Get current authenticated user information
Auth Required: Bearer Token
Response (200 OK)
{
"ok": true,
"data": {
"userId": "admin@school.com",
"tenantId": "demo-school",
"role": "school_admin",
"permissions": ["masters:read", "masters:write", ...]
}
}
Masters API
Manage core master data: academic years, classes, sections, and subjects.
Academic Years
List all academic years for the tenant
Permission: masters:read
Create a new academic year
Permission: masters:write
Request Body
{
"code": "2025-26",
"name": "Academic Year 2025-26",
"startDate": "2025-04-01",
"endDate": "2026-03-31",
"isCurrent": true
}
Classes
List all classes
Create a new class
Request Body
{
"code": "CLASS-10",
"name": "Class 10",
"gradeLevel": 10,
"displayOrder": 10
}
Sections
List all sections
Create a new section
Request Body
{
"code": "SEC-A",
"name": "Section A",
"classId": "CLASS-10",
"capacity": 40
}
Subjects
List all subjects
Create a new subject
Request Body
{
"code": "MATH-10",
"name": "Mathematics",
"classId": "CLASS-10",
"subjectType": "core",
"credits": 5
}
Bulk Import/Export
Export classes as CSV file
Bulk import classes from CSV data
Capabilities API
Check tenant subscription and module availability.
Get tenant's enabled modules and limits
Response
{
"ok": true,
"data": {
"tenantId": "demo-school",
"subscriptionStatus": "active",
"modules": {
"fees": { "enabled": true, "reason": "plan_included" },
"hostel": { "enabled": false, "reason": "not_in_plan" }
},
"limits": {
"studentsMax": 1500,
"studentsUsed": 847,
"storageGb": 50,
"storageUsedGb": 12.5
}
}
}
Get detailed subscription information
Students API
Manage student profiles, certificates, and lifecycle.
List all students
Permission: student:read
Get student details by ID
Create a new student (manual entry)
Permission: student:write
Request Body
{
"fullName": "John Smith",
"dateOfBirth": "2010-05-15",
"gender": "male",
"classId": "CLASS-10",
"sectionId": "SEC-A",
"academicYearId": "2025-26",
"guardianName": "Robert Smith",
"guardianPhone": "+919876543210",
"guardianEmail": "robert@example.com"
}
Promote student to next class
Mark student exit/transfer
Certificates
Issue a certificate (TC, Bonafide, Character, Fee Clearance)
Request Body
{
"type": "bonafide",
"remarks": "Issued for passport application"
}
Download certificate as PDF
Admissions API
Handle admission inquiries and enrollment workflow.
List all admission inquiries
Create a new admission inquiry
Request Body
{
"studentName": "Jane Doe",
"dateOfBirth": "2012-08-20",
"applyingForClass": "CLASS-5",
"guardianName": "John Doe",
"guardianPhone": "+919876543210",
"guardianEmail": "john@example.com",
"previousSchool": "ABC Public School"
}
Update inquiry status (new → in_review → approved/rejected)
Request Body
{
"status": "approved",
"remarks": "All documents verified"
}
Attendance API
Manage daily and period-wise attendance.
Get daily attendance for a class
Query Params: date (YYYY-MM-DD), sectionId
Mark daily attendance for a class
Permission: attendance:write
Request Body
{
"date": "2026-02-12",
"sectionId": "SEC-A",
"entries": [
{ "studentId": "STU001", "status": "present" },
{ "studentId": "STU002", "status": "absent", "reason": "sick" },
{ "studentId": "STU003", "status": "late", "remarks": "10 mins late" }
]
}
Get attendance summary for a student
Response
{
"ok": true,
"data": {
"studentId": "STU001",
"totalDays": 180,
"presentDays": 165,
"absentDays": 10,
"lateDays": 5,
"attendancePercentage": 91.67
}
}
Get attendance analytics for a class
Timetable API
Get timetable entries for a class
Create a timetable entry
Request Body
{
"sectionId": "SEC-A",
"dayOfWeek": 1,
"periodNumber": 1,
"subjectId": "MATH-10",
"teacherId": "TCH001",
"startTime": "08:00",
"endTime": "08:45"
}
Exams API
Manage exams, marks, report cards, and re-evaluations.
List all exam definitions
Create a new exam
Request Body
{
"name": "Mid-Term Examination 2025-26",
"examType": "midterm",
"academicYearId": "2025-26",
"startDate": "2025-09-15",
"endDate": "2025-09-25",
"classIds": ["CLASS-9", "CLASS-10"],
"maxMarks": 100,
"passingMarks": 35
}
Enter/update marks for students
Permission: exams:write
Request Body
{
"subjectId": "MATH-10",
"entries": [
{ "studentId": "STU001", "marksObtained": 85, "remarks": "Excellent" },
{ "studentId": "STU002", "marksObtained": 72, "remarks": "Good" }
]
}
Publish exam results
Get student's report card
Re-evaluation
Request re-evaluation
Fees API
Manage fee structure, invoices, payments, and concessions.
Get fees summary (totals collected, pending)
Permission: fees:read
Fee Heads & Plans
List all fee heads (Tuition, Transport, etc.)
Create a fee head
Request Body
{
"code": "TUITION",
"name": "Tuition Fee",
"description": "Monthly tuition charges",
"isRecurring": true,
"frequency": "monthly"
}
List fee plans
Create a fee plan
Invoices & Receipts
List all invoices
Create a manual invoice
Record payment receipt
Request Body
{
"invoiceId": "INV-2026-001",
"amount": 15000,
"paymentMode": "online",
"transactionId": "TXN123456",
"paymentDate": "2026-02-12"
}
List outstanding (unpaid) invoices
Get fee ledger for a student
Adjustments
Apply concession, scholarship, or penalty
Request Body
{
"invoiceId": "INV-2026-001",
"type": "concession",
"amount": 2000,
"reason": "Sibling discount"
}
Payments API
Online payment integration with Razorpay.
Create payment order
Request Body
{
"invoiceId": "INV-2026-001",
"amount": 15000,
"currency": "INR"
}
Response
{
"ok": true,
"data": {
"orderId": "order_xyz123",
"amount": 1500000,
"currency": "INR",
"key": "rzp_test_xxxxx"
}
}
Verify Razorpay payment signature
HR & Payroll API
Staff Management
List all staff members
Create staff member
Leave Management
List leave requests
Submit leave request
Payroll
List payroll runs
Generate payroll run
Get payslip details
Transport API
List transport routes
Create transport route
Request Body
{
"code": "ROUTE-1",
"name": "North Zone Route",
"vehicleNumber": "KA-01-1234",
"driverName": "Ram Kumar",
"driverPhone": "+919876543210"
}
Add stop to route
Library API
List library books with availability
Add a book to library
Issue book to member
Return an issued book
Inventory API
List inventory items
Create inventory item
Record inventory movement (in/out/adjustment)
Notifications API
List notification history
Send announcement
Permission: notifications:write
Request Body
{
"title": "School Holiday Notice",
"message": "School will remain closed on 26th January for Republic Day.",
"targetType": "all",
"channels": ["push", "sms", "email"]
}
Reports API
Get dashboard summary
Response
{
"ok": true,
"data": {
"totalStudents": 847,
"totalStaff": 52,
"todayAttendance": 92.5,
"feeCollectionThisMonth": 1250000,
"pendingFees": 450000,
"upcomingEvents": 3
}
}
Get role-specific dashboard data
CSV Exports
Export outstanding fees as CSV
Export daily attendance as CSV
Scheduled Reports
Create scheduled report
Mobile API
Get mobile app bootstrap data
Response
{
"ok": true,
"data": {
"user": {
"userId": "parent@example.com",
"role": "parent",
"children": ["STU001", "STU002"]
},
"capabilities": {
"modules": { "fees": true, "attendance": true }
},
"quickStats": {
"unreadNotifications": 3,
"pendingFees": 25000,
"todayAttendance": "present"
}
}
}
Testing Examples
cURL Examples
Health Check
curl http://localhost:5012/api/v1/health
Login
curl -X POST http://localhost:5012/api/v1/auth/login \
-H "Content-Type: application/json" \
-H "x-tenant-id: demo-school" \
-d '{"username":"admin@school.com","tenantId":"demo-school","role":"school_admin"}'
List Students (with auth)
curl http://localhost:5012/api/v1/students \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "x-tenant-id: demo-school"
Mark Attendance
curl -X POST http://localhost:5012/api/v1/attendance/classes/CLASS-10/mark \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-tenant-id: demo-school" \
-d '{
"date": "2026-02-12",
"sectionId": "SEC-A",
"entries": [
{"studentId": "STU001", "status": "present"},
{"studentId": "STU002", "status": "absent", "reason": "sick"}
]
}'
© 2026 Avuetech Solutions. All rights reserved.