Debuta uses JSON Web Tokens (JWT) for session management. Local (email + password) accounts authenticate throughDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/desarrolladorandres2026-gif/Native-tailwind/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/login, which returns a signed token valid for 7 days. Every subsequent request to a protected route must include that token in the Authorization header. Use GET /api/me at any time to exchange a valid token for the full user profile — it’s the canonical way to rehydrate a session on app launch.
Social sign-in (Google, Facebook) uses a separate flow. See Social Auth for those endpoints. Accounts created via Google or Facebook cannot authenticate through
POST /api/login.POST /api/login
Authenticates a user with their email address and password, returning a JWT access token and the serialized user object. Auth required: NoRequest body
The user’s registered email address. Case-insensitive.
The user’s plaintext password. Minimum 6 characters. Compared against the bcrypt hash stored in the database.
Response — 200 OK
Signed JWT. Valid for 7 days (controlled by the
JWT_EXPIRES_IN environment variable). Pass this in every authenticated request as Authorization: Bearer <token>.The authenticated user’s serialized profile. See UserObject fields below.
Error responses
| Status | Condition |
|---|---|
400 | correo or password missing from the request body |
401 | Wrong email or password |
401 | Account was created with Google or Facebook — use social auth |
401 | Account is deactivated (activo: false) |
500 | Internal server error |
curl example
GET /api/me
Returns the full profile of the currently authenticated user. The mobile app calls this endpoint on startup to restore the session from a stored token. Auth required: Yes —Authorization: Bearer <token>
Response — 200 OK
The full user profile. See UserObject fields below.
Error responses
| Status | Condition |
|---|---|
401 | Missing, malformed, or expired JWT |
500 | Internal server error |
curl example
UserObject fields
Theusuario object returned by both endpoints is produced by serializarUsuario(). It strips password and __v, and always includes a top-level id string alongside Mongoose’s _id.
MongoDB ObjectId as a string. Canonical user identifier.
Unique, lowercase handle. Auto-generated at registration from the user’s first name plus a 4-digit suffix (e.g.
ana_garcia1042).User’s first name.
User’s last name. May be an empty string for social auth accounts that didn’t provide it.
Email address. Always lowercase.
One of:
masculino, femenino, no_binario, otro, prefiero_no_decir.Date of birth. Use the virtual
age field for a pre-computed integer age.Virtual field. Computed integer age in years from
birth_date.Free-text profile bio. Max 500 characters.
Main profile photo from Cloudinary:
{ url: string, public_id: string }.Cover / banner photo from Cloudinary:
{ url: string, public_id: string }.Gallery of up to 6 additional photos. Each item:
{ url: string, public_id: string }.Array of interest objects:
{ name: string, icon: string }.true if the account has been verified (facial photo submitted or OAuth provider verified the email).true for newly created OAuth accounts that haven’t set gender or birth_date yet. The app should redirect these users to a profile completion screen.Account role:
user, admin, or asociado.false means the account has been deactivated and cannot log in.Job title (e.g.
"Diseñadora UX"). Max 100 characters.Employer name. Max 100 characters.
Educational institution. Max 150 characters.
One of:
single, in_relationship, married, complicated, prefer_not_say, or empty string.Personal website URL. Max 200 characters.
What the user is looking for:
amistad, citas, serio, casual, no_lo_se, or empty string.User’s religion. Free-text.
Zodiac sign. Free-text.
Smoking habit:
si, no, socialmente, ocasionalmente, or empty string.Drinking habit:
si, no, socialmente, ocasionalmente, or empty string.Array of language strings (e.g.
["Español", "Inglés"]).Height in centimetres.
Exercise frequency:
siempre, a_veces, nunca, or empty string.City name (e.g.
"Ciudad de México").Country name (e.g.
"México").Human-readable location label (e.g.
"CDMX, México").GPS latitude. Used for distance-based discovery.
GPS longitude.
Authentication method:
local, google, or facebook.User’s discovery and privacy preferences. See Settings API for the full schema.
Account creation timestamp.
Last update timestamp.