GET /reports/learner/:userId
GET /reports/learner/:userId
GET /api/reports/learner/[userId] - Comprehensive learner report (Admin only) Verify authentication with Clerk Get current user's profile to check role and tenant Only admins can view learner reports Get the learner's profile Ensure same tenant Get all enrollments for this learner Get all activity progress for this learner Calculate aggregate statistics Calculate total activities completed Calculate average score across all assessments Calculate total time spent (if tracking_data has time_spent_seconds) Convert to hours Build course details with progress Get course average score
Endpoint
GET /reports/learner/:userId
Authentication
This endpoint requires authentication. Include your authentication token in the request headers.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
userId | string | Path parameter |
Error Responses
| Status Code | Error Code | Description |
|---|---|---|
| 401 | HTTP_401 | Unauthorized |
| 404 | HTTP_404 | Not Found |
| 403 | HTTP_403 | Forbidden |
| 404 | HTTP_404 | Not Found |
| 500 | HTTP_500 | Internal Server Error |
| 500 | HTTP_500 | Internal Server Error |
Example Request
curl -X GET "https://api.allurelms.com/reports/learner/userId-value" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"