PUT /classes/{classId}

Updates an existing class with the provided information.

Path parameters

  • id string Required

    The class ID

application/json

Body Required

  • name string | null

    Name of the class

    Maximum length is 50.

  • description string | null

    Description of the class

  • settings object | null

    Class-specific settings

  • isActive boolean | null

    Whether the class is active

Responses

  • 200 application/json

    Class updated successfully

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

      Class (learning group) representing a classroom with enrolled students

      Hide data attributes Show data attributes object
      • id string Required

        Unique identifier for the class

      • ownerId string Required

        ID of the teacher/owner who created the class

      • name string Required

        Name of the class (e.g., "10A1", "11B2")

        Maximum length is 50.

      • description string | null

        Description or notes about the class

      • joinCode string | null

        Unique join code for students to enroll

        Maximum length is 10.

      • settings object | null

        Class-specific settings like theme, allow_comments, etc.

      • isActive boolean

        Whether the class is active

      • createdAt string(date-time)

        Timestamp when the class was created

      • updatedAt string(date-time)

        Timestamp when the class 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

    Class 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)
PUT /classes/{classId}
curl \
 --request PUT 'https://api.huy-devops.site/api/classes/{classId}' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"name":"12A","description":"Advanced Science Track","settings":{"theme":"light","allow_comments":true},"isActive":true}'
Request examples
{
  "name": "12A",
  "description": "Advanced Science Track",
  "settings": {
    "theme": "light",
    "allow_comments": true
  },
  "isActive": true
}
Response examples (200)
{
  "success": true,
  "code": 200,
  "message": "string",
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "ownerId": "550e8400-e29b-41d4-a716-446655440001",
    "name": "12A",
    "description": "Advanced Science Track",
    "joinCode": "ABCD1234",
    "settings": {
      "theme": "light",
      "allow_comments": true
    },
    "isActive": true,
    "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"
}