Method: users.insert
Stay organized with collections
Save and categorize content based on your preferences.
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
, a 202
response code means that a conflicting unmanaged 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 based on the handling unmanaged user accounts option selected.
HTTP request
POST https://admin.googleapis.com/admin/directory/v1/users
The URL uses gRPC Transcoding syntax.
Query parameters
Parameters |
resolveConflictAccount |
boolean
Optional. If set to true , the option selected for handling unmanaged user accounts will apply. Default: false
|
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-25 UTC.
[null,null,["Last updated 2025-03-25 UTC."],[],[],null,["# Method: users.insert\n\nCreates a user.\n\nMutate 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.\n\nIf `resolveConflictAccount` is set to `true`, a `202` response code means that a conflicting unmanaged 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 based on the [handling unmanaged user accounts](https://support.google.com/a/answer/11112794) option selected.\n\n### HTTP request\n\n`POST https://admin.googleapis.com/admin/directory/v1/users`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `resolveConflictAccount` | `boolean` Optional. If set to `true`, the option selected for [handling unmanaged user accounts](https://support.google.com/a/answer/11112794) will apply. Default: `false` |\n\n### Request body\n\nThe request body contains an instance of [User](/workspace/admin/directory/reference/rest/v1/users#User).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [User](/workspace/admin/directory/reference/rest/v1/users#User).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/admin.directory.user`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]