Skip to main content
GET
/
api
/
Usuario
/
mi-perfil
curl --request GET \
  --url https://your-api-host/api/Usuario/mi-perfil \
  --header 'Authorization: Bearer <token>'
{
  "exito": true,
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "userName": "admin",
    "nombrePerfil": "Administrador Master",
    "imagen": "https://res.cloudinary.com/demo/image/upload/v1/usuarios/admin.jpg",
    "activo": true
  }
}
Returns profile information for the user associated with the current Bearer token. No path parameters are required — the identity is read directly from the JWT claims.

Authentication

Requires a valid Bearer token. The response reflects the user identity encoded in the token itself.
Authorization: Bearer <token>
Use this endpoint to populate user profile UI (avatar, display name, active status) without needing to store the user’s ID separately — the token is sufficient.

Response fields

exito
boolean
required
true when the request succeeds and a valid session is found.
data
object
required
The authenticated user’s profile.

Examples

curl --request GET \
  --url https://your-api-host/api/Usuario/mi-perfil \
  --header 'Authorization: Bearer <token>'
{
  "exito": true,
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "userName": "admin",
    "nombrePerfil": "Administrador Master",
    "imagen": "https://res.cloudinary.com/demo/image/upload/v1/usuarios/admin.jpg",
    "activo": true
  }
}

Error conditions

StatusCause
401 UnauthorizedThe token is missing, expired, or does not correspond to a valid user.
Unlike most 401 responses, this endpoint returns a structured JSON body: { "exito": false, "mensaje": "No hay una sesión activa." }. This is useful for detecting session expiry on the client side.

Build docs developers (and LLMs) love