GET /classes

Retrieves a paginated list of classes with optional filters and sorting.

Query parameters

  • page integer

    Page number (1-indexed)

    Minimum value is 1. Default value is 1.

  • pageSize integer

    Number of classes per page

    Minimum value is 1, maximum value is 100. Default value is 10.

  • sort string

    Sort field and direction (e.g., 'name-asc', 'createdAt-desc')

  • isActive boolean

    Filter by active status

Responses

  • 200 application/json

    List of classes retrieved successfully

    Hide response attributes Show response attributes object
    • success boolean
    • code integer(int32)
    • message string
    • data array[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

    • pagination object
      Hide pagination attributes Show pagination attributes object
      • currentPage

        The current page number (1-based indexing)

      • pageSize

        Number of items per page

      • totalItems

        Total number of items across all pages

      • totalPages

        Total number of available pages

  • 401 application/json

    Unauthorized - Invalid or missing authentication token

    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)
GET /classes
curl \
 --request GET 'https://api.huy-devops.site/api/classes' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
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"
    }
  ],
  "pagination": {
    "currentPage": 1,
    "pageSize": 10,
    "totalItems": 100,
    "totalPages": 10
  }
}
Response examples (401)
{
  "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"
}