Create a guest user with access to a [subset of Workspace capabilities](https://support.google.com/a/answer/16558545).

### HTTP request

`POST https://admin.googleapis.com/admin/directory/v1/users:createGuest`

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

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "primaryGuestEmail": string, "customer": string } ``` |

| Fields ||
|---|---|
| `primaryGuestEmail` | `string` Required. External email of the guest user being created. |
| `customer` | `string` Optional. Immutable ID of the Google Workspace account. Only required when request is created by a service account. Defaults to the authenticated user's customer ID otherwise. |

### Response body

If successful, the response body contains an instance of `https://developers.google.com/workspace/admin/directory/reference/rest/v1/users#User`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/admin.directory.user`

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