REST Resource: users
Stay organized with collections
Save and categorize content based on your preferences.
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 administrator 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. Fields
The user's email address. Also serves as the email ID. This value can be the user's primary email address or an alias.
If the email address
Indicates if this is the user's primary email. Only one entry can be marked as primary.
The type of the email account. If set to |
externalIds |
The list of external IDs for the user, such as an employee or network ID. The maximum allowed data size is 2KB. Fields
If the external ID
The type of external ID. If set to
The value of the external ID. |
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. Fields
If the relationship
The type of relationship. If set to
The email address of the person the user is related to. |
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. Fields
Country.
If the address
For extended addresses, such as an address that includes a sub-region.
A full and unstructured postal address. This is not synced with the structured address fields. Includes the following attributes: street address, P.O. box, city, state/province, ZIP/postal code, country/region.
The town or city of the address.
The post office box, if present.
The ZIP or postal code, if applicable.
If this is the user's primary address. The addresses list may contain only one primary address.
The abbreviated province or state.
Indicates if the user-supplied address was formatted. Formatted addresses are not currently supported.
The street address, such as
The address type. If set to |
organizations |
The list of organizations the user belongs to. The maximum allowed data size is 10KB. Fields
The cost center of the user's organization.
If the value of type is custom, this property contains the custom type.
Specifies the department within the organization, such as
The description of the organization.
The domain the organization belongs to.
The full-time equivalent millipercent within the organization (100000 = 100%).
The physical location of the organization. This does not need to be a fully qualified address.
The name of the organization.
Indicates if this is the user's primary organization. A user may only have one primary organization.
Text string symbol of the organization. For example, the text symbol for Google is
The user's title within the organization. For example,
The type of organization. |
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. Fields
If the phone number
If
The type of phone number. If set to
A human-readable phone number. It may be in any telephone number format. |
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. Fields
Other language. User can provide their own language name if there is no corresponding ISO 639 language code. If this is set,
ISO 639 string representation of a language. See Language Codes for the list of supported codes. Valid language codes outside the supported set will be accepted by the API but may lead to unexpected behavior. Illegal values cause
Optional. If present, controls whether the specified |
posixAccounts |
The list of POSIX account information for the user. Fields
A POSIX account field identifier.
The path to the home directory for this account.
The operating system type for this account.
If this is user's primary account within the SystemId.
The path to the login shell for this account.
System identifier for which account Username or Uid apply to.
The POSIX compliant user ID.
The username of the account. |
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. Fields
An expiration time in microseconds since epoch.
A SHA-256 fingerprint of the SSH public key. (Read-only)
An SSH public key. |
notes |
Notes for the user as a nested object. Fields
Content type of note, either plain text or HTML. Default is plain text.
Contents of notes. |
websites |
The list of the user's websites. Fields
If the website
If
The type or purpose of the website. For example, a website could be labeled as
The URL of the website. |
locations |
The list of the user's locations. The maximum allowed data size is 10KB. Fields
Required. Textual location. This is most useful for display purposes to concisely describe the location. For example,
Building identifier.
If the location
Most specific textual code of individual desk location.
Floor name/number.
Floor section. More specific location within the floor. For example, if a floor is divided into sections
The location type. If set to |
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. Fields
If the keyword
Each entry can have a type which indicates standard type of that entry.
Keyword. |
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. Fields
A human-readable string containing the proper way to refer to the profile owner by humans, for example "he/him/his" or "they/them/their."
Name of a custom gender.
The type of gender.
|
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 Fields
If the protocol value is
If the IM
The user's IM network ID.
If this is the user's primary IM. Only one entry in the IM list can have a value of true.
An IM protocol identifies the IM network. The value can be a custom network or the standard network.
The type of IM account. If set to |
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. |
isGuestUser |
Immutable. Indicates if the inserted user is a guest. |
guestAccountInfo |
Immutable. Additional guest-related metadata fields |
suspensionTime |
Output only. User's account suspension time. (Read-only) |
archivalTime |
Output only. User's account archival time. (Read-only) |
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. |
GuestAccountInfo
Account info specific to Guest users.
| JSON representation |
|---|
{ "primaryGuestEmail": string } |
| Fields | |
|---|---|
primaryGuestEmail |
Immutable. The guest's external email. |
Methods |
|
|---|---|
|
Create a guest user with access to a subset of Workspace capabilities. |
|
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. |