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

# Students By Course

> Retrieves the paginated list of all enrolled students in a specific course. Supports search filtering across names and emails.

## Endpoint

```text theme={null}
GET /api/v3/admin/courses/{course_id}/students
```

## Required Role

**Admin** — you must authenticate with an admin-scoped Bearer token.

## Required Headers

| Header          | Value              |
| --------------- | ------------------ |
| `Authorization` | `Bearer <token>`   |
| `Accept`        | `application/json` |

## Path Parameters

<ParamField path="course_id" type="integer" required>
  The unique ID of the course you want to retrieve.

  ## **Query Parameters**

  <ParamField body="per_page" type="integer" placeholder="default: 50, max: 200">
    **Page size limit:** Controls the number of student records returned per page to prevent high memory usage and database bottlenecks on large courses with thousands of students.
  </ParamField>

  <ParamField body="page" default="1" type="integer">
    **Page index:** The current page number for pagination.

    <ParamField path="search" type="string">
      **Search filter:** Performs real-time substring filtering by student first name, last name, or email address.
    </ParamField>
  </ParamField>
</ParamField>

## Example Request

```bash theme={null}
curl -X GET https://app.example.com/api/v3/admin/courses/1/students \
  -H "Authorization: Bearer your-token" \
  -H "Accept: application/json"
```

## Response

### 200 OK

```json theme={null}
{
  "data": [
    {
      "id": 105,
      "name": "Ahmed Ali",
      "email": "ahmed@example.com"
    }
  ],
  "links": {
    "first": "https://app.example.com/api/v3/admin/courses/10/students?page=1",
    "last": "https://app.example.com/api/v3/admin/courses/10/students?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "per_page": 50,
    "to": 1,
    "total": 1
  }
}
```

### Response Fields

<ResponseField name="data" type="array">
  Array of enrolled student objects.

  <Expandable title="Students object fields">
    <ResponseField name="id" type="integer">
      Unique identifier of the student user account.
    </ResponseField>

    <ResponseField name="name" type="string">
      Full display name of the student (`full_name`).
    </ResponseField>

    <ResponseField name="email" type="string">
      Email address of the student.
    </ResponseField>

    <ResponseField name="links" type="array">
      Pagination links (`first`, `last`, `prev`, `next`).
    </ResponseField>

    <ResponseField name="meta" type="array">
      Pagination metadata (`current_page`, `from`, `last_page`, `per_page`, `to`, `total`).
    </ResponseField>
  </Expandable>
</ResponseField>

## Error Responses

| Status | Message             | Cause                                                   |
| ------ | ------------------- | ------------------------------------------------------- |
| `403`  | Unauthorized Access | The token provided does not belong to an admin account. |
| `404`  | Not Found           | No course exists with the specified `course_id`.        |
