GET /api/users/{user_id}
Returns the full profile for a single user. Administrators can retrieve any user. Non-admin users can only retrieve their own profile — requests for another user’s ID will receive a 403 Forbidden response.
Authentication
Requires a valid Bearer access token.
Authorization : Bearer <access_token>
Path Parameters
The ID of the user to retrieve.
Response
true when the request succeeds.
Unique identifier for the user.
The user’s unique username.
The user’s email address.
Concatenation of first_name and last_name. Falls back to username if names are not set.
Whether the user account is currently active.
Role name. Either admin or user.
Human-readable description of the role.
ISO 8601 timestamp of when the user was created.
ISO 8601 timestamp of the last update to the user record.
Errors
Status Description 401Missing or invalid access token. 403The authenticated user is not an admin and is requesting a different user’s profile. 404No user exists with the given user_id.
Example
curl -X GET "https://task-forge-gbd6h8gtg8hchve9.chilecentral-01.azurewebsites.net/api/users/42" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
{
"success" : true ,
"data" : {
"id" : 42 ,
"username" : "jdoe" ,
"email" : "[email protected] " ,
"first_name" : "John" ,
"last_name" : "Doe" ,
"full_name" : "John Doe" ,
"is_active" : true ,
"role" : {
"id" : 2 ,
"name" : "user" ,
"description" : "Standard user"
},
"created_at" : "2024-01-15T10:30:00" ,
"updated_at" : "2024-03-01T08:12:45"
}
}