Get Current User Profile
Employees
Get Current User Profile
Retrieve the authenticated user’s employee profile with clinic, role, vacation, and request statistics
GET
Get Current User Profile
Overview
This endpoint returns the complete profile information for the currently authenticated user. The system automatically links Azure AD accounts with employee records using either the Azure OID or email address.Authentication Required
This endpoint requires a valid JWT token from Azure AD authentication.
Authentication Flow
The endpoint performs a two-step lookup:- Azure OID Lookup: First attempts to find the employee by their Azure Object ID (
azure_oid) - Email Fallback: If not found by OID, searches by email address and automatically links the Azure OID (Just-in-Time provisioning)
- Access Denied: If the user doesn’t exist in the employee database, returns 403
Request
Headers
Bearer token from Azure AD authentication
Response
Unique employee identifier
Employee’s full name
Employee’s national ID number
Employee’s email address
Employee’s phone number
Employee’s physical address
Date the employee joined (format: YYYY-MM-DD)
Date the employee left (null if currently active)
Employee’s job position/title
URL or path to profile image
Azure AD Object ID for integration
Foreign key to employee role
Foreign key to employee status
Foreign key to assigned clinic
Foreign key to department/area
Total number of requests submitted by this employee
Number of pending requests awaiting approval
Array of vacation records for the employee
Response Example
Error Handling
403 Forbidden
User authenticated in Azure AD but not registered in the employee database
500 Internal Error
Database connection issues or unexpected server errors
Just-in-Time Provisioning
When an employee authenticates for the first time:- System checks for existing
azure_oidmatch - If not found, searches by email in employee database
- If found by email, automatically updates the employee record with their
azure_oid - Future requests use the linked
azure_oidfor faster lookups