> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Chat

> Read spaces and send messages in Google Chat

## At a glance

* **Availability**: Experimental ([how to enable](/cloud/integrations)).
* **Auth**: OAuth 2.0.
* **Connection**: A user authorizes the connection in the provider's consent screen.
* **Scopes**: `https://www.googleapis.com/auth/chat.spaces.readonly`, `https://www.googleapis.com/auth/chat.messages`.
* **Docs**: [https://developers.google.com/workspace/chat/api/reference/rest](https://developers.google.com/workspace/chat/api/reference/rest)

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

With a managed OAuth app, Connect works without these variables; set them to use your own OAuth app instead.

| Variable               | Required | Description                                                                           |
| ---------------------- | -------- | ------------------------------------------------------------------------------------- |
| `GOOGLE_CLIENT_ID`     | Yes      | Google OAuth Client ID [Docs](https://console.cloud.google.com/apis/credentials).     |
| `GOOGLE_CLIENT_SECRET` | Yes      | Google OAuth Client Secret [Docs](https://console.cloud.google.com/apis/credentials). |

## Setup

1. **Create a Google Cloud project**: Go to [https://console.cloud.google.com/](https://console.cloud.google.com/) and create (or select) a project. Any Google Workspace account can be used for testing; Chat API requires a Workspace account (consumer @gmail.com accounts cannot use Google Chat spaces).
2. **Enable the Google Chat API**: Enable the API at [https://console.cloud.google.com/apis/library/chat.googleapis.com](https://console.cloud.google.com/apis/library/chat.googleapis.com).
3. **Configure the OAuth consent screen and Chat app**: Under APIs & Services → OAuth consent screen, configure the app and add the scopes chat.spaces.readonly and chat.messages. The Chat API also requires a Chat app configuration: visit [https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat](https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat) and set an app name, avatar, and description.
4. **Create OAuth credentials**: Under APIs & Services → Credentials, create an OAuth client ID (Web application) with redirect URI \<your-app-url>/api/auth/google-chat/callback. Set GOOGLE\_CLIENT\_ID and GOOGLE\_CLIENT\_SECRET in your .env.
5. **Verify access**: Run the List Spaces tool, then List Messages on one of the returned spaces.

* Google Chat user authentication requires a Google Workspace account - consumer Gmail accounts will get 403s
* Space and message IDs are resource-name segments: spaces/\{spaceId} and spaces/\{spaceId}/messages/\{messageId}
* The chat.messages scope covers listing, reading, and sending messages; chat.spaces.readonly covers space discovery

Provider API reference: [https://developers.google.com/workspace/chat/api/reference/rest](https://developers.google.com/workspace/chat/api/reference/rest)

## Tools

| Tool          | Access | Description                                                                               |
| ------------- | ------ | ----------------------------------------------------------------------------------------- |
| List Spaces   | Read   | List Google Chat spaces (rooms and direct messages) the authenticated user is a member of |
| Get Space     | Read   | Get details of a Google Chat space                                                        |
| List Messages | Read   | List messages in a Google Chat space, including messages in threads                       |
| Get Message   | Read   | Get details of a specific Google Chat message                                             |
| Send Message  | Write  | Send a text message to a Google Chat space                                                |

## Example prompts

* List my Google Chat spaces, then summarize the most recent messages in the most active one.
* Send a status update message to a Google Chat space of my choice.
