Skip to main content

Endpoint

GET /api/profiles/:id

Description

Retrieves a specific user profile based on the provided user ID. Users can access their own profile, while administrators can access any profile. See implementation in server/src/modules/profiles/profiles.controller.ts:26-40.

Authentication

This endpoint requires Bearer token authentication. Include your access token in the Authorization header.

Path Parameters

id
string
required
The unique identifier of the user whose profile you want to retrieve.Example: abc123

Response

id
string
Unique identifier for the user
email
string
User’s email address
full_name
string
User’s full name
role
string
User role: USER or ADMIN
is_active
boolean
Whether the user account is active
birth_date
string
User’s date of birth in ISO 8601 format (YYYY-MM-DD)
is_profile_complete
boolean
Whether the user has completed their profile setup
created_at
string
Timestamp when the profile was created

Success Response (200)

{
  "id": "abc123",
  "email": "[email protected]",
  "full_name": "Dr. Jane Smith",
  "role": "ADMIN",
  "is_active": true,
  "birth_date": "1985-03-15",
  "is_profile_complete": true,
  "created_at": "2024-01-15T10:30:00.000Z"
}

Error Responses

401 Unauthorized

{
  "statusCode": 401,
  "message": "Token inválido o expirado",
  "error": "Unauthorized"
}
Missing or invalid Bearer token.

404 Not Found

{
  "statusCode": 404,
  "message": "Perfil no encontrado.",
  "error": "Not Found"
}
No profile exists for the specified user ID.

Code Examples

curl -X GET https://api.zenda.com/api/profiles/abc123 \
  -H "Authorization: Bearer YOUR_TOKEN"

Use Cases

  • Display user profile information in dashboard
  • Verify user details before processing reservations
  • Show patient information to professionals
  • Check profile completion status
  • Retrieve user role for permission checks

Profile Completion

The is_profile_complete field indicates whether the user has finished setting up their profile. This is useful for:
  • Prompting users to complete required fields
  • Restricting access to certain features until profile is complete
  • Tracking onboarding progress

Get All Profiles

Retrieve all profiles (admin only)

Update Profile

Update profile information

Authentication

Learn about API authentication

Build docs developers (and LLMs) love