The Authentication API handles the full identity lifecycle for Gestor Deportivo users: creating accounts, verifying them by email, signing in to receive a JWT, and signing out. A separate Password Recovery section documents the two-step code-based flow for resetting a forgotten password. All paths below are relative to your server base URL (e.g.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/gestor-backend/llms.txt
Use this file to discover all available pages before exploring further.
http://localhost:3000). Unless noted, none of these endpoints require a token.
All endpoints in this API use the POST HTTP method. There are no GET, PUT, PATCH, or DELETE routes. The authentication token — where required — must be sent in the
access-token request header, not as an Authorization: Bearer header.POST /api/user/register
Register a new user account. The request must be sent asmultipart/form-data because an optional avatar image can be uploaded at registration time. On success, a 5-digit verification code is sent to the supplied email address. The account remains inactive until that code is confirmed via /api/user/verify-accounts.
Default values assigned at registration
| Field | Default |
|---|---|
roles | [{ name: "Usuario", value: "1" }] |
activate | [{ name: "Inactivo", value: "2" }] |
membership | "Plan Gratis" |
academyOrClub | "Sin academia o club" |
Request
Content-Type must be
multipart/form-data.User’s first name.
User’s last name.
Email address. Stored in lowercase. Must be unique across all accounts.
Plain-text password. Hashed with bcrypt before storage.
Gender. Must be one of
"Masculino", "Femenino", or "Otro".Profile image. Any common image format (JPEG, PNG, WebP). Stored in
storage/OauthUser/.Example
Response
200 — CreatedHuman-readable result message.
true on success.The newly created user document.
| HTTP status | Condition |
|---|---|
202 | One or more required fields (firstName, lastName, email, password, sex) are missing. |
200 with status: false | The email address is already registered. |
POST /api/user/verify-accounts
Activate a newly registered account by submitting the 5-digit code delivered to the user’s email. Once verified, the account’sactivate field is updated to [{ name: "1", value: "Activo" }] and the user can log in.
Request
The email address of the account to activate.
The 5-digit verification code received in the registration email.
Example
Response
200 — VerifiedConfirmation message.
true on successful verification.| HTTP status | Condition |
|---|---|
203 | Code does not match the stored login_code, or the email was not found. |
POST /api/user/login
Authenticate a verified user and receive a JWT valid for 365 days. The token must be included in theaccess-token header for all protected routes.
Login will be rejected with a
403 if the account has not yet been verified through /api/user/verify-accounts.Request
The user’s registered email address.
The user’s plain-text password (compared against the bcrypt hash).
Example
Response
200 — AuthenticatedSigned JWT. Pass this value in the
access-token header on every protected request.Snapshot of the authenticated user’s profile.
| HTTP status | Condition |
|---|---|
203 | Email not found in the database, or password is incorrect. |
403 | Account has not been activated via the verification code. |
POST /api/user/logout
Invalidate the current session by clearing the stored JWT token on the user document. The client should also discard the token locally after calling this endpoint.Request
The email address of the account to log out.
Example
Response
200 — Logged outFarewell message.
true on success.| HTTP status | Condition |
|---|---|
404 | No user with that email address was found. |
Password Recovery
The password recovery flow is a two-step process: first request a reset code, then submit that code alongside the new password. Neither step requires an active session — however,recovery-pass does require a valid access-token header.
POST /api/user/recovery-pass
Initiate a password reset. Generates a 5-digit code, saves it to the user record ascode_newpass, and dispatches it to the user’s email address.
This is the only auth-adjacent endpoint that requires the
access-token header.Request
Headers| Header | Value |
|---|---|
access-token | Valid JWT from login |
The email address of the account for which to initiate a password reset.
Example
Response
200 — Code sentConfirmation that the code was dispatched.
true on success.| HTTP status | Condition |
|---|---|
203 | No account found for the supplied email address. |
POST /api/user/update-password
Complete a password reset using the 5-digit code received via email. This endpoint does not require anaccess-token header — it is designed to be used when the user is locked out.
Request
The email address of the account being reset.
The 5-digit code received in the password-recovery email.
The desired new password. Will be hashed with bcrypt before storage.
Example
Response
200 — Password updatedConfirmation message.
true on success.| HTTP status | Condition |
|---|---|
404 | No account found for the supplied email. |
400 | The submitted code does not match the stored code_newpass. |