Creates a user.

Mutate calls immediately following user creation might sometimes fail as the user isn't fully created due to propagation delay in our backends. Check the error details for the "User creation is not complete" message to see if this is the case. Retrying the calls after some time can help in this case.

If `resolveConflictAccount` is set to `true`, the option selected for [Find and add unmanaged users](https://knowledge.workspace.google.com/admin/users/find-and-add-unmanaged-users) will apply to resolve conflicting accounts:

- A `200` response code indicates the user was created (or replaced an existing unmanaged personal account).
- A `202` response code means that a conflicting unmanaged personal account exists and was invited to join the organization.
- A `409` response code means that a conflicting account exists so the user wasn't created (e.g. based on the option selected to preserve the account, or if the email conflicts with an unmanaged work account or existing managed user).

For details on resolving duplicate account errors, see [Resolve duplicate account errors](https://knowledge.workspace.google.com/p/duplicate-account-errors) and [Transfer unmanaged work accounts](https://knowledge.workspace.google.com/p/unmanaged-work-accounts).

### HTTP request

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

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

### Query parameters

| Parameters ||
|---|---|
| `resolveConflictAccount` | `boolean` Optional. Applies the option selected for [Find and add unmanaged users](https://knowledge.workspace.google.com/admin/users/find-and-add-unmanaged-users) to resolve conflicting accounts when set to `true`. Default: `false` |

### Request body

The request body contains an instance of `https://developers.google.com/workspace/admin/directory/reference/rest/v1/users#User`.

### Response body

If successful, the response body contains a newly created 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).