GET /scorm/packages/usage

GET /scorm/packages/usage

GET /api/scorm/packages/usage - Get SCORM packages with usage information Verify authentication with Clerk Get user profile for permission checking Check if user is admin (only admins can view usage information) Fetch all SCORM packages for this tenant from SCORM API localhost:3001'; If SCORM API is unavailable, try querying scorm_packages table directly as fallback Fallback: try querying scorm_packages table directly For each package, find activities that use it Find activities that reference this package Get all SCORM activities and filter in code (JSONB queries can be tricky) Filter activities that use this package Extract unique courses from activities Calculate totals

Endpoint

GET /scorm/packages/usage

Authentication

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

Error Responses

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

Example Request

curl -X GET "https://api.allurelms.com/scorm/packages/usage" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"