Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/luiss811/Backend-Airguide/llms.txt

Use this file to discover all available pages before exploring further.

Logging in to AirGuide is a two-step process. In step 1, you submit your credentials to POST /api/auth/login. If your email and password are correct and your account is active, the server sends a 6-digit OTP to your registered email. You then proceed to step 2 — verify the OTP to receive a JWT token.

Endpoint

POST /api/auth/login

Request body

correo
string
required
Your registered email address.
password
string
required
Your account password.

Response

A 200 OK response indicating that an OTP has been dispatched:
requiresTwoFactor
boolean
Always true. Proceed to /api/auth/verify-2fa with the OTP from your email.
correo
string
The email address the OTP was sent to. Use this value when calling /api/auth/verify-2fa.
message
string
"Código de verificación enviado a tu correo electrónico."

Example

curl -X POST https://your-api.example.com/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "correo": "estudiante@universidad.edu",
    "password": "MySecurePassword1!"
  }'
Your account must have estado: "activo" to log in. Accounts that are still "pendiente" (awaiting admin approval) or "rechazado" receive a 403 Forbidden response with the message "Tu cuenta aún no ha sido validada. Por favor contacta al administrador." Contact your administrator to activate your account.

What to do next

Check your inbox for a 6-digit OTP code and proceed to POST /api/auth/verify-2fa. Pass the correo value from this response along with the codigo from your email to complete login and receive your JWT token. See Verify 2FA OTP and receive a JWT token for the next step.

Build docs developers (and LLMs) love