DELETE /enrollments/:enrollmentId
DELETE /enrollments/:enrollmentId
GET /api/enrollments/[enrollmentId] - Get a single enrollment Check authentication with Clerk Get user's profile Fetch the enrollment with course details Check access permissions PATCH /api/enrollments/[enrollmentId] - Update an enrollment Check authentication with Clerk Get user's profile Fetch the existing enrollment Check permissions Parse request body Build update object Learners can only update last_accessed_at Only admins can change enrollment status Update the enrollment DELETE /api/enrollments/[enrollmentId] - Drop/delete an enrollment Check authentication with Clerk Get user's profile Fetch the existing enrollment Check permissions Learners can drop (set status to 'dropped'), admins can hard delete Hard delete for admins Soft delete (drop) for learners
Endpoint
DELETE /enrollments/:enrollmentId
Authentication
This endpoint requires authentication. Include your authentication token in the request headers.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
enrollmentId | string | Path parameter |
Error Responses
| Status Code | Error Code | Description |
|---|---|---|
| 401 | HTTP_401 | Unauthorized |
| 404 | HTTP_404 | Not Found |
| 404 | HTTP_404 | Not Found |
| 403 | HTTP_403 | Forbidden |
| 500 | HTTP_500 | Internal Server Error |
| 401 | HTTP_401 | Unauthorized |
| 404 | HTTP_404 | Not Found |
| 404 | HTTP_404 | Not Found |
| 403 | HTTP_403 | Forbidden |
| 403 | HTTP_403 | Forbidden |
| 400 | HTTP_400 | Bad Request |
| 500 | HTTP_500 | Internal Server Error |
| 500 | HTTP_500 | Internal Server Error |
| 401 | HTTP_401 | Unauthorized |
| 404 | HTTP_404 | Not Found |
| 404 | HTTP_404 | Not Found |
| 403 | HTTP_403 | Forbidden |
| 500 | HTTP_500 | Internal Server Error |
| 500 | HTTP_500 | Internal Server Error |
| 500 | HTTP_500 | Internal Server Error |
Example Request
curl -X DELETE "https://api.allurelms.com/enrollments/enrollmentId-value" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"