GET /reports/course/:courseId/completion

GET /reports/course/:courseId/completion

GET /api/reports/course/[courseId]/completion Verify authentication with Clerk Get user's profile to determine role and tenant Verify user has access (instructor or admin) Fetch the course Role-based access: instructors can only see their own courses Parse optional query parameters Get all enrollments for this course Apply date filters if provided Calculate statistics Calculate average completion time (in hours) Convert ms to hours Get activity progress for score calculation Calculate average score across all assessments Build learner details array Get user's average score for this course Round to 2 decimal places Round to 2 decimal places Round to 2 decimal places

Endpoint

GET /reports/course/:courseId/completion

Authentication

This endpoint requires authentication. Include your authentication token in the request headers.

Path Parameters

ParameterTypeDescription
courseIdstringPath parameter

Query Parameters

ParameterTypeDescription
dateFromstringQuery parameter
dateTostringQuery parameter
statusstringQuery parameter

Error Responses

Status CodeError CodeDescription
401HTTP_401Unauthorized
404HTTP_404Not Found
403HTTP_403Forbidden
404HTTP_404Not Found
403HTTP_403Forbidden
500HTTP_500Internal Server Error
500HTTP_500Internal Server Error

Example Request

curl -X GET "https://api.allurelms.com/reports/course/courseId-value/completion" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"