After restoring a deleted professor's user acct, how to get their enrollments to show

Jump to solution
82711010bc61080
Community Novice

I didn't find anything out here, so posting a question.  We had someone delete a professor's user account, who had taught in prior terms already concluded.  I was able to restore the user account, however, that did NOT restore their prior courses they were enrolled in.  I ran an Enrollment report checking the box to include deleted items, and selected the term the course was in, however, this professor doesn't show, it only shows the students, so I cannot restore those enrollments.   

Is there a way to restore this or is this once user account deleted, the only thing you can restore is the actual user account and nothing else it was tied to. 

Labels (2)
1 Solution
audra_agnelly
Community Champion

I haven't encountered this specific issue, but restoring deleted object in other areas doesn't always return all the previously associated data. We leverage this when we want to wipe all the enrollments in a course - all enrollments are wiped from a course when it's deleted and do not return when the course is restored.

In your case, you'll probably have to manually add the instructor back into those past courses. To find their deleted accounts, update this api with your institutions URL and replace 1234 with the professor's Canvas Id and then paste it in your browser. If you don't already have one, you'll also want to add a JSON formatter as a browser extension to visually organize the returned data.

API Call: https://XXXXXX.instructure.com/api/v1/users/12345/enrollments?state[]=deleted&per_page=50 

Each returned object will return data associated with an enrollment, including the course ID which you can use to add the instructor back.

View solution in original post