Skip to main content

GET /api/auth/profile

Returns the profile of the currently authenticated user based on the JWT token provided in the request. Authentication: Required Required role: Any authenticated user

Request

Headers

HeaderValueRequired
AuthorizationBearer <token>Yes

Response

Success (200)

id
string
Unique user identifier (e.g. usr_1234567890).
nombre
string
The user’s full name.
nombre_usuario
string
The user’s login name.
rol
string
The user’s role. One of admin or cajero.

Error responses

StatusDescription
401Unauthorized — token missing, invalid, or expired

Example

curl http://localhost:3000/api/auth/profile \
  -H "Authorization: Bearer $TOKEN"
{
  "id": "usr_1234567890",
  "nombre": "Administrador",
  "nombre_usuario": "admin",
  "rol": "admin"
}

Build docs developers (and LLMs) love