To archive the Google Classrooms for teachers who have left the district:

1) Go to https://developers.google.com/classroom/reference/rest/v1/courses/list

2) On the right hand side of the page, try the API in the API Explorer.

3) When trying the API, you need to set the "courseState" to "Active".

4) Either search for the student or teacher in the "studentId" or "teacherId" field

5) Click "Execute" and select your Google Admin account

6) If you get a status code of 200, copy all the information in the response body under the "Execute" button


7) Then go to https://developers.google.com/classroom/reference/rest/v1/courses/update

8) In the json you copied from the response body, there is an ID field that is listed for each of the active classes. Copy this Id and paste it into the 'id" field in the API Explorer on the right hand side.

9) In the "Request Body," select the "course state" parameter and set it to "Archive." You might have to set other parameters also.

10) Execute the request and it should respond with a 200 status code.