Prerequisites
The connector should already be set up, with a Connector Profile and a Linked Account. See Getting Started on the Google Directory connector page.Automatic notification channels
StackOne creates and manages the Google Directory notification channels automatically when the account is connected, and stops them when the account is disconnected. You don’t need to set anything up in the Google Admin console or the Google Cloud Console.
Select events in StackOne
Enable the webhook events you want on the Google Directory connector in StackOne. Google Directory watches one event type per notification channel, so StackOne creates one channel for each selected event. Each channel covers every domain on the Google Workspace account.
Connect with an administrator account
Only a Google Workspace administrator can create notification channels. Connect the account as an administrator with the https://www.googleapis.com/auth/admin.directory.user scope, which the connector requests by default. A non-administrator account connects, but Google rejects its channels and no events are delivered.
Connect the account again when channels expire
Google ends every notification channel 2 days after it is created, and StackOne does not create replacements on its own. When events stop arriving, reconnect the account in StackOne Hub. StackOne stops the old channels and creates new ones for the selected events.
Available webhook events
The following Google Directory events can be enabled. Only events selected in StackOne get a notification channel, and Google Directory does not deliver changes for event types that are not watched.
Select user events
Events related to users on the Google Workspace account.
- User Created (
add) — Fired when a user is created - User Updated (
update) — Fired when a user is updated - User Admin Status Changed (
makeAdmin) — Fired when a user is made a super administrator or loses super administrator status - User Deleted (
delete) — Fired when a user is deleted - User Undeleted (
undelete) — Fired when a deleted user is restored
Delivery format
Details of how Google Directory delivers events to StackOne.
Retrieve the changed user
Each notification identifies the user by ID and primary email address. It does not say which fields changed, or whether admin status was granted or revoked. Fetch the full user with get_user; for a deleted user, use list_users with showDeleted set to true.
Check the event payload
Each event’s ID is the Google user ID. The event data holds the user’s ID, primary email address, and the notification’s kind and etag, plus the notification headers: resource state, channel ID, resource ID, resource URI, message number, and the channel’s expiry date.
- Google does not guarantee delivery of every notification, so run a periodic sync as a fallback.