Method: users.insert
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ユーザーを作成する。
ユーザーの作成直後の Mutate 呼び出しは、バックエンドの伝播遅延によりユーザーが完全に作成されていないため、失敗することがあります。「ユーザーの作成が完了していません」というメッセージのエラーの詳細を確認して、この問題かどうかを判断します。この場合は、しばらくしてから呼び出しを再試行すると解決することがあります。
resolveConflictAccount
が true
に設定されている場合、202
レスポンス コードは、競合する管理対象外アカウントが存在し、組織への参加が招待されたことを意味します。409
レスポンス コードは、競合するアカウントが存在するため、選択した管理対象外のユーザー アカウントの処理オプションに基づいてユーザーが作成されなかったことを意味します。
HTTP リクエスト
POST https://admin.googleapis.com/admin/directory/v1/users
この URL は gRPC Transcoding 構文を使用します。
クエリ パラメータ
パラメータ |
resolveConflictAccount |
boolean
省略可。true に設定すると、管理対象外ユーザーのアカウントを処理するために選択したオプションが適用されます。デフォルト: false
|
リクエストの本文
リクエストの本文には User
のインスタンスが含まれます。
レスポンスの本文
成功した場合、レスポンスの本文には、新しく作成された User
のインスタンスが含まれます。
認可スコープ
次の OAuth スコープが必要です。
https://www.googleapis.com/auth/admin.directory.user
詳しくは、認可ガイドをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-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)."]]