Create a new assignment for students to complete. Only admins and lecturers can create assignments.
POST
/api/v1/unit-instance/{unit}/new-assignment
curl \
--request POST 'https://api.echoplain.social/api/v1/unit-instance/123e4567-e89b-12d3-a456-426614174000/new-assignment' \
--header "Content-Type: application/json" \
--data '{"marks":100,"title":"Algorithm Implementation Assignment","status":"DRAFT","dueDate":"2025-11-30T23:59:59Z","description":"Implement merge sort and quicksort algorithms","maxAttempts":3,"releaseDate":"2025-11-20T00:00:00Z"}'
Request examples
Standard assignment
{
"marks": 100,
"title": "Algorithm Implementation Assignment",
"status": "DRAFT",
"dueDate": "2025-11-30T23:59:59Z",
"description": "Implement merge sort and quicksort algorithms",
"maxAttempts": 3,
"releaseDate": "2025-11-20T00:00:00Z"
}
{
"marks": 150,
"title": "Data Structures Project",
"status": "RELEASED",
"dueDate": "2025-12-15T23:59:59Z",
"description": "Build a complete binary search tree implementation",
"maxAttempts": 1,
"releaseDate": "2025-11-15T00:00:00Z"
}
Response examples (201)
{
"message": "Assignment created successfully",
"assignment": {
"id": "assignment-321",
"marks": 100,
"title": "Algorithm Implementation Assignment",
"status": "DRAFT",
"dueDate": "2025-11-30T23:59:59Z",
"createdAt": "2025-11-17T11:00:00Z",
"description": "Implement merge sort and quicksort algorithms",
"maxAttempts": 3,
"releaseDate": "2025-11-20T00:00:00Z",
"unitOfferingId": "123e4567-e89b-12d3-a456-426614174000"
}
}