Method: users.insert
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
创建用户。
在创建用户后立即进行的更改调用有时可能会失败,因为由于后端存在传播延迟,用户未完全创建。请查看“用户创建未完成”消息的错误详情,看看是否存在这种情况。在这种情况下,过一段时间后重试调用可能会有所帮助。
如果 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
如需了解详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):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)."]]