Skip to main content
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
}

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.

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

assignmentId
string
required
The MongoDB ObjectId of the assignment being submitted. Must be a valid 24-character hex string.
studentId
string
required
The MongoDB ObjectId of the student submitting the assignment. Must be a valid 24-character hex string.
fileUrl
string
required
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.
submittedAt
string
required
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.
_id
string
The MongoDB ObjectId of the newly created submission record.
assignmentId
string
The MongoDB ObjectId of the assignment.
studentId
string
The MongoDB ObjectId of the student.
fileUrl
string
The URL of the submitted file.
submittedAt
string
The submission timestamp in ISO 8601 format.
__v
number
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
}

Build docs developers (and LLMs) love