Skip to content

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.

FieldTypeRequiredDescription
userIdString!YesID of the student (User) to remove from the course
courseIdString!YesID of the course to remove the student from
type AdminRemoveStudentFromCoursePayload {
# Additional information about the operation result
message: String
# Indicates whether the removal was successful
success: Boolean!
}
mutation RemoveStudentFromCourse {
removeStudentFromCourse(
userId: "a1b2c3d4-5678-90ef-ghij-klmnopqrstuv"
courseId: "ab6ee332-614d-475d-93b5-abc5ebb1fc84"
) {
success
message
}
}
{
"data": {
"removeStudentFromCourse": {
"success": true,
"message": "Student successfully removed from the course"
}
}
}
ErrorDescription
Student is not enrolled in this courseThe student is not enrolled in the specified course
Course not foundThe specified course ID does not exist
User not foundThe specified user ID does not exist

For more information about the Teachify Admin API, please refer to the API Overview.