Maths Learning Platform Endpoints
/api/users
Get all users with optional filtering
role, year_group, exam_board
/api/users?role=student&year_group=10
/api/users
Create a new user
{ "name": "John Smith", "email": "john@email.com", "password": "password123", "role": "student", "year_group": 10, "target_grade": "A", "exam_board": "AQA", "parents_name": "Jane Smith" }
/api/users
/api/users/[id]
Get specific user by ID
/api/users/123
/api/users/[id]
Update user information
{ "name": "John Smith Updated", "email": "john.updated@email.com", "role": "student", "active": true }
/api/users/123
/api/users/[id]
Soft delete user (set active = false)
/api/users/123
/api/root
Submit Maths Tutor Interest Form
{ "learnerName": "John Smith", "parentName": "Jane Smith", "yeargroup": "Year 10", "school": "Manchester High School", "phone": "07123456789", "email": "jane.smith@email.com", "classPreference": "higher", "homework": "yes", "goals": "Improve algebra skills", "notes": "Struggles with quadratic equations" }
/api/root
endpoints
Get all the endpoints
/endpoints
/api/users
Create a new user
{ "name": "John Smith", "email": "john@email.com", "password": "password123", "role": "student", "year_group": 10, "target_grade": "A", "exam_board": "AQA", "parents_name": "Jane Smith" }
/api/users
/api/users/[id]
Get specific user by ID
/api/users/123
/api/users/[id]
Update user information
{ "name": "John Smith Updated", "email": "john.updated@email.com", "role": "student", "active": true }
/api/users/123
/api/users/[id]
Soft delete user (set active = false)
/api/users/123
/api/content
Get all content with optional filtering
type, parent_id, published
/api/content?type=lesson&published=true
/api/content
Create new content (course, topic, or lesson)
{ "parent_id": 1, "type": "lesson", "name": "Quadratic Equations", "description": "Learn to solve quadratic equations", "code": "MATH-L001", "grade_min": 9, "grade_max": 11, "published": true }
/api/content
/api/content/[id]
Get specific content item
/api/content/456
/api/content/[id]
Update content item
{ "name": "Advanced Quadratic Equations", "description": "Updated description", "published": true }
/api/content/456
/api/content/[id]
Delete content item
/api/content/456
/api/bookings
Get all bookings with tutor/student details
tutor_id, student_id, status, date_from, date_to
/api/bookings?status=scheduled&tutor_id=123
/api/bookings
Create new booking/session
{ "tutor_id": 1, "student_id": 2, "scheduled_start": "2025-07-28T14:00:00Z", "scheduled_end": "2025-07-28T15:00:00Z", "content_id": 5, "cost": 25 }
/api/bookings
/api/bookings/[id]
Get specific booking details
/api/bookings/789
/api/bookings/[id]
Update booking (complete session, add notes)
{ "status": "completed", "session_notes": "Great progress on algebra", "homework_set": "Complete exercises 1-10", "rating": 5 }
/api/bookings/789
/api/progress
Get student progress records
user_id, content_id, status
/api/progress?user_id=123&status=completed
/api/progress
Create or update progress record
{ "user_id": 2, "content_id": 5, "completion": 75, "status": "in_progress", "grade": 8.5, "strengths": "Good understanding of concepts", "areas_for_improvement": "Need more practice with word problems", "sessions_count": 3, "homework": "Complete chapter 5 exercises", "next_lesson_plan": "Move to advanced topics" }
/api/progress
/api/questions
Get quiz questions with filtering
type, grade_min, grade_max, active
/api/questions?type=multiple_choice&grade_min=9
/api/questions
Create new question
{ "text": "What is 2x + 5 = 13?", "type": "multiple_choice", "correct_answer": "4", "options": [ "2", "4", "6", "8" ], "grade_min": 9, "grade_max": 11 }
/api/questions
/api/quizzes
Get all quizzes
content_id, published
/api/quizzes?published=true
/api/attempts
Submit quiz attempt
{ "user_id": 2, "quiz_id": 1, "score": 85, "completed": true }
/api/attempts
/api/students
Get all students with filtering
year_group, target_grade, active
/api/students?year_group=10&active=true
/api/students
Create new student account
{ "name": "Alice Johnson", "email": "alice@email.com", "year_group": 11, "target_grade": "A*", "exam_board": "Edexcel", "parents_name": "Sarah Johnson" }
/api/students
/api/students/[id]
Update student information
{ "target_grade": "A*", "year_group": 12, "active": true }
/api/students/123
/api/tutors
Get all tutors with specializations
subject, grade_level, available
/api/tutors?subject=mathematics&available=true
/api/tutors
Create new tutor account
{ "name": "Dr. Smith", "email": "smith@email.com", "specializations": [ "Algebra", "Calculus" ], "hourly_rate": 35, "qualifications": "PhD Mathematics" }
/api/tutors
/api/tutors/[id]
Update tutor profile and availability
{ "hourly_rate": 40, "available": true, "specializations": [ "Advanced Calculus" ] }
/api/tutors/456
/api/settings
Get system settings
/api/settings
/api/settings
Update system settings
{ "platform_name": "MathsMaster Pro", "default_session_length": "60", "currency": "GBP" }
/api/settings
/api/admin/reset-log
Get admin reset operations log
admin_id, target_user_id
/api/admin/reset-log
/api/admindb
Get admin dashboard with student list
/api/admindb
/api/admindb/[studentid]
Get individual student details
/api/admindb/1
/api/tutordb
Get tutor dashboard
/api/tutordb
/api/studentdb
Get student dashboard
/api/studentdb
Include JWT token in Authorization header for protected endpoints.
Set Content-Type: application/json for POST/PUT requests.
All endpoints return consistent error format with status codes.