Delete a course
DELETE/api/courses/:id
Deletes a course (system admin only). An empty course (no assignments, no problems, no student enrollments, and no submissions) is removed permanently (its staff-only roster cascades away; audit logs keep a nulled course pointer). Any course that holds real work or students is soft-deleted instead: the row and all its data are retained but deletedAt is stamped so the access gates and list queries treat it as gone (recoverable later). The response says which happened via { deleted: 'hard' | 'soft' }.
Auth: requires FACULTY / TA / STUDENT
Request
Responses
- 200
- 401
- 403
- 404
- 500
Course deleted; body reports whether it was a hard or soft delete.
Not signed in.
Not a system admin (logged as a security event).
Course not found.
Server error.