Method: users.insert
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
建立使用者。
在使用者建立程序完成前,立即呼叫 Mutate 可能會失敗,因為後端的傳播延遲可能導致使用者尚未完全建立。請檢查「未完成使用者建立程序」錯誤訊息的詳細資料,確認是否為此問題。在這種情況下,稍後重試呼叫可能有助於解決問題。
如果 resolveConflictAccount
設為 true
,202
回應代碼表示有相衝突的非受管帳戶,且已受邀加入機構。409
回應碼表示存在相衝突的帳戶,因此系統並未根據所選的處理非受管使用者帳戶選項建立使用者。
HTTP 要求
POST https://admin.googleapis.com/admin/directory/v1/users
這個網址使用 gRPC 轉碼語法。
查詢參數
參數 |
resolveConflictAccount |
boolean
選用設定。如果設為 true ,系統就會套用處理非受管使用者帳戶時所選的選項。預設值:false
|
回應主體
如果成功,回應主體會包含新建立的 User
例項。
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/admin.directory.user
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],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)."]]