POST /scorm/packages/process
POST /scorm/packages/process
Supabase Storage bucket name (fallback) Request validation schema 5 minutes for processing Verify authentication with Clerk Use service role client to bypass RLS for profile lookup Get user profile for tenant_id Check if user has permission to upload SCORM packages Check for explicit permissions Parse and validate request body Verify tenant_id matches user's tenant Download the uploaded file from storage (R2 or Supabase) Try R2 first if configured Convert Buffer to ArrayBuffer Fall back to Supabase Storage if R2 download fails Use Supabase Storage Validate file type Cleanup: delete uploaded file Parse SCORM manifest Cleanup: delete uploaded file on parse failure Extract SCORM package to storage , '').replace(/.zip$/, ''); Cleanup: delete uploaded ZIP file Get public URL for the extracted package Use content proxy URL ${process.env.VERCEL_URL}` : 'https://scorm-api.allurelms.com'); Get public URL for the uploaded ZIP (manifest) Use content proxy for R2 files Insert package record into database Cleanup: delete uploaded ZIP and extracted files
Endpoint
POST /scorm/packages/process
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 |
| 403 | HTTP_403 | Forbidden |
| 404 | HTTP_404 | Not Found |
| 404 | HTTP_404 | Not Found |
| 400 | HTTP_400 | Bad Request |
| 400 | HTTP_400 | Bad Request |
| 500 | HTTP_500 | Internal Server Error |
| 500 | HTTP_500 | Internal Server Error |
| 500 | HTTP_500 | Internal Server Error |
Example Request
curl -X POST "https://api.allurelms.com/scorm/packages/process" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'