- [HTTP request](https://developers.google.com/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations/patch#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations/patch#body.PATH_PARAMETERS)
- [Query parameters](https://developers.google.com/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations/patch#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations/patch#body.request_body)
- [Response body](https://developers.google.com/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations/patch#body.response_body)
- [Authorization scopes](https://developers.google.com/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations/patch#body.aspect)
- [Try it!](https://developers.google.com/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations/patch#try-it)

Modifies a guardian invitation.

Currently, the only valid modification is to change the `state` from `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation.

This method returns the following error codes:

- `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if guardians are not enabled for the domain in question or for other [access errors](https://developers.google.com/workspace/classroom/reference/Access.Errors).
- `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state.
- `INVALID_ARGUMENT` if the format of the student ID provided cannot be recognized (it is not an email address, nor a `userId` from this API), or if the passed `GuardianInvitation` has a `state` other than `COMPLETE`, or if it modifies fields other than `state`.
- `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student, or if the `id` field does not refer to a guardian invitation known to Classroom.

### HTTP request

`PATCH https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `studentId` | `string` The ID of the student whose guardian invitation is to be modified. |
| `invitationId` | `string` The `id` field of the `GuardianInvitation` to be modified. |

### Query parameters

| Parameters ||
|---|---|
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Mask that identifies which fields on the course to update. This field is required to do an update. The update fails if invalid fields are specified. The following fields are valid: - `state` When set in a query parameter, this field should be specified as `updateMask=<field1>,<field2>,...` This is a comma-separated list of fully qualified names of fields. Example: `"user.displayName,photo"`. |

### Request body

The request body contains an instance of `https://developers.google.com/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations#GuardianInvitation`.

### Response body

If successful, the response body contains an instance of `https://developers.google.com/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations#GuardianInvitation`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/classroom.guardianlinks.students`

For more information, see the [Authorization guide](https://developers.google.com/workspace/guides/configure-oauth-consent).