The MindFlow REST API is a NestJS-powered HTTP service that gives client applications full access to the platform’s student management, task tracking, and adaptive EMA sessions. Every response — whether it signals success or failure — is wrapped in a predictable three-field JSON envelope, so your error-handling logic stays uniform across all 12 endpoints.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/J0S3-LEON/pf_pruebasAseguramientoCalid_SDD/llms.txt
Use this file to discover all available pages before exploring further.
Base URL
All endpoints are served under the following prefix:The global prefix
api/v1 is enforced by NestJS’s setGlobalPrefix call in main.ts. Every route in the system — without exception — starts with this prefix.Response envelope
Every response returned by the API, regardless of HTTP method, endpoint, or status code, conforms to the following structure:data carries the response payload and error is null. On failure, data is null and error contains a human-readable message. The status field always mirrors the HTTP response status code, making it easy to handle errors inside response bodies without inspecting HTTP headers separately.
The response payload on success, or
null when an error occurred.A human-readable error message on failure, or
null when the request succeeded. For validation errors (422), multiple field messages are joined with ; .The HTTP status code of the response, mirrored inside the body for convenience.
HTTP status codes
| Code | Meaning |
|---|---|
| 200 OK | Successful GET or PATCH |
| 201 Created | Successful POST |
| 204 No Content | Successful DELETE |
| 400 Bad Request | Input validation failed |
| 401 Unauthorized | Missing or expired JWT |
| 403 Forbidden | Valid JWT but accessing another student’s resource |
| 404 Not Found | Resource or route not found |
| 409 Conflict | Email already registered |
| 422 Unprocessable Entity | DTO validation failed (missing field, wrong type) |
| 502 Bad Gateway | External AI service unreachable |
Authentication
Most endpoints require a valid JSON Web Token. Obtain a token by callingPOST /api/v1/auth/login, then include it in the Authorization header of every subsequent request:
401 Unauthorized and you must re-authenticate. See the Authentication guide for the full token lifecycle.
Example: authenticated request
Public routes
Two routes do not require a token:POST /api/v1/auth/registerPOST /api/v1/auth/login
JwtAuthGuard. Requests to protected routes without a valid token receive a 401 response.
Endpoint index
The table below lists all 12 endpoints exposed by the MindFlow API.| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /api/v1/auth/register | No | Register a new student |
| POST | /api/v1/auth/login | No | Login and get JWT |
| GET | /api/v1/tasks | JWT | List student’s tasks |
| POST | /api/v1/tasks | JWT | Create a task |
| PATCH | /api/v1/tasks/:taskId | JWT | Update a task |
| DELETE | /api/v1/tasks/:taskId | JWT | Soft-delete a task |
| GET | /api/v1/tasks/:taskId/micro-objectives | JWT | List micro-objectives for a task |
| PATCH | /api/v1/tasks/:taskId/micro-objectives/:moId | JWT | Update a micro-objective |
| POST | /api/v1/sessions | JWT | Start an EMA session |
| POST | /api/v1/sessions/:sessionId/fatigue | JWT | Submit a fatigue score |
| GET | /api/v1/sessions | JWT | Get session history |
| GET | /api/v1/dashboard | JWT | Get aggregated dashboard data |
Explore by resource
Auth
Register a student account and obtain a JWT via login.
Tasks
Create, list, update, and soft-delete academic tasks.
Sessions
Start EMA sessions, submit fatigue scores, and retrieve session history.
Dashboard
Retrieve aggregated tasks, micro-objectives, and fatigue history.
Notifications
Access the notification dispatch log for the authenticated student.
Data Models
Explore the underlying PostgreSQL schema and entity relationships.