Method: users.watch
Stay organized with collections
Save and categorize content based on your preferences.
Watches for changes in users list.
HTTP request
POST https://admin.googleapis.com/admin/directory/v1/users/watch
The URL uses gRPC Transcoding syntax.
Query parameters
Parameters |
domain |
string
Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead."
|
customer |
string
Immutable ID of the Google Workspace account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain.
|
event |
enum (EventType )
Events to watch for.
|
customFieldMask |
string
Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.
|
maxResults |
integer
Maximum number of results to return.
|
orderBy |
enum (OrderBy )
Column to use for sorting results
|
pageToken |
string
Token to specify next page in the list
|
projection |
enum (Projection )
What subset of fields to fetch for this user.
|
query |
string
Query string search. Should be of the form "". Complete documentation is at https: //developers.google.com/workspace/admin/directory/v1/guides/search-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.
|
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 contains an instance of SubscriptionChannel
.
Response body
If successful, the response body contains an instance of SubscriptionChannel
.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/admin.directory.user
https://www.googleapis.com/auth/admin.directory.user.readonly
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authorization guide.
EventType
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 fields for the user. |
CUSTOM |
Include custom fields from schemas mentioned in customFieldMask. |
FULL |
Include all fields associated with this user. |
SortOrder
Enums |
ASCENDING |
Ascending order. |
DESCENDING |
Descending order. |
ViewType
Enums |
admin_view |
Results include both administrator-only and domain-public fields. |
domain_public |
Results only include fields for the user that are publicly visible to other users in the domain. |
Except as otherwise noted, the content of this 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 affiliates.
Last updated 2025-03-25 UTC.
[null,null,["Last updated 2025-03-25 UTC."],[],[],null,["# Method: users.watch\n\nWatches for changes in users list.\n\n### HTTP request\n\n`POST https://admin.googleapis.com/admin/directory/v1/users/watch`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `domain` | `string` Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead.\" |\n| `customer` | `string` Immutable ID of the Google Workspace account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain. |\n| `event` | `enum (`[EventType](/workspace/admin/directory/reference/rest/v1/users/watch#EventType)`)` Events to watch for. |\n| `customFieldMask` | `string` Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom. |\n| `maxResults` | `integer` Maximum number of results to return. |\n| `orderBy` | `enum (`[OrderBy](/workspace/admin/directory/reference/rest/v1/users/watch#OrderBy)`)` Column to use for sorting results |\n| `pageToken` | `string` Token to specify next page in the list |\n| `projection` | `enum (`[Projection](/workspace/admin/directory/reference/rest/v1/users/watch#Projection)`)` What subset of fields to fetch for this user. |\n| `query` | `string` Query string search. Should be of the form \"\". Complete documentation is at https: //developers.google.com/workspace/admin/directory/v1/guides/search-users |\n| `showDeleted` | `string` If set to true, retrieves the list of deleted users. (Default: false) |\n| `sortOrder` | `enum (`[SortOrder](/workspace/admin/directory/reference/rest/v1/users/watch#SortOrder)`)` Whether to return results in ascending or descending order. |\n| `viewType` | `enum (`[ViewType](/workspace/admin/directory/reference/rest/v1/users/watch#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](https://developers.google.com/workspace/admin/directory/v1/guides/manage-users#retrieve_users_non_admin). |\n\n### Request body\n\nThe request body contains an instance of [SubscriptionChannel](/workspace/admin/directory/reference/rest/v1/SubscriptionChannel).\n\n### Response body\n\nIf successful, the response body contains an instance of [SubscriptionChannel](/workspace/admin/directory/reference/rest/v1/SubscriptionChannel).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/admin.directory.user`\n- `\n https://www.googleapis.com/auth/admin.directory.user.readonly`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nEventType\n---------\n\nType of the Subscription event\n\n| Enums ||\n|--------------|--------------------------------|\n| `ADD` | User Created Event |\n| `DELETE` | User Deleted Event |\n| `MAKE_ADMIN` | User Admin Status Change Event |\n| `UNDELETE` | User Undeleted Event |\n| `UPDATE` | User Updated Event |\n\nOrderBy\n-------\n\n| Enums ||\n|---------------|----------------------------|\n| `EMAIL` | Primary email of the user. |\n| `FAMILY_NAME` | User's family name. |\n| `GIVEN_NAME` | User's given name. |\n\nProjection\n----------\n\n| Enums ||\n|----------|------------------------------------------------------------------|\n| `BASIC` | Do not include any custom fields for the user. |\n| `CUSTOM` | Include custom fields from schemas mentioned in customFieldMask. |\n| `FULL` | Include all fields associated with this user. |\n\nSortOrder\n---------\n\n| Enums ||\n|--------------|-------------------|\n| `ASCENDING` | Ascending order. |\n| `DESCENDING` | Descending order. |\n\nViewType\n--------\n\n| Enums ||\n|-----------------|--------------------------------------------------------------------------------------------------|\n| `admin_view` | Results include both administrator-only and domain-public fields. |\n| `domain_public` | Results only include fields for the user that are publicly visible to other users in the domain. |"]]