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.

Input Parameters

FieldTypeRequiredDescription
userIdString!YesID of the student (User) to remove from the course
courseIdString!YesID 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

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.