Developers
Salam Academy API v1
JSON over HTTPS. Browser clients authenticate with the session cookie; mobile apps send Authorization: Bearer <token>. State-changing cookie requests must be same-origin. Errors return { error: { code, message } }.
| Method | Path | Access | Description |
|---|---|---|---|
| POST | /api/v1/auth/register | Public | Create an account { name, email, password, role } and sign in. |
| POST | /api/v1/auth/login | Public | Sign in { email, password }. Sets an httpOnly session cookie. |
| POST | /api/v1/auth/logout | Signed in | End the current session. |
| POST | /api/v1/auth/password/forgot | Public | Email a one-hour reset link { email }. Same response whether or not the account exists. |
| POST | /api/v1/auth/password/reset | Public | Set a new password { token, password }. Signs out all sessions. |
| GET | /api/v1/auth/google | Public | Start Google sign-in (when configured). |
| GET | /api/v1/me | Signed in | Current user and learner profile. |
| PATCH | /api/v1/me/profile | Signed in | Update course: versionId, optionComponentIds, targetGrade, examDate, confidence, hintMode. |
| GET | /api/v1/me/export | Signed in | Download all learner data as JSON. |
| DELETE | /api/v1/me | Signed in | Delete the account { confirmEmail }. |
| GET | /api/v1/questions | Signed in | Published questions. Query: concept, skill, difficulty. Never includes answers. |
| POST | /api/v1/attempts | Signed in | Mark an answer { questionId, response: { partKey: value }, assignmentId? }. Returns per-part feedback and the first point of error. |
| POST | /api/v1/questions/:id/hints | Signed in | Reveal the next hint. |
| GET | /api/v1/questions/:id/solution | Signed in | Worked solution, after one attempt or all hints. |
| POST | /api/v1/questions/:id/similar | Signed in | Generate a verified variant testing the same skill. |
| PUT | /api/v1/progress/lessons/:id | Signed in | Merge completed lesson items { completed: string[] }. |
| POST | /api/v1/bookmarks | Signed in | Save or remove { entityType, entityId, folder?, remove? }. |
| POST | /api/v1/plan | Signed in | Add or remove a concept from the study plan { conceptId, remove? }. |
| POST | /api/v1/tests | Signed in | Create a timed test { conceptIds, minutes }. |
| POST | /api/v1/tests/:id/submit | Signed in | Submit answers { answers: { questionId: { partKey: value } } } and receive the analysis. |
| POST | /api/v1/issues | Signed in | Report a problem with a lesson or question. |
| GET | /api/v1/search?q= | Public | Full-text search over lessons, syllabus topics and questions. |
| GET/POST | /api/v1/tutor | Signed in | Salam Tutor { mode, message, questionId?, history? } (requires an AI provider key). |
| POST | /api/v1/classes | Teacher | Create a class { name, versionId? }. |
| POST | /api/v1/classes/join | Signed in | Join a class { code }. |
| POST | /api/v1/teacher/generate | Teacher | Select questions for an assignment { conceptSlug, difficulty[], count, exclude? }. |
| POST | /api/v1/assignments | Teacher | Assign reviewed questions { classId, title, questionIds, dueAt? }. |
| GET | /api/v1/health | Public | Liveness and database check. |