GET /classes/{classId}/students

Retrieves all students enrolled in a specific class.

Path parameters

  • classId string Required

    The class ID

Query parameters

  • page integer

    Page number (1-indexed)

    Default value is 1.

  • size integer

    Page size

    Default value is 10.

Responses

  • 200 application/json

    List of students retrieved successfully

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

      API response schema for student returned by student endpoints (includes profile and credentials when applicable)

      Hide data attributes Show data attributes object
      • id string

        Unique identifier for the student record

      • userId string

        Associated user/profile id

      • enrollmentDate string(date) | null

        Enrollment date

      • address string | null

        Student address

      • parentContactEmail string | null

        Parent contact email

      • status string | null

        Student status

        Values are active, transferred, graduated, or dropped.

      • createdAt string(date-time) | null

        Record creation timestamp

      • updatedAt string(date-time) | null

        Record update timestamp

      • username string | null

        Generated username/email (only set during create/import)

      • password string | null

        Temporary password (only set during create/import)

      • firstName string | null

        First name from user profile

      • lastName string | null

        Last name from user profile

      • avatarUrl string(uri) | null

        Avatar URL from user profile

      • phoneNumber string | null

        Phone number from user profile

    • pagination object
      Hide pagination attributes Show pagination attributes object
      • currentPage integer
      • pageSize integer
      • totalItems integer
      • totalPages integer
  • 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)
GET /classes/{classId}/students
curl \
 --request GET 'http://localhost:8080/api/classes/{classId}/students' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "code": 200,
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440002",
      "status": "active",
      "userId": "user_001",
      "address": "123 Main St",
      "lastName": "Van A",
      "password": null,
      "username": null,
      "avatarUrl": "https://example.com/avatar.jpg",
      "createdAt": "2024-01-15T10:30:00Z",
      "firstName": "Nguyen",
      "updatedAt": "2024-09-20T14:45:00Z",
      "phoneNumber": "+84987654321",
      "enrollmentDate": "2024-01-15",
      "parentContactEmail": "parent@example.com"
    }
  ],
  "message": "Students retrieved successfully",
  "success": true,
  "pagination": {
    "pageSize": 10,
    "totalItems": 1,
    "totalPages": 1,
    "currentPage": 1
  }
}
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"
}