# Google Chat

Google Chat lets the agent tell your team about a call while it happens or right after: a new lead, a complaint that needs a person, a booking request. The agent writes the message and posts it to the space you choose, so the right people see it without opening Voice Logica. Workflows can post to Chat as well.

The path is **Integrations - Catalogue - Google Chat - Authorize**. One connection is shared by the whole company. Messages are posted as the Google account that authorized, into spaces that account belongs to. Then turn the **Google Chat** tool on under the agent's **Skills - Tools & Workflows**.

  <ShotPlaceholder
    src="/assets/integrations/google-chat.png"
    name="google-chat-connect"
    alt="Google Chat setup dialog with Default space, Send a test message and Incoming webhooks"
    capture="Google Chat setup dialog after Authorize, default space selected."
  />

## What you need before you start

- A **Google Workspace** account. Personal Gmail accounts cannot use the Google Chat API.
- That account must be a member of the spaces the agent should post to. Add it to the space in Google Chat first.
- Optional: an incoming webhook URL created in a Chat space's settings in Google Chat. Use it when you want to post into a space without the authorized account being a member.

The rest of Google (calendar, contacts, Drive, Sheets, mail) is a separate connection. See [Google Workspace](https://docs.voicelogica.ai/integrations/google/).

## What you enter

After Google consent, the **Google Chat** dialog opens:

- **Default space** (required) — Where agents and workflows post when no space is named. The list shows the spaces the authorized account belongs to.
- **Incoming webhooks** — Optional. **Add webhook** with a **Name** (the label the agent picks), the **Webhook URL** (must start with `https://chat.googleapis.com/`) and an optional **Space label**.

On the agent's **Google Chat** tool card:

- **Operations** (required) — **Send to default space** (on by default), **Send message (pick space)** and **Send via webhook**.
- **Allowed spaces** — With **Send message (pick space)**: the spaces you name for this agent. The agent can also post to another space the account belongs to when your instructions name it.
- **Allowed webhooks** — With **Send via webhook**: the webhook names this agent may use. Only these work.

## First setup

1. **Integrations - Catalogue - Google Chat - Authorize**

   Sign in with the Google Workspace account that is a member of your team spaces and accept the consent screen. The **Google Chat** dialog opens when you return.

2. **Default space**

   Pick the space for alerts, for example your sales or front-desk space.

3. **Send a test message**

   Type a short line and click **Send test**. It should appear in that space within seconds. If it fails, see Troubleshooting before going further.

4. **My Agents - this agent - Skills - Tools & Workflows**

   Turn **Google Chat** on. Keep **Send to default space**, or add **Send message (pick space)** and choose the **Allowed spaces**. Click **Save** on the card, then save the agent.

5. **Tell the agent when to post**

   In the agent's instructions, say what to post and where. For example: "When a caller asks for a quote, post their name, number and request to the Sales space." The agent only posts when your instructions give it a reason.

6. **Prove it**

   Call the agent and ask for something that matches the rule. The message should land in the space during or right after the call. If it does not, open the call in **Calls** and check whether the agent tried to post.

## What it can do

- Post a message to the default space, with no space to choose.
- Post to a named space, so one agent can route sales leads to one space and complaints to another.
- Post through an incoming webhook into a space the authorized account is not part of.
- Reply in an existing thread when a thread key is given.
- In workflows: **Google Chat - Send Message**, **Google Chat - Send to Default Space** and **Google Chat - Send via Webhook** nodes, with call variables in the message.

The agent only sends. It does not read or answer conversations in Google Chat.

## Troubleshooting

**Send test fails**

Check, in order:

1. The authorized account is a Google Workspace user, not a personal Gmail account.
2. It is a member of the default space.
3. Your Workspace administrator has not turned Google Chat off or blocked third-party apps. Check the Google Admin console.
4. The consent screen was fully accepted. If in doubt, click **Disconnect** in the dialog and **Authorize** again from Catalogue.

**The card shows Access token expired - reconnect**

Google rejected the stored access, or an older connection is missing a permission Voice Logica now needs. Click **Reconnect** on the Google Chat card under **Connected** and accept the updated consent screen. Posts fail until you do.

**The call ended but nothing was posted**

The tool is off on this agent, the agent was not saved after turning it on, or the instructions never told the agent when to post. If the agent named a space the authorized account does not belong to, the post fails. Add the account to that space, or name a space it already belongs to.

**The webhook URL is rejected**

The URL must start with `https://chat.googleapis.com/`. Copy it again from the space's webhook settings in Google Chat.

## Next Steps

[Get an integration working](https://docs.voicelogica.ai/integrations/) - connections and agent tools.  
[Google Workspace](https://docs.voicelogica.ai/integrations/google/) - calendar, contacts, Drive, Sheets and mail.  
[Google Meet](https://docs.voicelogica.ai/integrations/communication/google-meet/) - meeting recordings as calls.  
[Tools & Workflows](https://docs.voicelogica.ai/agent-configuration/built-in-tools/) - turning tools on per agent.
