This document lists all available API endpoints, their methods, expected request/response formats, and usage notes. Use this as a reference for frontend integration and Postman testing.
- POST
/api/auth/register - Request Body:
{ "email": "string", "username": "string", "password": "string" } - Response:
{ "access_token": "string", "user": { "id": int, "email": "string", "username": "string", ... } } - Notes: Returns JWT token and user info on success.
- POST
/api/auth/login - Request Body:
{ "email": "string", "password": "string" } - Response:
{ "access_token": "string", "user": { "id": int, "email": "string", "username": "string", ... } } - Notes: Returns JWT token and user info on success.
- GET
/api/auth/me - Headers:
Authorization: Bearer <access_token>
- Response:
{ "id": int, "email": "string", "username": "string", ... }
- GET
/api/history?limit=50&offset=0 - Headers:
Authorization: Bearer <access_token>
- Response:
{ "entries": [ { "id": int, "concept": "string", "explanation": "string", "created_at": "datetime" }, ... ], "total": int }
- POST
/api/history - Headers:
Authorization: Bearer <access_token>
- Request Body:
{ "concept": "string", "explanation": "string" } - Response:
{ "id": int, "concept": "string", "explanation": "string", "created_at": "datetime" }
- DELETE
/api/history/{entry_id} - Headers:
Authorization: Bearer <access_token>
- Response:
{ "message": "History entry deleted successfully" }
- GET
/api/explain - Response:
{ "concept": "string", "explanation": "string" }
- GET
/api/fallback-explain - Response:
{ "concept": "string", "explanation": "string" }
- GET
/health - Response:
{ "status": "healthy", "database": "connected|disconnected: reason", "message": "ELI5 Server is running successfully!" }
- All endpoints (except
/api/explain,/api/fallback-explain,/health, and/api/auth/register/login) require a valid JWT token in theAuthorizationheader. - Date/time fields are in ISO 8601 format.
- Use this document to configure Postman collections and guide frontend API integration.