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

# API Overview

> All available endpoints

## Base URL

```
https://api.chessplay.io/api
```

## Authentication

All requests need a JWT token:

```
Authorization: Bearer YOUR_TOKEN
```

See [Authentication](/authentication) for details.

## Available APIs

<CardGroup cols={3}>
  <Card title="Students" icon="user-graduate" href="/api-reference/students/list">
    Manage students
  </Card>

  <Card title="Classrooms" icon="chalkboard" href="/api-reference/classrooms/list">
    Manage classrooms
  </Card>

  <Card title="Batches" icon="layer-group" href="/api-reference/batches/list">
    Manage batches
  </Card>
</CardGroup>

## Endpoints

### Students

| Method | Endpoint             | Description    |
| ------ | -------------------- | -------------- |
| GET    | `/v1/students/`      | List students  |
| POST   | `/v1/students/`      | Create student |
| GET    | `/v1/students/{id}/` | Get student    |
| PATCH  | `/v1/students/{id}/` | Update student |
| DELETE | `/v1/students/{id}/` | Delete student |

### Classrooms

| Method | Endpoint                              | Description      |
| ------ | ------------------------------------- | ---------------- |
| GET    | `/v1/classrooms/`                     | List classrooms  |
| POST   | `/v1/classrooms/`                     | Create classroom |
| GET    | `/v1/classrooms/{id}/`                | Get classroom    |
| PATCH  | `/v1/classrooms/{id}/`                | Update classroom |
| DELETE | `/v1/classrooms/{id}/`                | Delete classroom |
| POST   | `/v1/classrooms/{id}/add-student/`    | Add student      |
| POST   | `/v1/classrooms/{id}/remove-student/` | Remove student   |

### Batches

| Method | Endpoint                           | Description    |
| ------ | ---------------------------------- | -------------- |
| GET    | `/v1/batches/`                     | List batches   |
| POST   | `/v1/batches/`                     | Create batch   |
| GET    | `/v1/batches/{id}/`                | Get batch      |
| PATCH  | `/v1/batches/{id}/`                | Update batch   |
| DELETE | `/v1/batches/{id}/`                | Delete batch   |
| POST   | `/v1/batches/{id}/add-student/`    | Add student    |
| POST   | `/v1/batches/{id}/remove-student/` | Remove student |

## Common Features

### Pagination

List endpoints return paginated results (10 per page):

```json theme={null}
{
  "count": 100,
  "next": "https://api.chessplay.io/api/v1/students/?page=2",
  "previous": null,
  "results": [...]
}
```

### Search

Use `?search=` to filter results:

```bash theme={null}
GET /v1/students/?search=john
GET /v1/classrooms/?search=beginner
```

### Organization Scoping

All data is automatically filtered to your organization. You only see your own data.

## Permissions

* **Admin**: Full access (create, update, delete)
* **Coach/Student**: Read-only (list, retrieve)

## Response Codes

| Code | Meaning      |
| ---- | ------------ |
| 200  | Success      |
| 201  | Created      |
| 204  | Deleted      |
| 400  | Bad request  |
| 401  | Unauthorized |
| 403  | Forbidden    |
| 404  | Not found    |
