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

# Update Student

> Update a student's information

## Authentication

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

## Path Parameters

<ParamField path="id" type="integer" required>
  Student ID
</ParamField>

## Body Parameters

<ParamField body="email" type="string">
  Student's email address
</ParamField>

<ParamField body="first_name" type="string">
  Student's first name
</ParamField>

<ParamField body="last_name" type="string">
  Student's last name
</ParamField>

<ParamField body="phone_number" type="string">
  Student's phone number
</ParamField>

<ParamField body="password" type="string">
  New password (optional)
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://api.chessplay.io/api/v1/students/123/ \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "first_name": "Jane",
      "email": "jane@example.com"
    }'
  ```

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

  headers = {"Authorization": "Bearer YOUR_ACCESS_TOKEN"}
  data = {
      "first_name": "Jane",
      "email": "jane@example.com"
  }

  response = requests.patch(
      "https://api.chessplay.io/api/v1/students/123/",
      headers=headers,
      json=data
  )
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.chessplay.io/api/v1/students/123/', {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      first_name: 'Jane',
      email: 'jane@example.com'
    })
  });
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "id": 123,
    "username": "FastMalamute",
    "email": "jane@example.com",
    "phone_number": "+1234567890",
    "first_name": "Jane",
    "last_name": "Doe",
    "public_report_id": "abc-123-def-456",
    "created": "2024-01-15T10:30:00Z"
  }
  ```

  ```json 403 Forbidden theme={null}
  {
    "detail": "You do not have permission to perform this action."
  }
  ```
</ResponseExample>

<Warning>
  Only **Admin users** can update students.
</Warning>
