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 will apply to resolve conflicting accounts:
- A
200response code indicates the user was created (or replaced an existing unmanaged personal account). - A
202response code means that a conflicting unmanaged personal account exists and was invited to join the organization. - A
409response 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 and Transfer unmanaged work accounts.
HTTP request
POST https://admin.googleapis.com/admin/directory/v1/users
The URL uses gRPC Transcoding syntax.
Query parameters
| Parameters | |
|---|---|
resolveConflictAccount |
Optional. Applies the option selected for Find and add unmanaged users to resolve conflicting accounts when set to |
Request body
The request body contains an instance of User.
Response body
If successful, the response body contains a newly created instance of User.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/admin.directory.user
For more information, see the Authorization guide.