> ## 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.

> Creates a User.

# Create User

```python Example theme={null}
url = 'https://codecombat.com/api/users'
json = { email: 'an@email.com', name: 'Some Username', role: 'student' }
request.post({ url, json, auth })
```


## OpenAPI

````yaml POST /users
openapi: 3.0.1
info:
  title: CodeCombat API
  version: 0.0.1
servers:
  - url: https://codecombat.com/api
    description: default
security: []
paths:
  /users:
    post:
      tags:
        - Users
      summary: Create User
      description: |
        Creates a `User`.
      operationId: users_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                email:
                  type: string
                role:
                  $ref: '#/components/schemas/UsersCreateRequestRole'
                  nullable: true
                  description: >
                    `"student"` or `"teacher"`. If unset, a home user will be
                    created, unable to join classrooms.
                preferredLanguage:
                  type: string
                  nullable: true
                heroConfig:
                  $ref: '#/components/schemas/UsersCreateRequestHeroConfig'
                  nullable: true
                birthday:
                  type: string
                  nullable: true
              required:
                - name
                - email
      responses:
        '200':
          description: The created user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
      security:
        - BasicAuth: []
components:
  schemas:
    UsersCreateRequestRole:
      title: UsersCreateRequestRole
      type: string
      enum:
        - student
        - teacher
      description: >
        `"student"` or `"teacher"`. If unset, a home user will be created,
        unable to join classrooms.
    UsersCreateRequestHeroConfig:
      title: UsersCreateRequestHeroConfig
      type: object
      properties:
        thangType:
          $ref: '#/components/schemas/objectIdString'
          nullable: true
    UserResponse:
      title: UserResponse
      type: object
      description: Subset of properties listed here
      properties:
        _id:
          $ref: '#/components/schemas/objectIdString'
          nullable: true
        email:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        slug:
          type: string
          nullable: true
        role:
          $ref: '#/components/schemas/roleString'
          nullable: true
        stats:
          $ref: '#/components/schemas/UserResponseStats'
          nullable: true
        oAuthIdentities:
          type: array
          items:
            $ref: '#/components/schemas/UserResponseOAuthIdentitiesItem'
          nullable: true
        subscription:
          $ref: '#/components/schemas/UserResponseSubscription'
          nullable: true
        license:
          $ref: '#/components/schemas/UserResponseLicense'
          nullable: true
    objectIdString:
      title: objectIdString
      type: string
    roleString:
      title: roleString
      type: string
      description: Usually either 'teacher' or 'student'
    UserResponseStats:
      title: UserResponseStats
      type: object
      properties:
        gamesCompleted:
          type: number
          format: double
          nullable: true
        concepts:
          type: object
          additionalProperties:
            type: number
            format: double
          nullable: true
        playTime:
          type: number
          format: double
          nullable: true
          description: Included only when specifically requested on the endpoint
    UserResponseOAuthIdentitiesItem:
      title: UserResponseOAuthIdentitiesItem
      type: object
      properties:
        provider:
          type: string
          nullable: true
        id:
          type: string
          nullable: true
    UserResponseSubscription:
      title: UserResponseSubscription
      type: object
      properties:
        ends:
          $ref: '#/components/schemas/datetimeString'
          nullable: true
        active:
          type: boolean
          nullable: true
    UserResponseLicense:
      title: UserResponseLicense
      type: object
      properties:
        ends:
          $ref: '#/components/schemas/datetimeString'
          nullable: true
        active:
          type: boolean
          nullable: true
    datetimeString:
      title: datetimeString
      type: string
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic

````