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 Code | Error Code | Description |
|---|---|---|
| 401 | HTTP_401 | Unauthorized |
| 404 | HTTP_404 | Not Found |
| 403 | HTTP_403 | Forbidden |
| 400 | HTTP_400 | Bad Request |
| 400 | HTTP_400 | Bad Request |
| 400 | HTTP_400 | Bad Request |
| 500 | HTTP_500 | Internal 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 '{}'