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

ParameterTypeDescription
userIdstringPath parameter

Error Responses

Status CodeError CodeDescription
401HTTP_401Unauthorized
404HTTP_404Not Found
403HTTP_403Forbidden
404HTTP_404Not Found
500HTTP_500Internal Server Error
500HTTP_500Internal 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"