Skip to main content

Register User

The first user registered in the system automatically becomes an ADMIN regardless of the requested role.
POST /register
string
required
Unique username for the account
string
required
Email address for the account
string
required
Full name of the user
string
required
User role: ADMIN, PARENT, or LEARNER
string
required
Account password (will be hashed)
string
Required for LEARNER accounts - ID of the parent user

Response

string
JWT authentication token
object
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
string
required
Username for the account
string
required
Account password

Response

string
JWT authentication token
object
User object (same structure as registration)
string
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

Response