Resource: User
The Directory API allows you to create and manage your account's users, user aliases, and user Google profile photos. For more information about common tasks, see the User Accounts Developer's Guide and the User Aliases Developer's Guide.
JSON representation |
---|
{
"id": string,
"primaryEmail": string,
"password": value,
"hashFunction": string,
"isAdmin": boolean,
"isDelegatedAdmin": boolean,
"agreedToTerms": boolean,
"suspended": boolean,
"changePasswordAtNextLogin": boolean,
"ipWhitelisted": boolean,
"name": {
object ( |
Fields | |||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
The unique ID for the user. A user |
||||||||||||||||||||||||||||||||||||||||||
primaryEmail |
The user's primary email address. This property is required in a request to create a user account. The |
||||||||||||||||||||||||||||||||||||||||||
password |
Stores the password for the user account. The user's password value is required when creating a user account. It's optional when updating a user and should only be provided if the user is updating their account password. The password value is never returned in the API's response body. |
||||||||||||||||||||||||||||||||||||||||||
hashFunction |
Stores the hash format of the
If rounds are specified as part of the prefix, they must be 10,000 or fewer. |
||||||||||||||||||||||||||||||||||||||||||
isAdmin |
Output only. Indicates a user with super admininistrator privileges. The |
||||||||||||||||||||||||||||||||||||||||||
isDelegatedAdmin |
Output only. Indicates if the user is a delegated administrator. |
||||||||||||||||||||||||||||||||||||||||||
agreedToTerms |
Output only. This property is |
||||||||||||||||||||||||||||||||||||||||||
suspended |
Indicates if user is suspended. |
||||||||||||||||||||||||||||||||||||||||||
changePasswordAtNextLogin |
Indicates if the user is forced to change their password at next login. This setting doesn't apply when the user signs in via a third-party identity provider. |
||||||||||||||||||||||||||||||||||||||||||
ipWhitelisted |
If |
||||||||||||||||||||||||||||||||||||||||||
name |
Holds the given and family names of the user, and the read-only |
||||||||||||||||||||||||||||||||||||||||||
kind |
Output only. The type of the API resource. For Users resources, the value is |
||||||||||||||||||||||||||||||||||||||||||
etag |
Output only. ETag of the resource. |
||||||||||||||||||||||||||||||||||||||||||
emails |
The list of the user's email addresses. The maximum allowed data size is 10KB.
|
||||||||||||||||||||||||||||||||||||||||||
externalIds |
The list of external IDs for the user, such as an employee or network ID. The maximum allowed data size is 2KB.
|
||||||||||||||||||||||||||||||||||||||||||
relations |
The list of the user's relationships to other users. The maximum allowed data size for this field is 2KB. For more information, see Manage user accounts.
|
||||||||||||||||||||||||||||||||||||||||||
aliases[] |
Output only. The list of the user's alias email addresses. |
||||||||||||||||||||||||||||||||||||||||||
isMailboxSetup |
Output only. Indicates if the user's Google mailbox is created. This property is only applicable if the user has been assigned a Gmail license. |
||||||||||||||||||||||||||||||||||||||||||
customerId |
Output only. The customer ID to retrieve all account users. |
||||||||||||||||||||||||||||||||||||||||||
addresses |
The list of the user's addresses. The maximum allowed data size is 10KB.
|
||||||||||||||||||||||||||||||||||||||||||
organizations |
The list of organizations the user belongs to. The maximum allowed data size is 10KB.
|
||||||||||||||||||||||||||||||||||||||||||
lastLoginTime |
Output only. The last time the user logged into the user's account. The value is in ISO 8601 date and time format. The time is the complete date plus hours, minutes, and seconds in the form |
||||||||||||||||||||||||||||||||||||||||||
phones |
A list of the user's phone numbers. The maximum allowed data size is 1KB.
|
||||||||||||||||||||||||||||||||||||||||||
suspensionReason |
Output only. Has the reason a user account is suspended either by the administrator or by Google at the time of suspension. The property is returned only if the |
||||||||||||||||||||||||||||||||||||||||||
thumbnailPhotoUrl |
Output only. The URL of the user's profile photo. The URL might be temporary or private. |
||||||||||||||||||||||||||||||||||||||||||
languages |
The list of the user's languages. The maximum allowed data size is 1KB.
|
||||||||||||||||||||||||||||||||||||||||||
posixAccounts |
The list of POSIX account information for the user.
|
||||||||||||||||||||||||||||||||||||||||||
creationTime |
Output only. The time the user's account was created. The value is in ISO 8601 date and time format. The time is the complete date plus hours, minutes, and seconds in the form |
||||||||||||||||||||||||||||||||||||||||||
nonEditableAliases[] |
Output only. The list of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain. |
||||||||||||||||||||||||||||||||||||||||||
sshPublicKeys |
A list of SSH public keys.
|
||||||||||||||||||||||||||||||||||||||||||
notes |
Notes for the user as a nested object.
|
||||||||||||||||||||||||||||||||||||||||||
websites |
The list of the user's websites.
|
||||||||||||||||||||||||||||||||||||||||||
locations |
The list of the user's locations. The maximum allowed data size is 10KB.
|
||||||||||||||||||||||||||||||||||||||||||
includeInGlobalAddressList |
Indicates if the user's profile is visible in the Google Workspace global address list when the contact sharing feature is enabled for the domain. For more information about excluding user profiles, see the administration help center. |
||||||||||||||||||||||||||||||||||||||||||
keywords |
The list of the user's keywords. The maximum allowed data size is 1KB.
|
||||||||||||||||||||||||||||||||||||||||||
deletionTime |
Output only. The time the user's account was deleted. The value is in ISO 8601 date and time format. The time is the complete date plus hours, minutes, and seconds in the form |
||||||||||||||||||||||||||||||||||||||||||
gender |
A nested object containing the user's gender. Maximum allowed data size for this field is 1KB.
|
||||||||||||||||||||||||||||||||||||||||||
thumbnailPhotoEtag |
Output only. ETag of the user's photo (Read-only) |
||||||||||||||||||||||||||||||||||||||||||
ims |
The user's Instant Messenger (IM) accounts. A user account can have multiple
|
||||||||||||||||||||||||||||||||||||||||||
customSchemas |
Custom fields of the user. The key is a
|
||||||||||||||||||||||||||||||||||||||||||
isEnrolledIn2Sv |
Output only. Is enrolled in 2-step verification (Read-only) |
||||||||||||||||||||||||||||||||||||||||||
isEnforcedIn2Sv |
Output only. Is 2-step verification enforced (Read-only) |
||||||||||||||||||||||||||||||||||||||||||
archived |
Indicates if user is archived. |
||||||||||||||||||||||||||||||||||||||||||
orgUnitPath |
The full path of the parent organization associated with the user. If the parent organization is the top-level, it is represented as a forward slash ( |
||||||||||||||||||||||||||||||||||||||||||
recoveryEmail |
Recovery email of the user. |
||||||||||||||||||||||||||||||||||||||||||
recoveryPhone |
Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: +16506661212. |
UserName
JSON representation |
---|
{ "fullName": string, "familyName": string, "givenName": string, "displayName": string } |
Fields | |
---|---|
fullName |
The user's full name formed by concatenating the first and last name values. |
familyName |
The user's last name. Required when creating a user account. |
givenName |
The user's first name. Required when creating a user account. |
displayName |
The user's display name. Limit: 256 characters. |
Methods |
|
---|---|
|
Deletes a user. |
|
Retrieves a user. |
|
Creates a user. |
|
Retrieves a paginated list of either deleted users or all users in a domain. |
|
Makes a user a super administrator. |
|
Updates a user using patch semantics. |
|
Signs a user out of all web and device sessions and reset their sign-in cookies. |
|
Undeletes a deleted user. |
|
Updates a user. |
|
Watches for changes in users list. |