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

ParameterTypeDescription
activityIdstringPath parameter

Error Responses

Status CodeError CodeDescription
401HTTP_401Unauthorized
404HTTP_404Not Found
500HTTP_500Internal Server Error
500HTTP_500Internal Server Error
401HTTP_401Unauthorized
404HTTP_404Not Found
400HTTP_400Bad Request
404HTTP_404Not Found
404HTTP_404Not Found
500HTTP_500Internal Server Error
500HTTP_500Internal Server Error
500HTTP_500Internal 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 '{}'