Google Classroom Invitations API

The Invitations API from Google Classroom — 1 operation(s) for invitations.

GitHub OpenAPI

Operations 5

GET /v1/invitations/{id} Get invitations #
DELETE /v1/invitations/{id} Delete invitations #
GET /v1/invitations List invitations #
POST /v1/invitations Create invitations #
POST /v1/invitations/{id}:accept Accept invitations #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/google-classroom:google-classroom-invitations-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

google-classroom-invitations-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Google Classroom API Invitations API
  version: v1
  description: Generated from Google's published Discovery document for Google Classroom API (classroom v1, revision 20261108).
    5 operation(s).
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
externalDocs:
  url: https://developers.google.com/workspace/classroom/
servers:
- url: https://classroom.googleapis.com
paths:
  /v1/invitations/{id}:
    get:
      operationId: classroom.invitations.get
      summary: Get invitations
      description: 'Returns an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting
        user is not permitted to view the requested invitation or for access errors. * `NOT_FOUND` if no invitation exists
        with the requested ID.'
      parameters:
      - name: id
        in: path
        required: true
        description: Identifier of the invitation to return.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invitation'
        4XX:
          content: &id001
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content: *id001
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/classroom.rosters
        - https://www.googleapis.com/auth/classroom.rosters.readonly
      - apiKey: []
      tags:
      - Invitations
    delete:
      operationId: classroom.invitations.delete
      summary: Delete invitations
      description: 'Deletes an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting
        user is not permitted to delete the requested invitation or for access errors. * `NOT_FOUND` if no invitation exists
        with the requested ID.'
      parameters:
      - name: id
        in: path
        required: true
        description: Identifier of the invitation to delete.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
        4XX:
          content: &id002
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content: *id002
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/classroom.rosters
      - apiKey: []
      tags:
      - Invitations
  /v1/invitations:
    get:
      operationId: classroom.invitations.list
      summary: List invitations
      description: '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` or `course_id` must be supplied. Both fields can be supplied.
        This method returns the following error codes: * `PERMISSION_DENIED` for access errors.'
      parameters:
      - name: courseId
        in: query
        required: false
        description: Restricts returned invitations to those for a course with the specified identifier.
        schema:
          type: string
      - name: pageSize
        in: query
        required: false
        description: Maximum number of items to return. The default is 500 if unspecified or `0`. The server may return fewer
          than the specified number of results.
        schema:
          format: int32
          type: integer
      - name: pageToken
        in: query
        required: false
        description: nextPageToken value returned from a previous list call, indicating that the subsequent page of results
          should be returned. The list request must be otherwise identical to the one that resulted in this token.
        schema:
          type: string
      - name: userId
        in: query
        required: false
        description: 'Restricts returned invitations to those for a specific user. The identifier can be one of the following:
          * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the
          requesting user'
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListInvitationsResponse'
        4XX:
          content: &id003
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content: *id003
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/classroom.rosters
        - https://www.googleapis.com/auth/classroom.rosters.readonly
      - apiKey: []
      tags:
      - Invitations
    post:
      operationId: classroom.invitations.create
      summary: Create invitations
      description: '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 the following error codes: * `PERMISSION_DENIED` if the requesting
        user is not permitted to create invitations for this course or for access errors. * `NOT_FOUND` if the course or the
        user does not exist. * `FAILED_PRECONDITION`: * if the requested user''s account is disabled. * if the user already
        has this role or a role with greater permissions. * for the following request errors: * IneligibleOwner * `ALREADY_EXISTS`
        if an invitation for the specified user and course already exists.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Invitation'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invitation'
        4XX:
          content: &id004
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content: *id004
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/classroom.rosters
      - apiKey: []
      tags:
      - Invitations
  /v1/invitations/{id}:accept:
    post:
      operationId: classroom.invitations.accept
      summary: Accept invitations
      description: '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 accept an invitation. This method returns the following error codes:
        * `PERMISSION_DENIED` if the requesting user is not permitted to accept the requested invitation or for access errors.
        * `FAILED_PRECONDITION` for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached
        * UserGroupsMembershipLimitReached * `NOT_FOUND` if no invitation exists with the requested ID.'
      parameters:
      - name: id
        in: path
        required: true
        description: Identifier of the invitation to accept.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
        4XX:
          content: &id005
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content: *id005
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/classroom.rosters
      - apiKey: []
      tags:
      - Invitations
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: query
      name: key
      description: API key; accepted by methods that do not need user data.
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/classroom.student-submissions.me.readonly: View your course work and grades in
              Google Classroom
            https://www.googleapis.com/auth/classroom.courses: See, edit, create, and permanently delete your Google Classroom
              classes
            https://www.googleapis.com/auth/classroom.push-notifications: Receive notifications about your Google Classroom
              data
            https://www.googleapis.com/auth/classroom.coursework.students.readonly: View course work and grades for students
              in the Google Classroom classes you teach or administer
            https://www.googleapis.com/auth/classroom.announcements: View and manage announcements in Google Classroom
            https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly: View guardians for students in your
              Google Classroom classes
            https://www.googleapis.com/auth/classroom.guardianlinks.students: View and manage guardians for students in your
              Google Classroom classes
            https://www.googleapis.com/auth/classroom.profile.photos: View the profile photos of people in your classes
            https://www.googleapis.com/auth/classroom.coursework.students: Manage course work and grades for students in the
              Google Classroom classes you teach and view the course work and grades for classes you administer
            https://www.googleapis.com/auth/classroom.addons.teacher: See, create, and update its own attachments to posts
              in classes you teach in Google Classroom
            https://www.googleapis.com/auth/classroom.courseworkmaterials: See, edit, and create classwork materials in Google
              Classroom
            https://www.googleapis.com/auth/classroom.profile.emails: View the email addresses of people in your classes
            https://www.googleapis.com/auth/classroom.rosters: Manage your Google Classroom class rosters
            https://www.googleapis.com/auth/classroom.coursework.me.readonly: View your course work and grades in Google Classroom
            https://www.googleapis.com/auth/classroom.topics: See, create, and edit topics in Google Classroom
            https://www.googleapis.com/auth/classroom.student-submissions.students.readonly: View course work and grades for
              students in the Google Classroom classes you teach or administer
            https://www.googleapis.com/auth/classroom.coursework.me: See, create and edit coursework items including assignments,
              questions, and grades
            https://www.googleapis.com/auth/classroom.rosters.readonly: View your Google Classroom class rosters
            https://www.googleapis.com/auth/classroom.addons.student: See and update its own attachments to posts in Google
              Classroom
            https://www.googleapis.com/auth/classroom.courseworkmaterials.readonly: See all classwork materials for your Google
              Classroom classes
            https://www.googleapis.com/auth/classroom.announcements.readonly: View announcements in Google Classroom
            https://www.googleapis.com/auth/classroom.courses.readonly: View your Google Classroom classes
            https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly: View your Google Classroom guardians
            https://www.googleapis.com/auth/classroom.topics.readonly: View topics in Google Classroom
  schemas:
    Empty:
      description: 'A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs.
        A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc
        Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }'
      type: object
      properties: {}
    GoogleRpcError:
      type: object
      description: The error envelope every Google API returns.
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
            status:
              type: string
            details:
              type: array
              items:
                type: object
    Invitation:
      type: object
      properties:
        id:
          type: string
          description: Identifier assigned by Classroom. Read-only.
        courseId:
          description: Identifier of the course to invite the user to.
          type: string
        userId:
          type: string
          description: 'Identifier of the invited user. When specified as a parameter of a request, this identifier can be
            set to one of the following: * the numeric identifier for the user * the email address of the user * the string
            literal `"me"`, indicating the requesting user'
        role:
          description: Role to invite the user to have. Must not be `COURSE_ROLE_UNSPECIFIED`.
          type: string
          enum:
          - COURSE_ROLE_UNSPECIFIED
          - STUDENT
          - TEACHER
          - OWNER
      description: An invitation to join a course.
    ListInvitationsResponse:
      description: Response when listing invitations.
      properties:
        nextPageToken:
          description: Token identifying the next page of results to return. If empty, no further results are available.
          type: string
        invitations:
          items:
            $ref: '#/components/schemas/Invitation'
          type: array
          description: Invitations that match the list request.
      type: object
x-provenance:
  method: harvested
  publisher: Google
  source: https://classroom.googleapis.com/$discovery/rest?version=v1
  note: converted by discovery-to-openapi.py from Google's Discovery document (revision 20261108)