Remove Student from Course
The removeStudentFromCourse
mutation allows you to completely remove a student’s enrollment from a specified course. This action revokes the student’s access to course content and removes all enrollment records.
Input Parameters
Field | Type | Required | Description |
---|---|---|---|
userId | String! | Yes | ID of the student (User) to remove from the course |
courseId | String! | Yes | ID of the course to remove the student from |
Return Type
type AdminRemoveStudentFromCoursePayload { # Additional information about the operation result message: String
# Indicates whether the removal was successful success: Boolean!}
Example
mutation RemoveStudentFromCourse { removeStudentFromCourse( userId: "a1b2c3d4-5678-90ef-ghij-klmnopqrstuv" courseId: "ab6ee332-614d-475d-93b5-abc5ebb1fc84" ) { success message }}
Sample Response
{ "data": { "removeStudentFromCourse": { "success": true, "message": "Student successfully removed from the course" } }}
Common Errors
Error | Description |
---|---|
Student is not enrolled in this course | The student is not enrolled in the specified course |
Course not found | The specified course ID does not exist |
User not found | The specified user ID does not exist |
Related Resources
- Enroll Student to Course - Enroll a student to a course
- Expire Student Course Access - Mark access as expired
- Extend Student Course Access - Extend access duration
- Course Management - Overview of course operations
For more information about the Teachify Admin API, please refer to the API Overview.