Maton

Google Classroom

Access the Google Classroom API with managed OAuth authentication. Manage courses, coursework, students, teachers, announcements, and submissions.

Reference

List Courses

GET /v1/courses
GET /v1/courses?courseStates=ACTIVE
GET /v1/courses?teacherId=me
GET /v1/courses?studentId=me
GET /v1/courses?pageSize=10

Query Parameters:

  • courseStates - Filter by state: ACTIVE, ARCHIVED, PROVISIONED, DECLINED, SUSPENDED
  • teacherId - Filter by teacher ID (use me for current user)
  • studentId - Filter by student ID (use me for current user)
  • pageSize - Number of results per page (max 100)
  • pageToken - Token for next page

Response:

{
  "courses": [
    {
      "id": "825635865485",
      "name": "Introduction to Programming",
      "section": "Section A",
      "descriptionHeading": "CS 101",
      "description": "Learn the basics of programming",
      "ownerId": "102753038276005039640",
      "creationTime": "2026-02-14T01:53:58.991Z",
      "updateTime": "2026-02-14T01:53:58.991Z",
      "enrollmentCode": "3qsua37m",
      "courseState": "ACTIVE",
      "alternateLink": "https://classroom.google.com/c/ODI1NjM1ODY1NDg1",
      "guardiansEnabled": false
    }
  ],
  "nextPageToken": "..."
}

Get Course

GET /v1/courses/{courseId}

Create Course

POST /v1/courses
Content-Type: application/json

{
  "name": "Course Name",
  "section": "Section A",
  "descriptionHeading": "Course Title",
  "description": "Course description",
  "ownerId": "me"
}

Response:

{
  "id": "825637533405",
  "name": "Course Name",
  "section": "Section A",
  "ownerId": "102753038276005039640",
  "courseState": "PROVISIONED",
  "enrollmentCode": "abc123"
}

Update Course

PATCH /v1/courses/{courseId}?updateMask=name,description
Content-Type: application/json

{
  "name": "Updated Course Name",
  "description": "Updated description"
}

Note: Use updateMask query parameter to specify which fields to update.

Delete Course

DELETE /v1/courses/{courseId}

Note: Courses must be archived before deletion. To archive, update the course with courseState: "ARCHIVED".

List Course Work

GET /v1/courses/{courseId}/courseWork
GET /v1/courses/{courseId}/courseWork?courseWorkStates=PUBLISHED
GET /v1/courses/{courseId}/courseWork?orderBy=dueDate

Query Parameters:

  • courseWorkStates - Filter by state: PUBLISHED, DRAFT, DELETED
  • orderBy - Sort by: dueDate, updateTime
  • pageSize - Number of results per page
  • pageToken - Token for next page

Get Course Work

GET /v1/courses/{courseId}/courseWork/{courseWorkId}

Create Course Work

POST /v1/courses/{courseId}/courseWork
Content-Type: application/json

{
  "title": "Assignment Title",
  "description": "Assignment description",
  "workType": "ASSIGNMENT",
  "state": "PUBLISHED",
  "maxPoints": 100,
  "dueDate": {
    "year": 2026,
    "month": 3,
    "day": 15
  },
  "dueTime": {
    "hours": 23,
    "minutes": 59
  }
}

Work Types:

  • ASSIGNMENT - Regular assignment
  • SHORT_ANSWER_QUESTION - Short answer question
  • MULTIPLE_CHOICE_QUESTION - Multiple choice question

States:

  • DRAFT - Not visible to students
  • PUBLISHED - Visible to students

Update Course Work

PATCH /v1/courses/{courseId}/courseWork/{courseWorkId}?updateMask=title,description
Content-Type: application/json

{
  "title": "Updated Title",
  "description": "Updated description"
}

Delete Course Work

DELETE /v1/courses/{courseId}/courseWork/{courseWorkId}

List Student Submissions

GET /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions
GET /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions?states=TURNED_IN

Query Parameters:

  • states - Filter by state: NEW, CREATED, TURNED_IN, RETURNED, RECLAIMED_BY_STUDENT
  • userId - Filter by student ID
  • pageSize - Number of results per page
  • pageToken - Token for next page

Note: Course work must be in PUBLISHED state to list submissions.

Response:

