Skip to main content
GET
/
api
/
auth
/
profile
Get Profile
curl --request GET \
  --url https://api.example.com/api/auth/profile \
  --header 'Authorization: <authorization>'
{
  "success": true,
  "message": "<string>",
  "data": {
    "user": {
      "_id": "<string>",
      "name": "<string>",
      "email": "<string>",
      "role": "<string>",
      "isActive": true,
      "lastLogin": "<string>",
      "createdAt": "<string>",
      "updatedAt": "<string>"
    }
  }
}
Retrieves the profile information for the currently authenticated user.

Authentication

Authorization
string
required
Bearer token obtained from login or register endpoints.Format: Bearer {token}
This endpoint requires authentication. Include the JWT token in the Authorization header.

Response

success
boolean
Indicates if the request was successful
message
string
Success message: “Perfil obtenido exitosamente”
data
object
user
object
_id
string
Unique user identifier
name
string
User’s full name
email
string
User’s email address
role
string
User’s role. Possible values: “user”, “admin”, “system”
isActive
boolean
Whether the user account is active
lastLogin
string
ISO 8601 timestamp of last login
createdAt
string
ISO 8601 timestamp of account creation
updatedAt
string
ISO 8601 timestamp of last update

Error Responses

401 - Token Expired
{
  "success": false,
  "message": "Token expirado"
}
401 - Invalid Token
{
  "success": false,
  "message": "Token inválido"
}
401 - No Token Provided
{
  "success": false,
  "message": "No se proporcionó token de autenticación"
}
404 - User Not Found
{
  "success": false,
  "message": "Usuario no encontrado"
}
Returned when the user account has been deleted or deactivated.

Examples

curl -X GET https://api.cuido.com/api/auth/profile \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Response Example

{
  "success": true,
  "message": "Perfil obtenido exitosamente",
  "data": {
    "user": {
      "_id": "507f1f77bcf86cd799439011",
      "name": "Juan Pérez",
      "email": "[email protected]",
      "role": "user",
      "isActive": true,
      "lastLogin": "2026-03-05T10:35:00.000Z",
      "createdAt": "2026-03-05T10:30:00.000Z",
      "updatedAt": "2026-03-05T10:35:00.000Z"
    }
  }
}

Notes

  • The password field is never returned in the response for security reasons
  • The user ID is extracted from the JWT token payload
  • Tokens expire after 7 days. After expiration, the user must log in again to obtain a new token

Build docs developers (and LLMs) love