POST /api/v1/unit-offerings

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.

application/json

Body Required

  • unitVersionId string Required

    Unit version ID that this offering is based on

  • courseIntakeId string Required

    Course intake ID (links to cohort intake)

  • lecturerId string Required

    Lecturer assigned to teach this unit offering

  • semesterId string Required

    Semester when this unit is offered

  • Code string Required

    Unique code for this unit offering (e.g., CS101-2024-1)

  • personalizedOutline string

    Customized outline for this specific offering

  • studentGroupingsEnabled boolean

    Whether to enable student groupings for collaborative work

    Default value is false.

Responses

  • 201 application/json

    Unit offering created successfully

    Hide response attributes Show response attributes object
    • message string Required

      Response message

    • offering object Required

      Created unit offering

      Hide offering attributes Show offering attributes object
      • id string Required

        Unit offering ID

      • Code string Required

        Unit offering code

      • unitVersionId string Required

        Unit version ID

      • courseIntakeId string Required

        Course intake ID

      • lecturerId string Required

        Lecturer ID

      • semesterId string Required

        Semester ID

      • personalizedOutline string

        Personalized outline

      • studentGroupingsEnabled boolean Required

        Whether student groupings are enabled

      • createdAt string Required

        Creation timestamp

      • updatedAt string Required

        Last update timestamp

  • 400 application/json

    Invalid input data or validation errors

  • 401 application/json

    Authentication required

  • 403 application/json

    Admin or Lecturer privileges required

  • 404 application/json

    Related entity not found (unit version, course intake, lecturer, or semester)

  • 409 application/json

    Unit offering code already exists

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
}