Create a new unit offering by linking a unit version to a course intake, lecturer, and semester. This creates the actual teaching instance of a unit.
Body
Required
-
Unit version ID that this offering is based on
-
Course intake ID (links to cohort intake)
-
Lecturer assigned to teach this unit offering
-
Semester when this unit is offered
-
Unique code for this unit offering (e.g., CS101-2024-1)
-
Customized outline for this specific offering
-
Whether to enable student groupings for collaborative work
Default value is
false.
POST
/api/v1/unit-offerings
curl \
--request POST 'http://localhost:3500/api/v1/unit-offerings' \
--header "Content-Type: application/json" \
--data '{"unitVersionId":"uuid-string-here","courseIntakeId":"uuid-string-here","lecturerId":"uuid-string-here","semesterId":"uuid-string-here","Code":"CS101-2024-1","personalizedOutline":"Modified outline with additional topics...","studentGroupingsEnabled":false}'
Request examples
{
"unitVersionId": "uuid-string-here",
"courseIntakeId": "uuid-string-here",
"lecturerId": "uuid-string-here",
"semesterId": "uuid-string-here",
"Code": "CS101-2024-1",
"personalizedOutline": "Modified outline with additional topics...",
"studentGroupingsEnabled": false
}
Response examples (201)
{
"message": "Unit offering created successfully",
"success": true,
"offering": {
"id": "unit-offering-uuid",
"Code": "CS101-2024-1",
"createdAt": "2024-09-01T10:00:00Z",
"updatedAt": "2024-09-01T10:00:00Z",
"examsCount": 0,
"lecturerId": "lecturer-uuid",
"semesterId": "semester-uuid",
"topicsCount": 0,
"studentsCount": 0,
"unitVersionId": "version-uuid",
"courseIntakeId": "intake-uuid",
"assignmentsCount": 0,
"personalizedOutline": "Custom outline for this semester",
"studentGroupingsEnabled": false
}
}
Response examples (400)
{
"error": "Bad Request",
"message": [
"unitVersionId must be a UUID",
"Code should not be empty",
"lecturerId must be a valid UUID"
],
"statusCode": 400
}
Response examples (401)
{
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 401
}
Response examples (403)
{
"error": "Forbidden",
"message": "Insufficient permissions",
"statusCode": 403
}
Response examples (404)
{
"error": "Not Found",
"message": "Unit version not found",
"statusCode": 404
}
Response examples (409)
{
"error": "Conflict",
"message": "Unit offering with code 'CS101-2024-1' already exists",
"statusCode": 409
}