Archive or unarchive a course
PATCH/api/courses/:id/archive
Toggles a course's archived state. Both archiving and un-archiving are admin-only: freezing a course (or reopening a frozen one to edits) is a privileged action. Archiving also runs a safety check (canArchiveCourse) using the course's stored dates rather than any client value, to avoid timezone drift deciding whether a course has really ended.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 500
The updated course (id, name, code, isArchived, updatedAt).
isArchived must be a boolean.
Not signed in.
Not an admin, or archiving is blocked by the safety check.
Course not found.
Server error.