Method: users.insert
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
יצירת משתמש.
לפעמים קריאות Mutate מיד אחרי יצירת משתמש עלולות להיכשל כי המשתמש לא נוצר במלואו בגלל עיכוב בהפצה בקצוות העורפי שלנו. כדי לבדוק אם זה המצב, בודקים את פרטי השגיאה של ההודעה 'יצירת המשתמש לא הושלמה'. במקרה כזה, כדאי לנסות שוב לבצע את השיחות אחרי זמן מה.
אם השדה resolveConflictAccount
מוגדר כ-true
, קוד התגובה 202
מציין שיש חשבון לא מנוהל עם מאפיינים זהים שקיבל הזמנה להצטרף לארגון. קוד התגובה 409
מציין שקיימים חשבונות בעלי מאפיינים זהים, ולכן המשתמש לא נוצר על סמך האפשרות שנבחרה בטיפול בחשבונות משתמשים לא מנוהלים.
בקשת HTTP
POST https://admin.googleapis.com/admin/directory/v1/users
כתובת ה-URL משתמשת בתחביר של Transcoding של 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 (שעון 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)."]]