POST /progress/:activityId
POST /progress/:activityId
Validation schema for updating progress SCORM-specific fields GET /api/progress/[activityId] - Get progress for an activity Verify authentication with Clerk Get user's profile to get Supabase id Fetch progress for this activity POST /api/progress/[activityId] - Update progress for an activity Verify authentication with Clerk Get user's profile to get Supabase id and tenant_id Parse and validate request body Get the activity to find the course_id Check if progress record already exists Set status if provided Keep existing status if not provided Default to not_started if creating new record Set timestamps based on status Preserve existing tracking_data if time_spent_seconds not provided Handle SCORM-specific fields Update existing progress Create new progress record If activity was completed, recalculate enrollment progress Get enrollment for this user and course Call the calculate_enrollment_progress function
Endpoint
POST /progress/:activityId
Authentication
This endpoint requires authentication. Include your authentication token in the request headers.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
activityId | string | Path parameter |
Error Responses
| Status Code | Error Code | Description |
|---|---|---|
| 401 | HTTP_401 | Unauthorized |
| 404 | HTTP_404 | Not Found |
| 500 | HTTP_500 | Internal Server Error |
| 500 | HTTP_500 | Internal Server Error |
| 401 | HTTP_401 | Unauthorized |
| 404 | HTTP_404 | Not Found |
| 400 | HTTP_400 | Bad Request |
| 404 | HTTP_404 | Not Found |
| 404 | HTTP_404 | Not Found |
| 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/progress/activityId-value" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'