This is step two of the AirGuide login flow. After a successful call to POST /api/auth/login, the user receives a one-time code by email. Submit that code here along with the email address to receive a JWT bearer token. Include the token in theDocumentation 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.
Authorization header of every subsequent authenticated request.
POST /api/auth/verify-2fa
Verifies the OTP against the database. The code must be unused and must not have expired. On success, the OTP is marked as consumed, an access log entry is created, and a signed JWT is returned.Request body
The email address used during the login step.
The one-time code received in the verification email.
Response — 200 OK
A signed JWT bearer token. Include this value in the
Authorization header as Bearer <token> for all authenticated endpoints.The authenticated user record.
Error responses
| Status | Body | Cause |
|---|---|---|
401 | { "error": "Código incorrecto o expirado. Solicita uno nuevo." } | OTP not found, already used, or past its expiry time. |
401 | { "error": "Usuario no encontrado" } | No account matches the provided correo. |
400 | { "error": "Correo y código son requeridos" } | Either correo or codigo is missing from the request body. |
Example
Using the token in subsequent requests
Pass the JWT in theAuthorization header on every request that requires authentication:
