For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/actions/connections/google_workspace.md. A documentation index is available at /llms.txt.

Google Workspace

Use a Google Workspace connection to authenticate Datadog Actions against Google Workspace APIs. This allows you to interact with Gmail, Google Calendar, Google Drive, Google Docs, Google Sheets, Google Forms, and Google Chat in your workflows and apps.

Prerequisites

You must have an OAuth 2.0 client in Google Cloud to create a connection in Datadog. If you don’t already have a Google Cloud project, follow Google’s Create a Google Cloud project guide.

Enable the required APIs

Enable the Google APIs you plan to use in your workflows and apps:

  1. Navigate to APIs & Services > Library in the Google Cloud Console.
  2. Search for and enable the APIs for the Google Workspace services you intend to use, listed in the following table.
Google Workspace serviceAPI to enable
GmailGmail API
Google CalendarGoogle Calendar API
Google DriveGoogle Drive API
Google DocsGoogle Docs API
Google SheetsGoogle Sheets API
Google FormsGoogle Forms API
Google ChatGoogle Chat API
  1. Navigate to APIs & Services > OAuth consent screen in the Google Cloud Console.
  2. Select a user type:
    • Internal: Limits access to users in your Google Workspace organization. Recommended for most enterprise use cases.
    • External: Allows any Google account to authorize the app. Requires app verification for production use.
  3. Fill in the required app information fields and click Save and Continue.
  4. Under Scopes, add the OAuth scopes required for the actions you intend to use. See the scopes reference.
  5. Complete the remaining steps and click Back to Dashboard.

Create OAuth 2.0 credentials

  1. Navigate to APIs & Services > Credentials in the Google Cloud Console.
  2. Click Create Credentials > OAuth client ID.
  3. For Application type, select Web application.
  4. Under Authorized JavaScript origins, add the Datadog origin URL. Under Authorized redirect URIs, add the Datadog OAuth callback URL. Both URLs are displayed in the Datadog connection creation dialog when you select Google Workspace.
  5. Click Create.
  6. Copy the Client ID and Client Secret—you need these when creating the connection in Datadog.

Create the connection in Datadog

  1. From the Action Catalog page, click the Connections tab.
  2. Click New Connection.
  3. Select the Google Workspace icon.
  4. Enter a Connection Name.
  5. Enter the Client ID and Client Secret from your Google Cloud OAuth 2.0 credentials.
  6. Select the Scopes required for the actions you plan to use. See the scopes reference.
  7. Leave the Authorize URL and Token URL fields as their pre-populated default values unless you have a specific reason to change them.
  8. Click Create.
  9. In the authorization window that opens, sign in with the Google account you want to use and grant the requested permissions.

Scopes reference

Select only the scopes required by the actions you intend to use.

Gmail

Scope labelScope valueDescription
Gmail: Full Accesshttps://mail.google.com/Full read and write access to all Gmail resources
Gmail: Read, Compose, Send, and Permanently Delete Threadshttps://www.googleapis.com/auth/gmail.modifyAll access except deleting permanently
Gmail: Read Onlyhttps://www.googleapis.com/auth/gmail.readonlyView email messages and settings
Gmail: Send Onlyhttps://www.googleapis.com/auth/gmail.sendSend email on behalf of the user
Gmail: Compose and Sendhttps://www.googleapis.com/auth/gmail.composeManage drafts and send email
Gmail: Manage Labelshttps://www.googleapis.com/auth/gmail.labelsCreate, read, update, and delete labels
Gmail: View Metadata Onlyhttps://www.googleapis.com/auth/gmail.metadataView email metadata such as labels and headers

Google Calendar

Scope labelScope valueDescription
Calendar: Full Accesshttps://www.googleapis.com/auth/calendarFull read and write access to calendars
Calendar: Read Onlyhttps://www.googleapis.com/auth/calendar.readonlyView calendars
Calendar: Manage Eventshttps://www.googleapis.com/auth/calendar.eventsView and edit events on all calendars
Calendar: View Eventshttps://www.googleapis.com/auth/calendar.events.readonlyView events on all calendars

Google Drive

Scope labelScope valueDescription
Drive: Full Accesshttps://www.googleapis.com/auth/driveFull read and write access to all Drive files
Drive: Read Onlyhttps://www.googleapis.com/auth/drive.readonlyView files in Drive
Drive: Access Files Created by This Apphttps://www.googleapis.com/auth/drive.fileAccess only files created or opened by this app
Drive: App Data Folderhttps://www.googleapis.com/auth/drive.appdataAccess the app-specific data folder
Drive: Manage Metadatahttps://www.googleapis.com/auth/drive.metadataView and manage metadata of files
Drive: View Metadatahttps://www.googleapis.com/auth/drive.metadata.readonlyView metadata of files

Google Docs

Scope labelScope valueDescription
Docs: Full Accesshttps://www.googleapis.com/auth/documentsView and manage documents in Google Docs
Docs: Read Onlyhttps://www.googleapis.com/auth/documents.readonlyView documents in Google Docs

Google Sheets

Scope labelScope valueDescription
Sheets: Full Accesshttps://www.googleapis.com/auth/spreadsheetsView and manage spreadsheets in Google Sheets
Sheets: Read Onlyhttps://www.googleapis.com/auth/spreadsheets.readonlyView spreadsheets in Google Sheets

Google Forms

Scope labelScope valueDescription
Forms: Create and Edit Formshttps://www.googleapis.com/auth/forms.bodyView and manage form definitions
Forms: View Formshttps://www.googleapis.com/auth/forms.body.readonlyView form definitions
Forms: View Responseshttps://www.googleapis.com/auth/forms.responses.readonlyView form responses

Google Chat

Scope labelScope valueDescription
Chat: View, Compose, and Delete Messageshttps://www.googleapis.com/auth/chat.messagesView, create, update, and delete messages
Chat: Compose and Send Messageshttps://www.googleapis.com/auth/chat.messages.createCreate and send messages in spaces
Chat: View Messageshttps://www.googleapis.com/auth/chat.messages.readonlyView messages and reactions
Chat: Manage Spaceshttps://www.googleapis.com/auth/chat.spacesCreate, view, update, and delete spaces
Chat: Create Spaceshttps://www.googleapis.com/auth/chat.spaces.createCreate spaces
Chat: View Spaceshttps://www.googleapis.com/auth/chat.spaces.readonlyView spaces

User identity

Scope labelScope valueDescription
User Info: Email Addresshttps://www.googleapis.com/auth/userinfo.emailView the user’s email address
User Info: Basic Profilehttps://www.googleapis.com/auth/userinfo.profileView the user’s basic profile information
OpenID ConnectopenidAuthenticate using OpenID Connect

Google Workspace Admin

Scope labelScope valueDescription
Admin: Manage Usershttps://www.googleapis.com/auth/admin.directory.userCreate, read, update, and delete users
Admin: View Usershttps://www.googleapis.com/auth/admin.directory.user.readonlyView users in the directory
Admin: Manage Groupshttps://www.googleapis.com/auth/admin.directory.groupCreate, read, update, and delete groups
Admin: View Groupshttps://www.googleapis.com/auth/admin.directory.group.readonlyView groups in the directory

Further reading

Additional helpful documentation, links, and articles:


Do you have questions or feedback? Join the #workflows or #app-builder channel on the Datadog Community Slack.