curl --request POST \
--url https://your-api-host/api/student/add \
--header 'Content-Type: application/json' \
--data '{
"name": "Priya Sharma",
"email": "priya.sharma@school.edu",
"class": "10",
"section": "A",
"rollNumber": 42
}'
{
"_id": "64f1a2b3c4d5e6f7a8b9c0d1",
"name": "Priya Sharma",
"email": "priya.sharma@school.edu",
"class": "10",
"section": "A",
"rollNumber": 42,
"__v": 0
}
Students
Add student
Create a new student record in the system.
POST
/
api
/
student
/
add
curl --request POST \
--url https://your-api-host/api/student/add \
--header 'Content-Type: application/json' \
--data '{
"name": "Priya Sharma",
"email": "priya.sharma@school.edu",
"class": "10",
"section": "A",
"rollNumber": 42
}'
{
"_id": "64f1a2b3c4d5e6f7a8b9c0d1",
"name": "Priya Sharma",
"email": "priya.sharma@school.edu",
"class": "10",
"section": "A",
"rollNumber": 42,
"__v": 0
}
Creates a new student and persists it to the database. Returns the created student object including the generated
_id.
This endpoint does not require authentication. It is publicly accessible.
Request body
Full name of the student.
Email address of the student. Used for identification and communication.
The class (grade level) the student is enrolled in, for example
"10" or "Grade 5".The section within the class, for example
"A" or "B".The student’s unique roll number within their class and section.
Response
Returns the newly created student object.MongoDB-generated unique identifier for the student.
Full name of the student.
Email address of the student.
The class the student is enrolled in.
The section within the class.
The student’s roll number.
MongoDB internal version key.
curl --request POST \
--url https://your-api-host/api/student/add \
--header 'Content-Type: application/json' \
--data '{
"name": "Priya Sharma",
"email": "priya.sharma@school.edu",
"class": "10",
"section": "A",
"rollNumber": 42
}'
{
"_id": "64f1a2b3c4d5e6f7a8b9c0d1",
"name": "Priya Sharma",
"email": "priya.sharma@school.edu",
"class": "10",
"section": "A",
"rollNumber": 42,
"__v": 0
}
⌘I