Skip to main content

API Design

The SyncAD API follows REST conventions with a unified structure across all platform modules.

Base URLs

EnvironmentURL
Developmenthttps://dev-api.metaonus.in
Productionhttps://api.metaonus.in

Path Structure

/{platform}/{module}/{action}

Examples:
POST /parent/student/list
POST /teacher/attendance/mark
POST /driver/bus-tracking/trips/123/start
POST /school-admin/student/create
PrefixPlatformAuth
/parent/*Parents AppJWT (PARENT role)
/teacher/*Teachers AppJWT (TEACHER role)
/driver/*Drivers AppJWT (DRIVER role)
/school-admin/*School Admin UIJWT (SCHOOL_ADMIN role)
/super-admin/*Super Admin UIJWT (SUPER_ADMIN role)

Request Format

POST /parent/student/list
Authorization: Bearer <jwt>
Content-Type: application/json

{
"data": {
"academicYearId": "uuid"
}
}

Response Format

Success

{
"data": {
"students": [...],
"total": 42
},
"message": "Students fetched successfully"
}

Error

{
"statusCode": 400,
"message": "Invalid academic year ID",
"error": "Bad Request"
}

Paginated List

{
"data": {
"items": [...],
"total": 120,
"page": 1,
"limit": 20,
"totalPages": 6
}
}

HTTP Status Codes

CodeMeaning
200Success
201Created
204No Content (successful delete)
400Bad Request — invalid input
401Unauthorized — missing or invalid JWT
403Forbidden — valid JWT but insufficient permissions
404Not Found
409Conflict — duplicate resource
422Unprocessable Entity — validation error
500Internal Server Error

Authentication

All endpoints (except /auth/*) require:

Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

JWT payload contains sub (userId), role, and schoolId.

Pagination

List endpoints support pagination via request body:

{
"data": {
"page": 1,
"limit": 20,
"filters": {
"classId": "uuid",
"search": "john"
},
"sort": {
"field": "firstName",
"order": "asc"
}
}
}

Versioning

API is versioned via URL path prefix (current: v1 implicit). Breaking changes are introduced with a new prefix: /v2/parent/*.

Rate Limiting

TierLimit
Auth endpoints10 req/min per IP
Read endpoints100 req/min per user
Write endpoints30 req/min per user

Common Enums

// Attendance Status
'PRESENT' | 'ABSENT' | 'LATE' | 'LEAVE' | 'HOLIDAY'

// Leave Status
'PENDING' | 'APPROVED' | 'REJECTED' | 'CANCELLED'

// Fee Entry Type
'DR' | 'CR' // Debit / Credit (double-entry personal accounts)

// Trip Status
'SCHEDULED' | 'STARTED' | 'PAUSED' | 'ENDED'

// Boarding Status
'boaded' | 'alighted' | 'absent' | 'no_show'

Error Codes

CodeDescription
SCHOOL_NOT_FOUNDschoolId in JWT does not match any school
STUDENT_NOT_FOUNDStudent ID does not exist in school DB
DUPLICATE_ENTRYResource already exists (e.g., duplicate admission No)
EVALUATION_MODE_READONLYTeacher attempted write in evaluation mode
OTP_EXPIREDOTP TTL (5 min) exceeded
OTP_INVALIDWrong OTP entered
REFRESH_TOKEN_EXPIREDRefresh token older than 7 days
PERMISSION_DENIEDRole lacks required module permission