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

# Mark attendance

> Record a student attendance entry for a given date and status.

Creates a new attendance record for a student. Pass the student's MongoDB ObjectId, the date of attendance, and the attendance status.

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

## Request

### Body parameters

<ParamField body="studentId" type="string" required>
  The MongoDB ObjectId of the student. Must be a valid 24-character hex string.
</ParamField>

<ParamField body="date" type="string" required>
  The date of the attendance record in ISO 8601 format (e.g., `2026-03-18T00:00:00.000Z`).
</ParamField>

<ParamField body="status" type="string" required>
  The attendance status for the student. Accepted values: `PRESENT`, `ABSENT`, `LATE`.
</ParamField>

## Response

Returns the created attendance document.

<ResponseField name="_id" type="string">
  The MongoDB ObjectId of the newly created 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.
</ResponseField>

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

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url http://localhost:5000/api/attendance/mark \
    --header 'Content-Type: application/json' \
    --data '{
      "studentId": "64b8f1a2c3d4e5f678901234",
      "date": "2026-03-18T00:00:00.000Z",
      "status": "PRESENT"
    }'
  ```
</RequestExample>

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