POST /lessons/{lessonId}/submissions

Student submits assignment work for an assignment lesson.

Path parameters

  • lessonId string Required

    The lesson (assignment) ID

application/json

Body Required

  • lessonId string Required

    ID of the lesson/assignment

  • studentId string Required

    ID of the student

  • fileUrls array[string(uri)] | null

    Array of file URLs to submit

Responses

  • 201 application/json

    Submission created 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

    Lesson 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)
POST /lessons/{lessonId}/submissions
curl \
 --request POST 'https://api.huy-devops.site/api/lessons/{lessonId}/submissions' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"lessonId":"550e8400-e29b-41d4-a716-446655440005","studentId":"550e8400-e29b-41d4-a716-446655440002","fileUrls":["https://example.com/submission1.pdf"]}'
Request examples
{
  "lessonId": "550e8400-e29b-41d4-a716-446655440005",
  "studentId": "550e8400-e29b-41d4-a716-446655440002",
  "fileUrls": [
    "https://example.com/submission1.pdf"
  ]
}
Response examples (201)
{
  "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"
}