Open documentation ↗Overview
Manages classes, rosters, and invitations in Google Classroom.
Google Classroom API is an analytics API from googleapis.com. Requests are authenticated with OAuth. It is served over HTTPS. Its OpenAPI description documents 61 endpoints.
At a glance
- Authentication
- OAuth
- HTTPS
- Yes
- CORS
- Unknown
- Category
- Analytics
- Base URL
https://classroom.googleapis.com/- Version
- v1
- Endpoints
- 61
- OpenAPI
- Specification ↗
- Spec updated
- 2023-04-21
Make a first request
Replace the placeholders; the documentation says exactly where credentials go.
curl -X GET "https://classroom.googleapis.com/v1/courses" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://classroom.googleapis.com/v1/courses", {
method: "GET",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
const data = await response.json();
console.log(data);import requests
response = requests.request(
"GET",
"https://classroom.googleapis.com/v1/courses",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
timeout=30,
)
print(response.json())Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /v1/courses | Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request. Returned courses are ordered by creation ti |
| POST | /v1/courses | Creates a course. The user specified in `ownerId` is the owner of the created course and added as a teacher. A non-admin requesting user can only create a cours |
| GET | /v1/courses/{courseId}/aliases | Returns a list of aliases for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access t |
| POST | /v1/courses/{courseId}/aliases | Creates an alias for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create the alias |
| DELETE | /v1/courses/{courseId}/aliases/{alias} | Deletes an alias of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to remove the alias o |
| GET | /v1/courses/{courseId}/announcements | Returns a list of announcements that the requester is permitted to view. Course students may only view `PUBLISHED` announcements. Course teachers and domain adm |
| POST | /v1/courses/{courseId}/announcements | Creates an announcement. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested co |
| GET | /v1/courses/{courseId}/announcements/{id} | Returns an announcement. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested co |
| PATCH | /v1/courses/{courseId}/announcements/{id} | Updates one or more fields of an announcement. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not |
| DELETE | /v1/courses/{courseId}/announcements/{id} | Deletes an announcement. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) us |
| POST | /v1/courses/{courseId}/announcements/{id}:modifyAssignees | Modifies assignee mode and options of an announcement. Only a teacher of the course that contains the announcement may call this method. This method returns the |
| GET | /v1/courses/{courseId}/courseWork | Returns a list of course work that the requester is permitted to view. Course students may only view `PUBLISHED` course work. Course teachers and domain adminis |
| POST | /v1/courses/{courseId}/courseWork | Creates course work. The resulting course work (and corresponding student submissions) are associated with the Developer Console project of the [OAuth client ID |
| GET | /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions | Returns a list of student submissions that the requester is permitted to view, factoring in the OAuth scopes of the request. `-` may be specified as the `course |
| GET | /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id} | Returns a student submission. * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, course work, or student submission o |
| PATCH | /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id} | Updates one or more fields of a student submission. See google.classroom.v1.StudentSubmission for details of which fields may be updated and who may change them |
| POST | /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments | Modifies attachments of student submission. Attachments may only be added to student submissions belonging to course work objects with a `workType` of `ASSIGNME |
| POST | /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim | Reclaims a student submission on behalf of the student that owns it. Reclaiming a student submission transfers ownership of attached Drive files to the student |
| POST | /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return | Returns a student submission. Returning a student submission transfers ownership of attached Drive files to the student and may also update the submission state |
| POST | /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn | Turns in a student submission. Turning in a student submission transfers ownership of attached Drive files to the teacher and may also update the submission sta |
| GET | /v1/courses/{courseId}/courseWork/{id} | Returns course work. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course |
| PATCH | /v1/courses/{courseId}/courseWork/{id} | Updates one or more fields of a course work. See google.classroom.v1.CourseWork for details of which fields may be updated and who may change them. This request |
| DELETE | /v1/courses/{courseId}/courseWork/{id} | Deletes a course work. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used |
| POST | /v1/courses/{courseId}/courseWork/{id}:modifyAssignees | Modifies assignee mode and options of a coursework. Only a teacher of the course that contains the coursework may call this method. This method returns the foll |
| GET | /v1/courses/{courseId}/courseWorkMaterials | Returns a list of course work material that the requester is permitted to view. Course students may only view `PUBLISHED` course work material. Course teachers |
| POST | /v1/courses/{courseId}/courseWorkMaterials | Creates a course work material. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the reque |
| GET | /v1/courses/{courseId}/courseWorkMaterials/{id} | Returns a course work material. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the reque |
| PATCH | /v1/courses/{courseId}/courseWorkMaterials/{id} | Updates one or more fields of a course work material. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project f |
| DELETE | /v1/courses/{courseId}/courseWorkMaterials/{id} | Deletes a course work material. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158 |
| GET | /v1/courses/{courseId}/students | Returns a list of students of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course do |
| POST | /v1/courses/{courseId}/students | Adds a user as a student of a course. Domain administrators are permitted to [directly add](https://developers.google.com/classroom/guides/manage-users) users w |
| GET | /v1/courses/{courseId}/students/{userId} | Returns a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view students of |
| DELETE | /v1/courses/{courseId}/students/{userId} | Deletes a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete students o |
| GET | /v1/courses/{courseId}/teachers | Returns a list of teachers of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course do |
| POST | /v1/courses/{courseId}/teachers | Creates a teacher of a course. Domain administrators are permitted to [directly add](https://developers.google.com/classroom/guides/manage-users) users within t |
| GET | /v1/courses/{courseId}/teachers/{userId} | Returns a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view teachers of |
| DELETE | /v1/courses/{courseId}/teachers/{userId} | Removes the specified teacher from the specified course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not perm |
| GET | /v1/courses/{courseId}/topics | Returns the list of topics that the requester is permitted to view. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user |
| POST | /v1/courses/{courseId}/topics | Creates a topic. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, cr |
| GET | /v1/courses/{courseId}/topics/{id} | Returns a topic. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or |
| PATCH | /v1/courses/{courseId}/topics/{id} | Updates one or more fields of a topic. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create t |
| DELETE | /v1/courses/{courseId}/topics/{id} | Deletes a topic. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not allowed to delete the requested topic or for |
| GET | /v1/courses/{id} | Returns a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or |
| PUT | /v1/courses/{id} | Updates a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or |
| PATCH | /v1/courses/{id} | Updates one or more fields in a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify t |
| DELETE | /v1/courses/{id} | Deletes a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested course or |
| GET | /v1/invitations | Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. *Note:* At least one of `user_id` |
| POST | /v1/invitations | Creates an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes. This method returns th |
| GET | /v1/invitations/{id} | Returns an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view the requested invita |
| DELETE | /v1/invitations/{id} | Deletes an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested invi |
| POST | /v1/invitations/{id}:accept | Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. Only the invited user may a |
| POST | /v1/registrations | Creates a `Registration`, causing Classroom to start sending notifications from the provided `feed` to the destination provided in `cloudPubSubTopic`. Returns t |
| DELETE | /v1/registrations/{registrationId} | Deletes a `Registration`, causing Classroom to stop sending notifications for that `Registration`. |
| GET | /v1/userProfiles/{studentId}/guardianInvitations | Returns a list of guardian invitations that the requesting user is permitted to view, filtered by the parameters provided. This method returns the following err |
| POST | /v1/userProfiles/{studentId}/guardianInvitations | Creates a guardian invitation, and sends an email to the guardian asking them to confirm that they are the student's guardian. Once the guardian accepts the inv |
| GET | /v1/userProfiles/{studentId}/guardianInvitations/{invitationId} | Returns a specific guardian invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view gua |
| PATCH | /v1/userProfiles/{studentId}/guardianInvitations/{invitationId} | Modifies a guardian invitation. Currently, the only valid modification is to change the `state` from `PENDING` to `COMPLETE`. This has the effect of withdrawing |
| GET | /v1/userProfiles/{studentId}/guardians | Returns a list of guardians that the requesting user is permitted to view, restricted to those that match the request. To list guardians for any student that th |
| GET | /v1/userProfiles/{studentId}/guardians/{guardianId} | Returns a specific guardian. This method returns the following error codes: * `PERMISSION_DENIED` if no user that matches the provided `student_id` is visible t |
| DELETE | /v1/userProfiles/{studentId}/guardians/{guardianId} | Deletes a guardian. The guardian will no longer receive guardian notifications and the guardian will no longer be accessible via the API. This method returns th |
| GET | /v1/userProfiles/{userId} | Returns a user profile. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access this user profile |
Questions
Does the Google Classroom API API need an API key?
Yes. The Google Classroom API API uses OAuth authentication; the documentation explains how to get credentials.
Does the Google Classroom API API support HTTPS?
Yes, the Google Classroom API API is served over HTTPS.
How many endpoints does the Google Classroom API API have?
Its OpenAPI description lists 61 endpoints in version v1. All of them are shown on this page.
What are alternatives to the Google Classroom API API?
Other Analytics APIs include Google Play Integrity API, versionhistory.googleapis.com API, Doc Converter, Perspective Comment Analyzer API, Safe Browsing API.
Similar analytics APIs
Compare alternatives →Google Play Integrity API
AnalyticsThe Play Integrity API helps you check that you're interacting with your genuine app on a genuine Android device powered by Google Play services. The Play Integrity API has replaced SafetyNet Attestation and Android Device Verification.
versionhistory.googleapis.com API
AnalyticsVersion History API - Prod
Doc Converter
AnalyticsThis api converts file formats of OpenXml and OpenOffice documents formats to vector files (e.g., svg)
Perspective Comment Analyzer API
AnalyticsThe Perspective Comment Analyzer API provides information about the potential impact of a comment on a conversation (e.g. it can provide a score for the "toxicity" of a comment). Users can leverage the "SuggestCommentScore" method to submit corrections to improve Perspective over time. Users can set the "doNotStore" flag to ensure that all submitted comments are automatically deleted after scores are returned.
Safe Browsing API
AnalyticsEnables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources. The Safe Browsing APIs are for non-commercial use only. If you need to use APIs to detect malicious URLs for commercial purposes – meaning “for sale or revenue-generating purposes” – please refer to the Web Risk API.
Web Fonts Developer API
AnalyticsThe Google Web Fonts Developer API lets you retrieve information about web fonts served by Google.
Listed from APIs.guru (CC0).