Our Google Chat integration lets you send deployment notifications directly into a Google Chat space. Messages are delivered via Google Chat's incoming webhooks and render as a rich card showing the deployment status, server, deployer, and revision range.

To set up a new notification, click the **Integrations** link on the left-hand side of your project, then click **New Integration**. Select **Google Chat** from the service picker.

You will need to provide a webhook URL generated from the Google Chat space where you want notifications sent. See the **Creating an incoming webhook** section below for step-by-step instructions.

Once the webhook URL is pasted in, choose when to trigger the integration (deployment started, completed, and/or failed), and which servers it should fire for. Click **Create Integration** to save.

## Creating an incoming webhook

Google Chat incoming webhooks are configured from within a Chat space.

1. Open [Google Chat](https://chat.google.com/) and navigate to the space where you want deployment notifications to appear. If you do not have a space yet, create one from the left sidebar.
2. Click the space name at the top of the chat to open its menu, then choose **Apps & integrations**.
3. Click **Add webhooks**.
4. Give the webhook a name such as "DeployHQ" and optionally an avatar URL, then click **Save**.
5. Google Chat will generate a webhook URL. Copy it.

Paste the URL into the **Webhook URL** field of the DeployHQ integration form and save.

## What the notification looks like

Each message is a card containing:

- A header with the deployment status and project name
- The server or server group that was deployed
- The deployer's name
- The start and last revision for the deployment
- An overview, if one was added to the deployment
- The latest commit message
- A **View Report** button linking back to the deployment report in DeployHQ (shown only for completed deployments)

## Managing the webhook

To edit or remove the webhook later, go back to the Google Chat space, open **Apps & integrations** again, and you will see your DeployHQ webhook listed with edit and delete options. Removing the webhook in Google Chat will silently stop deliveries; the integration in DeployHQ will remain but its calls will fail.

## API access

This integration can also be created and managed via the DeployHQ API by setting `hook_type` to `google_chat` and providing the webhook URL in the `properties` hash.
