POST /scorm/packages/cleanup

POST /scorm/packages/cleanup

Use production SCORM API URL - can be overridden with env var for local development localhost:3001'; OPTIONS /api/scorm/packages/cleanup - Handle CORS preflight GET /api/scorm/packages/cleanup - Health check endpoint POST /api/scorm/packages/cleanup - Delete single package or all packages Verify authentication with Clerk Get user profile for permission checking Check if user is admin (only admins can delete packages) Parse request body Handle single package deletion Validate package ID format (UUID) Verify package exists and belongs to tenant Handle bulk cleanup (existing behavior) Require explicit confirmation Fetch all packages for this tenant from SCORM API Fallback: try querying scorm_packages table directly Fallback: try querying scorm_packages table directly Delete each package Try DELETE first Fallback to POST action=delete (some deployments only allow POST)

Endpoint

POST /scorm/packages/cleanup

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
400HTTP_400Bad Request
400HTTP_400Bad Request
400HTTP_400Bad Request
500HTTP_500Internal Server Error

Example Request

curl -X POST "https://api.allurelms.com/scorm/packages/cleanup" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'