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

# Create Classroom

> Create a new classroom

## Authentication

<ParamField header="Authorization" type="string" required>
  Bearer token (Admin only)
</ParamField>

## Body Parameters

<ParamField body="name" type="string" required>
  Classroom name
</ParamField>

<ParamField body="description" type="string">
  Classroom description
</ParamField>

<ParamField body="coach" type="integer">
  Coach ID (defaults to authenticated user)
</ParamField>

<ParamField body="students" type="array">
  Array of student IDs
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.chessplay.io/api/v1/classrooms/ \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"name": "Advanced Chess"}'
  ```

  ```python Python theme={null}
  import requests

  headers = {"Authorization": "Bearer YOUR_ACCESS_TOKEN"}
  data = {"name": "Advanced Chess", "description": "For experienced players"}

  response = requests.post(
      "https://api.chessplay.io/api/v1/classrooms/",
      headers=headers,
      json=data
  )
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "id": 2,
    "name": "Advanced Chess",
    "description": "For experienced players",
    "coach": {...},
    "students": [],
    "start_time": "2024-01-20T10:00:00Z",
    "end_time": "2024-01-20T11:00:00Z"
  }
  ```
</ResponseExample>
