Back to sign in
Developer reference

API documentation

A complete REST API for integrating Lernix into your stack. All endpoints accept and return JSON.

Base URL
https://api.lernix.app

Authentication

Issue and revoke access tokens.

POST/v1/auth/session
200 OK

Create a session for the given role.

Request
{ "role": "student" }
Response
{ "token": "lx_eyJh…", "user": { "id": "u-stu-001", "role": "student" } }
DELETE/v1/auth/session
200 OK

Revoke the current session.

Response
{ "ok": true }
GET/v1/auth/me
200 OK

Return the authenticated user.

Response
{ "id": "u-stu-001", "name": "Aarav Mehta", "role": "student" }

Authentication

Send your token in the Authorization header on every request.

curl https://api.lernix.app/v1/courses \
  -H "Authorization: Bearer lx_eyJhbGciOiJI…" \
  -H "Content-Type: application/json"