PATCH /api/v1/unit-offerings/{id}

Update an existing unit offering. Can modify lecturer, semester, code, outline, or other properties. Cannot update if there are conflicts.

Path parameters

  • id string Required

    Unit offering ID

application/json

Body Required

  • unitVersionId string

    Update the unit version this offering is based on

  • courseIntakeId string

    Course intake ID (links to cohort intake)

  • lecturerId string

    Lecturer assigned to teach this unit offering

  • semesterId string

    Semester when this unit is offered

  • Code string

    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

  • 200 application/json

    Unit offering updated successfully

    Hide response attributes Show response attributes object
    • message string Required

      Response message

    • offering object Required

      Updated 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 update data

  • 401

    Authentication required

  • 403

    Admin or Lecturer privileges required

  • 404 application/json

    Unit offering or related entity not found

  • 409 application/json

    Unit offering code conflicts with existing offering

PATCH /api/v1/unit-offerings/{id}
curl \
 --request PATCH 'http://localhost:3500/api/v1/unit-offerings/unit-offering-uuid' \
 --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 (200)
{
  "message": "Unit offering updated successfully",
  "success": true,
  "offering": {
    "id": "offering-uuid",
    "Code": "CS101-2024-1-UPDATED",
    "updatedAt": "2024-09-15T14:30:00Z",
    "lecturerId": "new-lecturer-uuid",
    "personalizedOutline": "Updated outline with new topics"
  }
}
Response examples (400)
{
  "error": "Bad Request",
  "message": "Failed to update unit offering",
  "statusCode": 400
}
Response examples (404)
{
  "error": "Not Found",
  "message": "Unit offering not found",
  "statusCode": 404
}
Response examples (409)
{
  "error": "Conflict",
  "message": "Unit offering with code 'CS101-2024-1' already exists",
  "statusCode": 409
}