Skip to main content

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.

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.

Base URL

All endpoints are served under the following prefix:
https://your-backend-url/api/v1
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": <object or null>,
  "error": <string or null>,
  "status": <HTTP status code integer>
}
On success, 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.
data
object | null
The response payload on success, or null when an error occurred.
error
string | null
A human-readable error message on failure, or null when the request succeeded. For validation errors (422), multiple field messages are joined with ; .
status
integer
The HTTP status code of the response, mirrored inside the body for convenience.

HTTP status codes

CodeMeaning
200 OKSuccessful GET or PATCH
201 CreatedSuccessful POST
204 No ContentSuccessful DELETE
400 Bad RequestInput validation failed
401 UnauthorizedMissing or expired JWT
403 ForbiddenValid JWT but accessing another student’s resource
404 Not FoundResource or route not found
409 ConflictEmail already registered
422 Unprocessable EntityDTO validation failed (missing field, wrong type)
502 Bad GatewayExternal AI service unreachable
422 responses are generated by NestJS’s global ValidationPipe when a required field is missing or carries the wrong type. The error string in the envelope will contain all validation messages concatenated with ; .

Authentication

Most endpoints require a valid JSON Web Token. Obtain a token by calling POST /api/v1/auth/login, then include it in the Authorization header of every subsequent request:
Authorization: Bearer <token>
Tokens are signed with HS256 and expire after 24 hours. Once expired, the API returns 401 Unauthorized and you must re-authenticate. See the Authentication guide for the full token lifecycle.

Example: authenticated request

curl https://your-backend.com/api/v1/tasks \
  -H "Authorization: Bearer eyJhbGci..."

Public routes

Two routes do not require a token:
  • POST /api/v1/auth/register
  • POST /api/v1/auth/login
All other routes are protected by a global 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.
MethodPathAuthDescription
POST/api/v1/auth/registerNoRegister a new student
POST/api/v1/auth/loginNoLogin and get JWT
GET/api/v1/tasksJWTList student’s tasks
POST/api/v1/tasksJWTCreate a task
PATCH/api/v1/tasks/:taskIdJWTUpdate a task
DELETE/api/v1/tasks/:taskIdJWTSoft-delete a task
GET/api/v1/tasks/:taskId/micro-objectivesJWTList micro-objectives for a task
PATCH/api/v1/tasks/:taskId/micro-objectives/:moIdJWTUpdate a micro-objective
POST/api/v1/sessionsJWTStart an EMA session
POST/api/v1/sessions/:sessionId/fatigueJWTSubmit a fatigue score
GET/api/v1/sessionsJWTGet session history
GET/api/v1/dashboardJWTGet 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.

Build docs developers (and LLMs) love