PATCH /classes/{classId}/periods/{id}

Updates an existing schedule period for a class.

Path parameters

  • classId string Required

    The class ID

  • id string Required

    The period ID

application/json

Body Required

  • id string

    ID of the period to update

  • classId string | null

    ID of the class

  • date string(date) | null

    Date of the period

  • startTime string(time) | null

    Start time

  • endTime string(time) | null

    End time

  • location string | null

    Location of the period

Responses

  • 200 application/json

    Period updated successfully

    Hide response attributes Show response attributes object
    • success boolean
    • code integer(int32)
    • message string
    • data object

      Schedule period representing a scheduled event or class period on a specific date (non-recurring)

      Hide data attributes Show data attributes object
      • id string

        Unique identifier for the period

      • classId string

        ID of the class

      • name string

        Name of the period or event

      • subject string

        Subject code being taught

      • date string(date)

        Date of the period (YYYY-MM-DD)

      • startTime string(time) | null

        Start time of the period (HH:mm)

      • endTime string(time) | null

        End time of the period (HH:mm)

      • category string

        Category of the period

        Values are assignment, exam, fieldTrip, meeting, holiday, presentation, or other.

      • location string | null

        Location of the period

      • description string | null

        Description of the period

      • isActive boolean

        Whether the period is active

      • lessons array[object] | null

        Lesson plan object representing a detailed plan for teaching or assignment

        Hide lessons attributes Show lessons attributes object
        • id string Required

          Unique identifier for the lesson

        • classId string Required

          ID of the class

        • authorId string Required

          ID of the teacher/author

        • title string Required

          Title of the lesson

          Maximum length is 200.

        • subject string | null

          Subject code (e.g., Math-1)

        • content string Required

          Lesson content or instructions

        • type string

          Type of lesson

          Values are assignment, material, lecture, or quiz.

        • status string

          Status of the lesson

          Values are draft, published, or archived.

        • learningObjectives array[object] | null

          Array of learning objectives

          Hide learningObjectives attributes Show learningObjectives attributes object
          • description string
          • type string
          • isAchieved boolean
          • notes string | null
        • lessonPlan string | null

          Private teacher notes/plan (not visible to students)

        • maxPoints integer | null

          Maximum points for assignments

        • dueDate string(date-time) | null

          Due date for assignments

        • createdAt string(date-time)

          Timestamp when the lesson was created

        • updatedAt string(date-time)

          Timestamp when the lesson was last updated

      • createdAt string(date-time)

        Timestamp when the period was created

      • updatedAt string(date-time)

        Timestamp when the period was last updated

  • 400 application/json

    Bad Request - Invalid input data

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 404 application/json

    Period not found

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
PATCH /classes/{classId}/periods/{id}
curl \
 --request PATCH 'https://api.huy-devops.site/api/classes/{classId}/periods/{id}' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"id":"period_123456","classId":"string","date":"2026-05-04","startTime":"09:42:00Z","endTime":"09:42:00Z","location":"string"}'
Request examples
{
  "id": "period_123456",
  "classId": "string",
  "date": "2026-05-04",
  "startTime": "09:42:00Z",
  "endTime": "09:42:00Z",
  "location": "string"
}
Response examples (200)
{
  "success": true,
  "code": 200,
  "message": "string",
  "data": {
    "id": "period_123456",
    "classId": "cls_123456",
    "name": "Math Period 1",
    "subject": "MATH101",
    "date": "2024-09-20",
    "startTime": "07:00",
    "endTime": "08:00",
    "category": "assignment",
    "location": "Room 101",
    "description": "Regular math class",
    "isActive": true,
    "lessons": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440005",
        "classId": "550e8400-e29b-41d4-a716-446655440000",
        "authorId": "550e8400-e29b-41d4-a716-446655440001",
        "title": "Quadratic Equations",
        "subject": "MATH101",
        "content": "Students will learn to solve quadratic equations...",
        "type": "lecture",
        "status": "published",
        "learningObjectives": [
          {
            "description": "Students will be able to solve quadratic equations",
            "type": "knowledge",
            "isAchieved": false,
            "notes": "string"
          }
        ],
        "lessonPlan": "Start with examples, then practice problems",
        "maxPoints": 100,
        "dueDate": "2024-09-30T23:59:59Z",
        "createdAt": "2024-01-15T10:30:00Z",
        "updatedAt": "2024-09-20T14:45:00Z"
      }
    ],
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-09-20T14:45:00Z"
  }
}
Response examples (400)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}
Response examples (404)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}
Response examples (500)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}