---
title: "PATCH /v1/userProfiles/{studentId}/guardianInvitations/{invitationId}"
method: PATCH
path: "/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}"
tags: ["userProfiles"]
---

# PATCH /v1/userProfiles/{studentId}/guardianInvitations/{invitationId}

`PATCH /v1/userProfiles/{studentId}/guardianInvitations/{invitationId}`

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. * `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 `user_id` 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.

## Path parameters

- `studentId` string, required
- `invitationId` string, required

## Query parameters

- `updateMask` string

## Request body

- GuardianInvitation — An invitation to become the guardian of a specified user, sent to a specified email address.
  - `invitationId` string — Unique identifier for this invitation. Read-only.
  - `studentId` string — ID of the student (in standard format)
  - `state` 'GUARDIAN_INVITATION_STATE_UNSPECIFIED' | 'PENDING' | 'COMPLETE' — The state that this invitation is in.
  - `invitedEmailAddress` string — Email address that the invitation was sent to. This field is only visible to domain administrators.
  - `creationTime` string, google-datetime — The time that this invitation was created. Read-only.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/classroom.md) · [All operations](https://skmtc.net/google/apis/classroom/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/classroom/revisions/1b98f151d40b/schema)
