> ## Documentation Index
> Fetch the complete documentation index at: https://docs.terang.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Course Detail

> Get detailed information about a specific course, including modules, chapters, quizzes, and detail sections.



## OpenAPI

````yaml api-reference/lms-openapi.json GET /api/courses/{id}
openapi: 3.1.0
info:
  title: Terang AI LMS API
  description: >-
    LMS application endpoints (served from the LMS application host, e.g.
    https://lms.terang.ai). Maintained manually — NOT overwritten by the Core
    API auto-update.
  version: 1.0.0
servers:
  - description: LMS (Production)
    url: https://lms.terang.ai
  - description: LMS (Development)
    url: https://dev.lms.terang.ai
security: []
paths:
  /api/courses/{id}:
    get:
      tags:
        - Courses
      summary: Course Detail
      description: >-
        Returns full course details including metadata, category, all modules
        with chapters and quizzes, and detail sections (admissions, academics,
        tuition, careers, student experience).


        **Quiz answers are NOT included** for API key users. Only the course
        owner or an admin can see answer keys via session-based auth.
      operationId: getCourseDetail
      parameters:
        - name: id
          in: path
          required: true
          description: The numeric course ID.
          schema:
            type: integer
      responses:
        '200':
          description: Course details retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseDetailResponse'
        '400':
          description: Invalid course ID (non-numeric)
        '401':
          description: Unauthorized — missing or invalid API key / session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Course not found (or draft/unpublished course for non-owners)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Rate limit exceeded — 100 requests per minute per API key. Retry
            after `Retry-After` seconds.
          headers:
            Retry-After:
              description: Seconds until the rate limit window resets
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKey: []
        - cookieAuth: []
components:
  schemas:
    CourseDetailResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        course:
          $ref: '#/components/schemas/CourseDetail'
    ErrorResponse:
      type: object
      description: Error response returned for 4xx and 5xx status codes.
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Rate limit exceeded
    CourseDetail:
      type: object
      properties:
        id:
          type: integer
          example: 1
        name:
          type: string
        description:
          type: string
        instructor:
          type: string
        type:
          type: string
          example: self_paced
        enrollmentType:
          type: string
          example: code
        startDate:
          type: string
          format: date-time
          nullable: true
        endDate:
          type: string
          format: date-time
          nullable: true
        teacherId:
          type: string
        institutionId:
          type: integer
        categoryId:
          type: integer
          nullable: true
        courseCode:
          type: string
        eventCode:
          type: string
          nullable: true
        isPublished:
          type: boolean
        nilaiKum:
          type: number
          nullable: true
        coverPicture:
          type: string
          format: uri
          nullable: true
        isPurchasable:
          type: boolean
        price:
          type: string
          example: '500000'
        priceNonMember:
          type: string
          nullable: true
        priceMahasiswa:
          type: string
          nullable: true
        currency:
          type: string
          example: IDR
        previewMode:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        teacherName:
          type: string
        teacherEmail:
          type: string
          format: email
        category:
          $ref: '#/components/schemas/Category'
          nullable: true
        modules:
          type: array
          items:
            $ref: '#/components/schemas/Module'
        moduleQuizzes:
          type: array
          items:
            $ref: '#/components/schemas/Quiz'
        enrollmentCount:
          type: integer
        studentCount:
          type: integer
        admissions:
          $ref: '#/components/schemas/DetailSection'
          nullable: true
        academics:
          $ref: '#/components/schemas/DetailSection'
          nullable: true
        tuitionAndFinancing:
          $ref: '#/components/schemas/DetailSection'
          nullable: true
        careers:
          $ref: '#/components/schemas/DetailSection'
          nullable: true
        studentExperience:
          $ref: '#/components/schemas/DetailSection'
          nullable: true
    Category:
      type: object
      properties:
        id:
          type: integer
          example: 1
        code:
          type: string
          example: MANAJEMEN
        name:
          type: string
          example: Manajemen
    Module:
      type: object
      properties:
        id:
          type: integer
        courseId:
          type: integer
        name:
          type: string
        description:
          type: string
        orderIndex:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        chapters:
          type: array
          items:
            $ref: '#/components/schemas/Chapter'
    Quiz:
      type: object
      properties:
        id:
          type: integer
        chapterId:
          type: integer
          nullable: true
        name:
          type: string
        description:
          type: string
        quizType:
          type: string
          example: multiple_choice
        minimumScore:
          type: integer
          example: 70
        timeLimit:
          type: integer
          example: 10
        questions:
          type: array
          items:
            $ref: '#/components/schemas/Question'
    DetailSection:
      type: object
      properties:
        requirements:
          type: string
          example: Minimum 3 tahun pengalaman manajerial
        applicationDeadline:
          type: string
          format: date-time
        prerequisites:
          type: string
          example: Tidak ada
      description: >-
        Course detail sections (admissions, academics, tuition, careers, student
        experience). Fields vary per section.
    Chapter:
      type: object
      properties:
        id:
          type: integer
        moduleId:
          type: integer
        name:
          type: string
        content:
          type: string
        orderIndex:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        quizzes:
          type: array
          items:
            $ref: '#/components/schemas/Quiz'
    Question:
      type: object
      properties:
        id:
          type: integer
        quizId:
          type: integer
        questionText:
          type: string
        questionType:
          type: string
          example: multiple_choice
        options:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                example: a
              text:
                type: string
        orderIndex:
          type: integer
        points:
          type: integer
          example: 10
      description: >-
        A quiz question. For API key users, `correctAnswer` and `essayAnswer`
        fields are stripped (sanitized).
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key generated under Teacher Dashboard → Kunci API. Format:
        `lms_key_...`
    cookieAuth:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Browser session cookie (teacher/admin). Used by frontend clients.

````