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

# Enroll User in a Course

> Enrolls a user in a course in a classroom.
If the course is paid, user must have an active license.
User must be a member of the classroom.




## OpenAPI

````yaml PUT /classrooms/{classroomHandle}/courses/{courseHandle}/enrolled
openapi: 3.0.1
info:
  title: CodeCombat API
  version: 0.0.1
servers:
  - url: https://codecombat.com/api
    description: default
security: []
paths:
  /classrooms/{classroomHandle}/courses/{courseHandle}/enrolled:
    put:
      tags:
        - Classrooms
      summary: Enroll User in a Course
      description: |
        Enrolls a user in a course in a classroom.
        If the course is paid, user must have an active license.
        User must be a member of the classroom.
      operationId: classrooms_enrollUserInCourse
      parameters:
        - name: classroomHandle
          in: path
          description: The classroom's `_id`.
          required: true
          schema:
            type: string
        - name: courseHandle
          in: path
          description: The course's `_id`.
          required: true
          schema:
            type: string
        - name: retMemberLimit
          in: query
          description: >-
            limit the return number of members for the classroom, the default
            value is 1000
          required: false
          schema:
            type: number
            format: double
            nullable: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  $ref: '#/components/schemas/objectIdString'
              required:
                - userId
      responses:
        '200':
          description: The classroom with the user enrolled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassroomResponse'
      security:
        - BasicAuth: []
components:
  schemas:
    objectIdString:
      title: objectIdString
      type: string
    ClassroomResponse:
      title: ClassroomResponse
      type: object
      description: Subset of properties listed here
      properties:
        _id:
          $ref: '#/components/schemas/objectIdString'
          nullable: true
        name:
          type: string
          nullable: true
        members:
          type: array
          items:
            $ref: '#/components/schemas/objectIdString'
          nullable: true
        ownerID:
          $ref: '#/components/schemas/objectIdString'
          nullable: true
        description:
          type: string
          nullable: true
        courses:
          type: array
          items:
            $ref: '#/components/schemas/ClassroomResponseCoursesItem'
          nullable: true
    ClassroomResponseCoursesItem:
      title: ClassroomResponseCoursesItem
      type: object
      properties:
        _id:
          $ref: '#/components/schemas/objectIdString'
          nullable: true
        levels:
          type: array
          items:
            type: object
            additionalProperties: true
          nullable: true
        enrolled:
          type: array
          items:
            $ref: '#/components/schemas/objectIdString'
          nullable: true
        instance_id:
          $ref: '#/components/schemas/objectIdString'
          nullable: true
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic

````