Upcoming change to Google Classroom API courses.list behavior

17 views
Skip to first unread message

Andrew Burke

unread,
11:16 AM (5 hours ago) 11:16 AM
to classroom-d...@googlegroups.com, google-e...@google.com

Dear developers,


We are making changes to the behavior of the Google Classroom API courses.list method. This change will significantly improve the method’s performance and response quality.


What’s changing

Currently, you can populate both the studentId and teacherId fields in a courses.list request, with the response containing the courses in which a user is either a teacher or student member. Beginning April 6, 2026, you will no longer be able to populate both fields in a single request. Instead, you will receive an error.


What should I do?

If you don’t make courses.list requests with both studentId and teacherId fields populated, then no action is required. 


If you do make courses.list requests with both ID fields populated, then you should change your implementation to instead make two requests and join the results. This will result in the same set of information that was previously available. See below for an example.



Old

New


# A single courses.list request with both

# teacherId and studentId populated.

all_courses = classroom_service.courses().list(

      studentId="me",

      teacherId="me",

      courseStates="ACTIVE",

    ).execute()


courses_list = all_courses.get("courses")



# Two separate courses.list requests, one each with

# teacherId and studentId.

student_courses = classroom_service.courses().list(

      studentId="me",

      courseStates="ACTIVE",

    ).execute()

teacher_courses = classroom_service.courses().list(

      teacherId="me",

      courseStates="ACTIVE",

    ).execute()


# Join the results.

courses_list = student_courses

  .get("courses")

  .append(teacher_courses.get("courses"))



If you have questions about this change, please reach out to our Developer Relations team.

Andrew Burke

unread,
11:25 AM (5 hours ago) 11:25 AM
to Google for Education Developer Announcements
Correction: The suggested remedy should read: "If you do make courses.list requests with both ID fields populated, then you should change your implementation to instead make two requests and find the intersection of the results."

Additionally, the last line of the "New" code snippet should read:

# Find the intersection of the results.

courses_list = list(

set(student_courses.get("courses"))

.intersection(set(teacher_courses.get("courses")))


Apologies for any confusion!
Reply all
Reply to author
Forward
0 new messages