Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/aakash811/Student-Progress-Tracker/llms.txt

Use this file to discover all available pages before exploring further.

This page documents two related update endpoints. The first lets you modify any student field; the second is a focused shortcut for toggling the email reminder setting without affecting other fields.

PUT /api/students/:id

Updates one or more fields on an existing student record. All body fields are optional — only the fields you send are changed. If codeforcesHandle is included, the server immediately re-syncs all Codeforces data (ratings, contest history, submissions) for the new handle and returns the refreshed document.

Path parameter

id
string
required
The MongoDB ObjectId of the student to update.

Body parameters

name
string
Updated full name.
email
string
Updated email address. Must remain unique across all records.
phoneNo
string
Updated phone number.
codeforcesHandle
string
Updated Codeforces username. Providing this field triggers a full re-sync for the new handle after the database update is applied.
emailRemindersDisabled
boolean
Set to true to disable inactivity emails, or false to re-enable them.
If codeforcesHandle is present in the request body, the endpoint performs a full Codeforces data sync for the new handle after saving the update. The response will contain the re-synced ratings, contestData, and submissions rather than the previous cached values.

Example

curl -X PUT https://your-app.onrender.com/api/students/664a1f2e8c3b2a001f4e7d91 \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Alice S. Sharma",
    "codeforcesHandle": "tourist"
  }'

Response

Returns 200 OK with the updated (and optionally re-synced) student object.
{
  "_id": "664a1f2e8c3b2a001f4e7d91",
  "name": "Alice S. Sharma",
  "email": "alice@example.com",
  "phoneNo": "+91-9876543210",
  "codeforcesHandle": "tourist",
  "currRating": 3779,
  "rank": "Legendary Grandmaster",
  "maxRating": 3979,
  "lastSyncedAt": "2026-05-07T09:15:00.000Z",
  "lastActiveAt": "2026-05-06T14:32:11.000Z",
  "emailRemindersSent": 0,
  "emailRemindersDisabled": false,
  "contestData": [ ],
  "submissions": [ ],
  "createdAt": "2026-04-01T10:00:00.000Z",
  "updatedAt": "2026-05-07T09:15:01.000Z"
}

Errors

StatusBodyCause
404 Not Found{ "error": "No such student found" }No student exists with the given id.
500 Internal Server Error{ "error": "..." }Database error or sync failure.

PUT /api/students/:id/toggle-reminder

A focused endpoint for enabling or disabling inactivity email reminders for a single student. Only the emailRemindersDisabled field is updated; all other fields are left unchanged.

Path parameter

id
string
required
The MongoDB ObjectId of the student whose reminder setting you want to change.

Body parameter

emailRemindersDisabled
boolean
required
Pass true to stop sending inactivity reminder emails to this student, or false to resume them.

Example

curl -X PUT https://your-app.onrender.com/api/students/664a1f2e8c3b2a001f4e7d91/toggle-reminder \
  -H "Content-Type: application/json" \
  -d '{ "emailRemindersDisabled": true }'

Response

Returns 200 OK with the updated student object reflecting the new emailRemindersDisabled value.
{
  "_id": "664a1f2e8c3b2a001f4e7d91",
  "name": "Alice S. Sharma",
  "email": "alice@example.com",
  "phoneNo": "+91-9876543210",
  "codeforcesHandle": "tourist",
  "currRating": 3779,
  "rank": "Legendary Grandmaster",
  "maxRating": 3979,
  "lastSyncedAt": "2026-05-07T09:15:00.000Z",
  "lastActiveAt": "2026-05-06T14:32:11.000Z",
  "emailRemindersSent": 0,
  "emailRemindersDisabled": true,
  "contestData": [],
  "submissions": [],
  "createdAt": "2026-04-01T10:00:00.000Z",
  "updatedAt": "2026-05-07T09:20:00.000Z"
}

Errors

StatusBodyCause
500 Internal Server Error{ "error": "Failed to toggle reminder" }Database update failed.

Build docs developers (and LLMs) love