Admin console
Workspace
Home Google Workspace Admin console
Reference
Was this helpful?
Send feedback
Method: users.list
On this page
HTTP request
Query parameters
Request body
Response body
Authorization scopes
Retrieves a paginated list of either
deleted users or all users in a domain.
HTTP request
GET
https://admin.googleapis.com/admi
n/directory/v1/users
The URL uses gRPC Transcoding syntax.
Query parameters
Parameters
customFieldMask
string
A comma-separated list of schema names.
All Relds from these schemas are fetched.
This should only be set when
projection=custom.
customer
string
The unique ID for the customer's Google
Workspace account. In case of a multi-
domain account, to fetch all groups for a
customer, use this Reld instead of domain.
You can also use the my_customer alias
to represent your account's customerId.
The customerId is also returned as part
of the Users resource. You must provide
either the customer or the domain
parameter.
domain
string
The domain name. Use this Reld to get
groups from only one domain. To return all
domains for a customer account, use the
customer query parameter instead. Either
the customer or the domain parameter
must be provided.
event
enum (Event)
Event on which subscription is intended (if
subscribing)
maxResults
integer
Maximum number of results to return.
orderBy
enum (OrderBy)
Property to use for sorting results.
pageToken
string
Token to specify next page in the list
projection
enum (Projection)
What subset of Relds to fetch for this user.
query
string
Query string for searching user Relds. For
more information on constructing user
queries, see Search for Users.
showDeleted
string
If set to true, retrieves the list of deleted
users. (Default: false)
sortOrder
enum (SortOrder)
Whether to return results in ascending or
descending order, ignoring case.
viewType
enum (ViewType)
Whether to fetch the administrator-only or
domain-wide public view of the user. For
more information, see Retrieve a user as a
non-administrator.
Request body
The request body must be empty.
Response body
If successful, the response body
contains data with the following
structure:
JSON representation
{
"kind": string,
"trigger_event": string,
"etag": string,
"users": [
{
object (User)
}
],
"nextPageToken": string
}
Fields
kind
string
Kind of resource this is.
trigger_event
string
Event that triggered this response (only
used in case of Push Response)
etag
string
ETag of the resource.
users[]
object (User)
A list of user objects.
nextPageToken
string
Token used to access next page of this
result.
Authorization scopes
Requires one of the following OAuth
scopes:
https://www.googleapis.com/a
uth/admin.directory.user
https://www.googleapis.com/a
uth/admin.directory.user.rea
donly
https://www.googleapis.com/a
uth/cloud-platform
For more information, see the
Authorization guide.
Event
Type of the Subscription event
Enums
ADD
User Created Event
DELETE
User Deleted Event
MAKE_ADMIN
User Admin Status Change Event
UNDELETE
User Undeleted Event
UPDATE
User Updated Event
OrderBy
Enums
EMAIL
Primary email of the user.
FAMILY_NAME
User's family name.
GIVEN_NAME
User's given name.
Projection
Enums
BASIC
Do not include any custom Relds for the
user.
CUSTOM
Include custom Relds from schemas
requested in customFieldMask.
FULL
Include all Relds associated with this user.
SortOrder
Enums
ASCENDING
Ascending order.
DESCENDING
Descending order.
ViewType
Enums
admin_view
Results include both administrator-only and
domain-public Relds for the user.
domain_public
Results only include Relds for the user that
are publicly visible to other users in the
domain.
Try this method
Call this method on live data and
see the result. Experiment with
authorization and 7eld settings. For
help, check the APIs Explorer
documentation.
Request parameters
customFieldMask
string
customer
string
domain
string
event
maxResults
integer
orderBy
pageToken
string
projection
query
string
showDeleted
string
sortOrder
viewType
Show standard parameters
Credentials
Google OAuth 2.0
OAuth 2.0 provides authenticated access to
an API. Show scopes
API key
An API key is a unique string that lets you
access an API.
Execute
By clicking above, I agree that my use of the
APIs Explorer is governed by the Terms and
Privacy Policy.
Was this helpful?
Send feedback
Recommended for
you
Search for users
You can search for users matching
certain attributes with the users.list()…
method of the Directory API. This
Updated Oct 9, 2023
method accepts the query parameter
which is a search query combining one
or more search clauses. Each search
Method: users.get
clause is made up of 3 parts: To
Retrieves a user. GET
https://admin.googleapis.com/admin…
The URL uses gRPC Transcoding
Updated May 18, 2023
syntax. string IdentiRes the user in the
API request. The value can be the
user's primary email address, alias
Manage Custom
email address, or User Fields
You can deRne custom Relds for users
on your domain by adding custom use…
schemas to the domain. You can use
Updated Oct 9, 2023
these Relds to store information such
as the projects your users work on,
their physical locations, their hire date,
Except as otherwise noted, the content of this
or whatever else Rts
page is licensed under the Creative Commons
Attribution 4.0 License, and code samples are
licensed under the Apache 2.0 License. For
details, see the Google Developers Site Policies.
Java is a registered trademark of Oracle and/or
its afliates.
Last updated 2023-06-27 UTC.
Blog
Twi!er
Code Samples
Codelabs
Videos
Google Workspace for Developers
Platform overview
Developer products
Developer support
Terms of Service
Tools
Admin console
Apps Script Dashboard
Google Cloud console
APIs Explorer
Connect
Blog
Newsletter
Twitter
YouTube
Android
Chrome
Firebase
Google Cloud Platform
All products
Terms | Privacy
Sign up for the Google for
Sub…
Developers newsletter
English