Documentation Index
Fetch the complete documentation index at: https://docs.sunschool.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Register User
The first user registered in the system automatically becomes an ADMIN regardless of the requested role.
POST /register
Unique username for the account
Email address for the account
Full name of the user
User role:
ADMIN, PARENT, or LEARNERAccount password (will be hashed)
Required for LEARNER accounts - ID of the parent user
Response
JWT authentication token
Response Example
Error Codes
- 400 - Missing required fields or invalid role
- 400 - Username already exists
- 400 - Invalid parent user specified (code 23503)
- 503 - Database connection failed
Login
POST /login
Username for the account
Account password
Response
JWT authentication token
User object (same structure as registration)
Domain information for client-side handling
Response Example
Error Codes
- 400 - Username and password are required
- 401 - Invalid credentials
- 500 - Authentication error
Logout
POST /logout
This endpoint redirects to
/api/logout with status 307.Get Current User
GET /user
This endpoint redirects to
/api/user with status 307.Health Check
GET /api/healthcheck