> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/praveenarya123/sps-backend/llms.txt
> Use this file to discover all available pages before exploring further.

# Get attendance

> Retrieve all attendance records for a specific student.

Returns all attendance records associated with a given student ID. Records are returned in the order they were inserted.

<Note>
  This endpoint requires no authentication.
</Note>

## Request

### Path parameters

<ParamField path="id" type="string" required>
  The MongoDB ObjectId of the student whose attendance records you want to retrieve. Must be a valid 24-character hex string.
</ParamField>

## Response

Returns an array of attendance record objects. Returns an empty array if no records exist for the given student.

<ResponseField name="_id" type="string">
  The MongoDB ObjectId of the attendance record.
</ResponseField>

<ResponseField name="studentId" type="string">
  The MongoDB ObjectId of the student.
</ResponseField>

<ResponseField name="date" type="string">
  The attendance date in ISO 8601 format.
</ResponseField>

<ResponseField name="status" type="string">
  The recorded attendance status (e.g., `PRESENT`, `ABSENT`, `LATE`).
</ResponseField>

<ResponseField name="__v" type="number">
  Mongoose internal version key.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url http://localhost:5000/api/attendance/student/64b8f1a2c3d4e5f678901234
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  [
    {
      "_id": "64c9a3b7d2e1f0a987654321",
      "studentId": "64b8f1a2c3d4e5f678901234",
      "date": "2026-03-18T00:00:00.000Z",
      "status": "PRESENT",
      "__v": 0
    },
    {
      "_id": "64c9a3b7d2e1f0a987654322",
      "studentId": "64b8f1a2c3d4e5f678901234",
      "date": "2026-03-17T00:00:00.000Z",
      "status": "LATE",
      "__v": 0
    },
    {
      "_id": "64c9a3b7d2e1f0a987654323",
      "studentId": "64b8f1a2c3d4e5f678901234",
      "date": "2026-03-16T00:00:00.000Z",
      "status": "ABSENT",
      "__v": 0
    }
  ]
  ```
</ResponseExample>
