GET /students/{studentId}

Retrieves a student by their ID.

Path parameters

  • studentId string Required

    The student ID

Responses

  • 200 application/json

    Student retrieved successfully

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

  • 404 application/json

    Student 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 /students/{studentId}
curl \
 --request GET 'https://api.huy-devops.site/api/students/{studentId}' \
 --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": "Student retrieved successfully",
  "success": true
}
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"
}