# REST Resource: invitations

- [Resource: Invitation](https://developers.google.com/workspace/classroom/reference/rest/v1/invitations#Invitation)
  - [JSON representation](https://developers.google.com/workspace/classroom/reference/rest/v1/invitations#Invitation.SCHEMA_REPRESENTATION)
- [CourseRole](https://developers.google.com/workspace/classroom/reference/rest/v1/invitations#CourseRole)
- [Methods](https://developers.google.com/workspace/classroom/reference/rest/v1/invitations#METHODS_SUMMARY)

## Resource: Invitation

An invitation to join a course.

| JSON representation |
|---|
| ``` { "id": string, "userId": string, "courseId": string, "role": enum (`https://developers.google.com/workspace/classroom/reference/rest/v1/invitations#CourseRole`) } ``` |

| Fields ||
|---|---|
| `id` | `string` Identifier assigned by Classroom. Read-only. |
| `userId` | `string` 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 |
| `courseId` | `string` Identifier of the course to invite the user to. |
| `role` | ``enum (`https://developers.google.com/workspace/classroom/reference/rest/v1/invitations#CourseRole`)`` Role to invite the user to have. Must not be `COURSE_ROLE_UNSPECIFIED`. |

## CourseRole

Possible roles a user may be invite to have.

| Enums ||
|---|---|
| `COURSE_ROLE_UNSPECIFIED` | No course role. |
| `STUDENT` | Student in the course. |
| `TEACHER` | Teacher of the course. |
| `OWNER` | Owner of the course. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/workspace/classroom/reference/rest/v1/invitations/accept` | Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. |
| ### `https://developers.google.com/workspace/classroom/reference/rest/v1/invitations/create` | Creates an invitation. |
| ### `https://developers.google.com/workspace/classroom/reference/rest/v1/invitations/delete` | Deletes an invitation. |
| ### `https://developers.google.com/workspace/classroom/reference/rest/v1/invitations/get` | Returns an invitation. |
| ### `https://developers.google.com/workspace/classroom/reference/rest/v1/invitations/list` | Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. |