PUT /submissions/{submissionId}

Updates a submission (student can update draft; teacher can grade and return).

Path parameters

  • submissionId string Required

    The submission ID

application/json

Body Required

  • grade integer | null

    Grade/points to award

  • feedback string | null

    Teacher feedback

  • status string | null

    Update submission status

    Values are draft, submitted, returned, late, or graded.

Responses

  • 200 application/json

    Submission updated successfully

    Hide response attributes Show response attributes object
    • success boolean
    • code integer(int32)
    • message string
    • data object

      Student submission for assignments

      Hide data attributes Show data attributes object
      • id string Required

        Unique identifier for the submission

      • lessonId string Required

        ID of the lesson/assignment

      • studentId string Required

        ID of the student

      • fileUrls array[string(uri)] | null

        Array of file URLs uploaded by student

      • grade integer | null

        Grade/points awarded

      • feedback string | null

        Teacher feedback on the submission

      • status string

        Submission status

        Values are draft, submitted, returned, late, or graded.

      • submittedAt string(date-time) | null

        Timestamp when submitted

      • returnedAt string(date-time) | null

        Timestamp when returned by teacher

      • createdAt string(date-time)

        Timestamp when submission record was created

      • updatedAt string(date-time)

        Timestamp when submission was last updated

  • 400 application/json

    Bad Request - Invalid input data or malformed request

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 401 application/json

    Unauthorized - Invalid or missing authentication token

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 404 application/json

    Submission not found

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
PUT /submissions/{submissionId}
curl \
 --request PUT 'https://api.huy-devops.site/api/submissions/{submissionId}' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"grade":85,"feedback":"Good work, but needs improvement on part 2","status":"graded"}'
Request examples
{
  "grade": 85,
  "feedback": "Good work, but needs improvement on part 2",
  "status": "graded"
}
Response examples (200)
{
  "success": true,
  "code": 200,
  "message": "string",
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440007",
    "lessonId": "550e8400-e29b-41d4-a716-446655440005",
    "studentId": "550e8400-e29b-41d4-a716-446655440002",
    "fileUrls": [
      "https://example.com/submission1.pdf"
    ],
    "grade": 85,
    "feedback": "Good work, but needs improvement on part 2",
    "status": "graded",
    "submittedAt": "2024-09-25T10:30:00Z",
    "returnedAt": "2024-09-27T14:00:00Z",
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-09-27T14:00:00Z"
  }
}
Response examples (400)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}
Response examples (401)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}
Response examples (404)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}
Response examples (500)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}