{
  "studentSubmissions": [
    {
      "courseId": "825635865485",
      "courseWorkId": "825637404958",
      "id": "Cg4I8ufNwwYQ7tSZgYIB",
      "userId": "102753038276005039640",
      "creationTime": "2026-02-14T02:30:00.000Z",
      "state": "NEW",
      "alternateLink": "https://classroom.google.com/..."
    }
  ]
}

Get Student Submission

GET /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{submissionId}

Grade Submission

PATCH /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{submissionId}?updateMask=assignedGrade,draftGrade
Content-Type: application/json

{
  "assignedGrade": 95,
  "draftGrade": 95
}

Return Submission

POST /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{submissionId}:return
Content-Type: application/json

{}

List Teachers

GET /v1/courses/{courseId}/teachers

Response:

{
  "teachers": [
    {
      "courseId": "825635865485",
      "userId": "102753038276005039640",
      "profile": {
        "id": "102753038276005039640",
        "name": {
          "givenName": "John",
          "familyName": "Doe",
          "fullName": "John Doe"
        },
        "emailAddress": "john.doe@example.com"
      }
    }
  ]
}

Get Teacher

GET /v1/courses/{courseId}/teachers/{userId}

Add Teacher

POST /v1/courses/{courseId}/teachers
Content-Type: application/json

{
  "userId": "teacher@example.com"
}

Remove Teacher

DELETE /v1/courses/{courseId}/teachers/{userId}

List Students

GET /v1/courses/{courseId}/students

Get Student

GET /v1/courses/{courseId}/students/{userId}

Add Student

POST /v1/courses/{courseId}/students
Content-Type: application/json

{
  "userId": "student@example.com"
}

Remove Student

DELETE /v1/courses/{courseId}/students/{userId}

List Announcements

GET /v1/courses/{courseId}/announcements
GET /v1/courses/{courseId}/announcements?announcementStates=PUBLISHED

Get Announcement

GET /v1/courses/{courseId}/announcements/{announcementId}

Create Announcement

POST /v1/courses/{courseId}/announcements
Content-Type: application/json

{
  "text": "Announcement text content",
  "state": "PUBLISHED"
}

States:

  • DRAFT - Not visible to students
  • PUBLISHED - Visible to students

Update Announcement

PATCH /v1/courses/{courseId}/announcements/{announcementId}?updateMask=text
Content-Type: application/json

{
  "text": "Updated announcement text"
}

Delete Announcement

DELETE /v1/courses/{courseId}/announcements/{announcementId}

List Topics

GET /v1/courses/{courseId}/topics

Get Topic

GET /v1/courses/{courseId}/topics/{topicId}

Create Topic

POST /v1/courses/{courseId}/topics
Content-Type: application/json

{
  "name": "Topic Name"
}

Update Topic

PATCH /v1/courses/{courseId}/topics/{topicId}?updateMask=name
Content-Type: application/json

{
  "name": "Updated Topic Name"
}

Delete Topic

DELETE /v1/courses/{courseId}/topics/{topicId}

List Course Work Materials

GET /v1/courses/{courseId}/courseWorkMaterials

Get Course Work Material

GET /v1/courses/{courseId}/courseWorkMaterials/{courseWorkMaterialId}

List Invitations

GET /v1/invitations?courseId={courseId}
GET /v1/invitations?userId=me

Note: Either courseId or userId is required.

Create Invitation

POST /v1/invitations
Content-Type: application/json

{
  "courseId": "825635865485",
  "userId": "user@example.com",
  "role": "STUDENT"
}

Roles:

  • STUDENT
  • TEACHER
  • OWNER

Accept Invitation

POST /v1/invitations/{invitationId}:accept

Delete Invitation

DELETE /v1/invitations/{invitationId}

Get Current User

GET /v1/userProfiles/me

Response:

{
  "id": "102753038276005039640",
  "name": {
    "givenName": "John",
    "familyName": "Doe",
    "fullName": "John Doe"
  },
  "emailAddress": "john.doe@example.com",
  "permissions": [
    {
      "permission": "CREATE_COURSE"
    }
  ],
  "verifiedTeacher": false
}

Get User Profile

GET /v1/userProfiles/{userId}

List Course Aliases

GET /v1/courses/{courseId}/aliases

Resources

On this page