Complete API reference for the CRM Service with 67+ endpoints across 10 feature phases.
http://localhost:8080/api/v1
All endpoints require API Key authentication via header:
X-API-Key: your-api-key-here
Some endpoints also require role-based access control (RBAC).
POST /teachers - Create teacherGET /teachers - List all teachers (paginated)GET /teachers/:id - Get teacher detailsPUT /teachers/:id - Update teacherDELETE /teachers/:id - Delete teacherPOST /courses - Create courseGET /courses - List all courses (paginated)GET /courses/:id - Get course detailsPUT /courses/:id - Update courseDELETE /courses/:id - Delete coursePOST /students - Create studentGET /students - List all students (paginated)GET /students/:id - Get student detailsPUT /students/:id - Update studentDELETE /students/:id - Delete studentPOST /groups - Create groupGET /groups - List all groups (paginated)GET /groups/:id - Get group detailsPUT /groups/:id - Update groupDELETE /groups/:id - Delete groupPOST /timetables - Create timetableGET /timetables - List all timetablesGET /timetables/:id - Get timetable detailsPUT /timetables/:id - Update timetableDELETE /timetables/:id - Delete timetablePOST /attendance - Mark attendanceGET /attendance - List attendance recordsGET /attendance/:id - Get attendance detailsGET /attendance/student/:studentID - Get student attendanceGET /attendance/group/:groupID - Get group attendancePUT /attendance/:id - Update attendanceDELETE /attendance/:id - Delete attendancePOST /grades - Create gradeGET /grades - List all gradesGET /grades/:id - Get grade detailsGET /grades/student/:studentID - Get student gradesPUT /grades/:id - Update gradeDELETE /grades/:id - Delete gradePOST /exams - Create examGET /exams - List all exams (paginated)GET /exams/:examID - Get exam detailsGET /exams/course/:courseID - Get exams by courseGET /exams/group/:groupID - Get exams by groupPUT /exams/:examID - Update examPOST /exams/:examID/results - Submit exam resultGET /exams/:examID/results - Get all exam resultsGET /exams/student/:studentID/results - Get student resultsGET /exams/:examID/statistics - Get exam statisticsDELETE /exams/:examID - Delete examPOST /payments - Create paymentGET /payments - List all payments (paginated)GET /payments/:id - Get payment detailsGET /payments/student/:studentID - Get student paymentsPUT /payments/:id - Update paymentDELETE /payments/:id - Delete paymentPOST /invoices - Create invoiceGET /invoices - List all invoices (paginated)GET /invoices/:id - Get invoice detailsGET /invoices/student/:studentID - Get student invoicesPUT /invoices/:id - Update invoiceDELETE /invoices/:id - Delete invoicePOST /notifications - Send notificationGET /notifications - List all notifications (paginated)GET /notifications/:id - Get notification detailsGET /notifications/user/:userID - Get user notificationsPUT /notifications/:id/read - Mark as readDELETE /notifications/:id - Delete notificationPOST /notification-templates - Create templateGET /notification-templates - List all templatesGET /notification-templates/:id - Get template detailsPUT /notification-templates/:id - Update templateDELETE /notification-templates/:id - Delete templatePOST /documents - Upload documentGET /documents - List all documents (paginated)GET /documents/:id - Get document detailsGET /documents/:id/download - Download documentGET /documents/entity/:entityType/:entityID - Get entity documentsPUT /documents/:id - Update document metadataPUT /documents/:id/approve - Approve documentPUT /documents/:id/reject - Reject documentDELETE /documents/:id - Delete documentPOST /messages - Send messageGET /messages - List all messages (paginated)GET /messages/:id - Get message detailsGET /messages/inbox - Get inbox messagesGET /messages/sent - Get sent messagesPUT /messages/:id/read - Mark as readDELETE /messages/:id - Delete messageGET /analytics/dashboard - Get dashboard metricsGET /analytics/financial - Get financial analyticsGET /analytics/student-progress/:studentID - Get student progressGET /analytics/attendance/:groupID - Get attendance analyticsPOST /events - Create eventGET /events - List all events (paginated)GET /events/:id - Get event detailsGET /events/calendar - Get calendar events (date range)PUT /events/:id - Update eventDELETE /events/:id - Delete eventPOST /applications - Submit applicationGET /applications - List all applications (paginated)GET /applications/:applicationID - Get application detailsGET /applications/course/:courseID - Get applications by courseGET /applications/status/:status - Get applications by statusPUT /applications/:applicationID - Update applicationPOST /applications/:applicationID/review - Review applicationPOST /applications/:applicationID/enroll - Enroll studentDELETE /applications/:applicationID - Delete applicationGET /portal/student/:studentID - Get student dashboardGET /portal/teacher/:teacherID - Get teacher dashboardPOST /users - Create userGET /users - List all users (paginated)GET /users/:id - Get user detailsPUT /users/:id - Update userDELETE /users/:id - Delete userPOST /auth/login - LoginPOST /auth/logout - LogoutGET /auth/sessions - List user sessionsDELETE /auth/sessions/:id - Revoke sessionGET /audit-logs - Get audit logs (Admin only)curl -X POST http://localhost:8080/api/v1/students \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890"
}'
curl -X POST http://localhost:8080/api/v1/exams/{examID}/results \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"student_id": "uuid-here",
"marks_obtained": 85,
"total_marks": 100,
"remarks": "Excellent performance"
}'
curl -X GET http://localhost:8080/api/v1/portal/student/{studentID} \
-H "X-API-Key: your-api-key"
All endpoints return standard error responses:
{
"success": false,
"message": "Error description",
"data": null
}
200 - Success201 - Created400 - Bad Request401 - Unauthorized403 - Forbidden404 - Not Found500 - Internal Server ErrorCurrently no rate limiting is implemented. Consider adding in production.
List endpoints support pagination via query parameters:
page - Page number (default: 1)page_size - Items per page (default: 10)search - Search term (optional)Response format:
{
"data": [...],
"total": 100,
"page": 1,
"page_size": 10,
"total_pages": 10
}