curl --request POST \
--url http://localhost:5000/api/assignment/submit \
--header 'Content-Type: application/json' \
--data '{
"assignmentId": "64b8f1a2c3d4e5f678905678",
"studentId": "64b8f1a2c3d4e5f678901234",
"fileUrl": "https://storage.example.com/submissions/essay-final.pdf",
"submittedAt": "2026-03-18T14:30:00.000Z"
}'
{
"_id": "64d0b4c8e3f2a1b096785432",
"assignmentId": "64b8f1a2c3d4e5f678905678",
"studentId": "64b8f1a2c3d4e5f678901234",
"fileUrl": "https://storage.example.com/submissions/essay-final.pdf",
"submittedAt": "2026-03-18T14:30:00.000Z",
"__v": 0
}
Assignments
Submit assignment
Submit a student assignment with a file URL and timestamp.
POST
/
api
/
assignment
/
submit
curl --request POST \
--url http://localhost:5000/api/assignment/submit \
--header 'Content-Type: application/json' \
--data '{
"assignmentId": "64b8f1a2c3d4e5f678905678",
"studentId": "64b8f1a2c3d4e5f678901234",
"fileUrl": "https://storage.example.com/submissions/essay-final.pdf",
"submittedAt": "2026-03-18T14:30:00.000Z"
}'
{
"_id": "64d0b4c8e3f2a1b096785432",
"assignmentId": "64b8f1a2c3d4e5f678905678",
"studentId": "64b8f1a2c3d4e5f678901234",
"fileUrl": "https://storage.example.com/submissions/essay-final.pdf",
"submittedAt": "2026-03-18T14:30:00.000Z",
"__v": 0
}
Creates a new assignment submission record. Pass the assignment and student identifiers, a URL pointing to the submitted file, and the submission timestamp.
This endpoint requires no authentication.
Request
Body parameters
The MongoDB ObjectId of the assignment being submitted. Must be a valid 24-character hex string.
The MongoDB ObjectId of the student submitting the assignment. Must be a valid 24-character hex string.
A URL pointing to the submitted file (e.g., a cloud storage URL). The file must be accessible at this URL at the time of grading.
The submission timestamp in ISO 8601 format (e.g.,
2026-03-18T14:30:00.000Z).Set
submittedAt to the current timestamp by using new Date().toISOString() in JavaScript or datetime.utcnow().isoformat() in Python. This ensures the recorded time accurately reflects when the submission was made.Response
Returns the created submission document.The MongoDB ObjectId of the newly created submission record.
The MongoDB ObjectId of the assignment.
The MongoDB ObjectId of the student.
The URL of the submitted file.
The submission timestamp in ISO 8601 format.
Mongoose internal version key.
curl --request POST \
--url http://localhost:5000/api/assignment/submit \
--header 'Content-Type: application/json' \
--data '{
"assignmentId": "64b8f1a2c3d4e5f678905678",
"studentId": "64b8f1a2c3d4e5f678901234",
"fileUrl": "https://storage.example.com/submissions/essay-final.pdf",
"submittedAt": "2026-03-18T14:30:00.000Z"
}'
{
"_id": "64d0b4c8e3f2a1b096785432",
"assignmentId": "64b8f1a2c3d4e5f678905678",
"studentId": "64b8f1a2c3d4e5f678901234",
"fileUrl": "https://storage.example.com/submissions/essay-final.pdf",
"submittedAt": "2026-03-18T14:30:00.000Z",
"__v": 0
}
⌘I