Method: users.insert
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
لإنشاء مستخدم
قد يتعذّر أحيانًا تنفيذ طلبات Mutate بعد إنشاء المستخدم مباشرةً لأنّه لم يتم إنشاء المستخدم بالكامل بسبب تأخّر النشر في الخلفيات. تحقَّق من تفاصيل الخطأ لرسالة "لم تكتمل عملية إنشاء المستخدم" لمعرفة ما إذا كان هذا هو السبب. يمكن أن تساعد إعادة إجراء المكالمات بعد بعض الوقت في هذه الحالة.
إذا تم ضبط resolveConflictAccount
على true
، يعني رمز الاستجابة 202
أنّ هناك حسابًا غير مُدار متضاربًا وتمّت دعوته للانضمام إلى المؤسسة. يعني رمز الاستجابة 409
أنّ هناك حسابًا متضاربًا، لذا لم يتم إنشاء المستخدم استنادًا إلى خيار التعامل مع حسابات المستخدمين غير المُدارة الذي تم اختياره.
طلب HTTP
POST https://admin.googleapis.com/admin/directory/v1/users
يستخدِم عنوان URL بنية تحويل ترميز gRPC.
مَعلمات طلب البحث
المعلمات |
resolveConflictAccount |
boolean
اختياريّ. في حال ضبط القيمة على true ، سيتم تطبيق الخيار المحدّد للتعامل مع حسابات المستخدمين غير المُدارة. القيمة التلقائية: false
|
نص الطلب
يحتوي نص الطلب على مثال User
.
نص الاستجابة
إذا كانت الاستجابة ناجحة، يحتوي نص الاستجابة على مثيل تم إنشاؤه حديثًا من User
.
نطاقات التفويض
يجب توفير نطاق OAuth التالي:
https://www.googleapis.com/auth/admin.directory.user
لمزيد من المعلومات، يمكنك الاطّلاع على دليل التفويض.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 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)."]]