# REST Resource: customers.userinvitations

## Resource: UserInvitation

The `UserInvitation` resource represents an email that can be sent to an unmanaged user account inviting them to join the customer's Google Workspace or Cloud Identity account. An unmanaged account shares an email address domain with the Google Workspace or Cloud Identity account but is not managed by it yet. If the user accepts the `UserInvitation`, the user account will become managed.

| JSON representation |
|---|
| ``` { "name": string, "state": enum (`https://docs.cloud.google.com/identity/docs/reference/rest/v1/customers.userinvitations#State`), "mailsSentCount": string, "updateTime": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Shall be of the form `customers/{customer}/userinvitations/{user_email_address}`. |
| `state` | ``enum (`https://docs.cloud.google.com/identity/docs/reference/rest/v1/customers.userinvitations#State`)`` State of the `UserInvitation`. |
| `mailsSentCount` | `string (https://developers.google.com/discovery/v1/type-format format)` Number of invitation emails sent to the user. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Time when the `UserInvitation` was last updated. 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"`. |

## State

State of the invitation.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | The default value. This value is used if the state is omitted. |
| `NOT_YET_SENT` | The `UserInvitation` has been created and is ready for sending as an email. |
| `INVITED` | The user has been invited by email. |
| `ACCEPTED` | The user has accepted the invitation and is part of the organization. |
| `DECLINED` | The user declined the invitation. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/identity/docs/reference/rest/v1/customers.userinvitations/cancel` | Cancels a `https://docs.cloud.google.com/identity/docs/reference/rest/v1/customers.userinvitations#UserInvitation` that was already sent. |
| ### `https://docs.cloud.google.com/identity/docs/reference/rest/v1/customers.userinvitations/get` | Retrieves a `https://docs.cloud.google.com/identity/docs/reference/rest/v1/customers.userinvitations#UserInvitation` resource. |
| ### `https://docs.cloud.google.com/identity/docs/reference/rest/v1/customers.userinvitations/isInvitableUser` | Verifies whether a user account is eligible to receive a `https://docs.cloud.google.com/identity/docs/reference/rest/v1/customers.userinvitations#UserInvitation` (is an unmanaged account). |
| ### `https://docs.cloud.google.com/identity/docs/reference/rest/v1/customers.userinvitations/list` | Retrieves a list of `https://docs.cloud.google.com/identity/docs/reference/rest/v1/customers.userinvitations#UserInvitation` resources. |
| ### `https://docs.cloud.google.com/identity/docs/reference/rest/v1/customers.userinvitations/send` | Sends a `https://docs.cloud.google.com/identity/docs/reference/rest/v1/customers.userinvitations#UserInvitation` to email. |