- [Resource: Registration](https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#Registration)
  - [JSON representation](https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#Registration.SCHEMA_REPRESENTATION)
- [Feed](https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#Feed)
  - [JSON representation](https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#Feed.SCHEMA_REPRESENTATION)
- [FeedType](https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#FeedType)
- [CourseRosterChangesInfo](https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#CourseRosterChangesInfo)
  - [JSON representation](https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#CourseRosterChangesInfo.SCHEMA_REPRESENTATION)
- [CourseWorkChangesInfo](https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#CourseWorkChangesInfo)
  - [JSON representation](https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#CourseWorkChangesInfo.SCHEMA_REPRESENTATION)
- [CloudPubsubTopic](https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#CloudPubsubTopic)
  - [JSON representation](https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#CloudPubsubTopic.SCHEMA_REPRESENTATION)
- [Methods](https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#METHODS_SUMMARY)

## Resource: Registration

An instruction to Classroom to send notifications from the `feed` to the provided destination.

| JSON representation |
|---|
| ``` { "registrationId": string, "feed": { object (`https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#Feed`) }, "expiryTime": string, "cloudPubsubTopic": { object (`https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#CloudPubsubTopic`) } } ``` |

| Fields ||
|---|---|
| `registrationId` | `string` A server-generated unique identifier for this `Registration`. Read-only. |
| `feed` | ``object (`https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#Feed`)`` Specification for the class of notifications that Classroom should deliver to the destination. |
| `expiryTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The time until which the `Registration` is effective. This is a read-only field assigned by the server. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| Where notifications should be sent. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `cloudPubsubTopic` | ``object (`https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#CloudPubsubTopic`)`` The Cloud Pub/Sub topic that notifications are to be sent to. |
| End of mutually exclusive fields. ||

## Feed

A class of notifications that an application can register to receive. For example: "all roster changes for a domain".

| JSON representation |
|---|
| ``` { "feedType": enum (`https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#FeedType`), "courseRosterChangesInfo": { object (`https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#CourseRosterChangesInfo`) }, "courseWorkChangesInfo": { object (`https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#CourseWorkChangesInfo`) } } ``` |

| Fields ||
|---|---|
| `feedType` | ``enum (`https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#FeedType`)`` The type of feed. |
| Additional parameters about the feed. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `courseRosterChangesInfo` | ``object (`https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#CourseRosterChangesInfo`)`` Information about a `Feed` with a `feedType` of `COURSE_ROSTER_CHANGES`. This field must be specified if `feedType` is `COURSE_ROSTER_CHANGES`. |
| `courseWorkChangesInfo` | ``object (`https://developers.google.com/workspace/classroom/reference/rest/v1/registrations#CourseWorkChangesInfo`)`` Information about a `Feed` with a `feedType` of `COURSE_WORK_CHANGES`. This field must be specified if `feedType` is `COURSE_WORK_CHANGES`. |
| End of mutually exclusive fields. ||

## FeedType

A type of feed that an application can register for notifications from.

| Enums ||
|---|---|
| `FEED_TYPE_UNSPECIFIED` | Should never be returned or provided. |
| `DOMAIN_ROSTER_CHANGES` | All roster changes for a particular domain. Notifications will be generated whenever a user joins or leaves a course. No notifications will be generated when an invitation is created or deleted, but notifications will be generated when a user joins a course by accepting an invitation. |
| `COURSE_ROSTER_CHANGES` | All roster changes for a particular course. Notifications will be generated whenever a user joins or leaves a course. No notifications will be generated when an invitation is created or deleted, but notifications will be generated when a user joins a course by accepting an invitation. |
| `COURSE_WORK_CHANGES` | All course work activity for a particular course. Notifications will be generated when a CourseWork or StudentSubmission object is created or modified. No notification will be generated when a StudentSubmission object is created in connection with the creation or modification of its parent CourseWork object (but a notification will be generated for that CourseWork object's creation or modification). |

## CourseRosterChangesInfo

Information about a `Feed` with a `feedType` of `COURSE_ROSTER_CHANGES`.

| JSON representation |
|---|
| ``` { "courseId": string } ``` |

| Fields ||
|---|---|
| `courseId` | `string` The `courseId` of the course to subscribe to roster changes for. |

## CourseWorkChangesInfo

Information about a `Feed` with a `feedType` of `COURSE_WORK_CHANGES`.

| JSON representation |
|---|
| ``` { "courseId": string } ``` |

| Fields ||
|---|---|
| `courseId` | `string` The `courseId` of the course to subscribe to work changes for. |

## CloudPubsubTopic

A reference to a Cloud Pub/Sub topic.

To register for notifications, the owner of the topic must grant `classroom-notifications@system.gserviceaccount.com` the `projects.topics.publish` permission.

| JSON representation |
|---|
| ``` { "topicName": string } ``` |

| Fields ||
|---|---|
| `topicName` | `string` The `name` field of a Cloud Pub/Sub [Topic](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#Topic). |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/workspace/classroom/reference/rest/v1/registrations/create` | Creates a `Registration`, causing Classroom to start sending notifications from the provided `feed` to the destination provided in `cloudPubSubTopic`. |
| ### `https://developers.google.com/workspace/classroom/reference/rest/v1/registrations/delete` | Deletes a `Registration`, causing Classroom to stop sending notifications for that `Registration`. |