# Webhook Integrations (Slack, Microsoft Teams & Google Chat)

> Configure incoming webhooks for Google Chat, Slack, and Microsoft Teams to deliver real-time PeopleSoft alerts and scheduled report notifications.

---

Site [llms.txt](/llms.txt)

---

## Webhook Integrations

psLens dispatches real-time alert notifications (firing and resolution events) and scheduled report completion summaries to incoming webhooks. psLens automatically detects the target platform from the webhook URL and formats native rich card payloads without extra configuration:

|      Platform       |                    URL Pattern Detected                     |                                                                         Native Payload Format                                                                          |
| ------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Google Chat**     | `chat.googleapis.com`                                       | **Google Chat Cards v2 (`cardsV2`)** with Material Symbols icons, 2-column metadata grid, color-coded status, action buttons, and conversation threading (`threadKey`) |
| **Slack**           | `hooks.slack.com` or `slack`                                | **Slack Block Kit** (`attachments` + `blocks`) with color-coded sidebar, fields, and interactive link buttons                                                          |
| **Microsoft Teams** | `webhook.office.com`, `logic.azure.com`, or `powerautomate` | **Adaptive Cards v1.4** (`message` attachment) with `FactSet` metadata and `Action.OpenUrl` buttons                                                                    |
| **Custom Webhook**  | Any other `http://` or `https://` URL                       | Structured JSON payload containing `event_type`, `status`, `alert`, `database`, `timestamp`, and `details`                                                             |

---

## Setting Up Google Chat Webhooks

Google Workspace spaces support incoming webhooks that allow psLens to post formatted Cards v2 alert and report messages directly into a space.

### Where to Get a Google Chat Webhook URL

Open [Google Chat](https://chat.google.com) in your web browser (creating webhooks requires the web or desktop app, not the mobile app) and open the **Space** where you want psLens notifications delivered.

Click the **Space name** at the top of the conversation header to open the space menu, then select **Apps & integrations**.

In the **Webhooks** section, click **+ Add webhooks** (or **Manage webhooks**).

Enter a name for the webhook (for example, `psLens Alerts`) and optionally provide an avatar image URL, then click **Save**.

Click the **three-dot menu (`⋮`)** next to your newly created webhook and select **Copy link**.

The copied URL will look like this:

```text
https://chat.googleapis.com/v1/spaces/AAQAn4B-uPg/messages?key=AIzaSy...&token=bCtXq1...
```

> **Note:** If **Apps & integrations → Webhooks** is not visible or is greyed out, ask your Google Workspace administrator to enable incoming webhooks in the Google Admin Console under **Apps → Google Workspace → Google Chat → Externaligs / Webhooks**.

### How Google Chat Delivery Works in psLens

- **Rich Cards v2 Layout**: Alert and report notifications render as structured Google Chat `cardsV2` messages with a header, severity/environment metadata columns, affected item summaries, and an **Open in psLens** button (when `server.appBaseURL` is configured).
- **Automatic Threading**: Alert notifications automatically include a deterministic `threadKey` per database and alert type along with `messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD`, so firing alerts, reminders, and `RESOLVED` notifications group into the same conversation thread in your space.
- **Secret Obfuscation**: Both `key` and `token` query parameters in `chat.googleapis.com` URLs are automatically masked (`***`) in the psLens UI, delivery history, and application logs.

---

## Setting Up Slack Webhooks

In Slack, open your workspace settings or visit the [Slack Apps portal](https://api.slack.com/apps) and create or select an app with **Incoming Webhooks** enabled.

Click **Add New Webhook to Workspace**, select the target channel, and copy the generated `https://hooks.slack.com/services/...` URL.

---

## Setting Up Microsoft Teams Webhooks

In Microsoft Teams, open the target channel, click the **three-dot menu (`⋯`)** next to the channel name, and select **Workflows** (or **Connectors**).

Choose the **Post to a channel when a webhook request is received** workflow template, select your team and channel, and copy the generated Power Automate / Office 365 webhook URL.

---

## Registering & Routing Webhooks in psLens

Once you have copied your webhook URL from Google Chat, Slack, or Microsoft Teams, register it in psLens either through the web UI or in `config.yaml`.

### Via the Web UI (Recommended)

Open **Settings → Notifications** (`/settings/notifications`) and scroll to the **Webhook Destinations** card.

Click **Add Webhook**, enter an **ID** (e.g., `gchat_ops`), a **Display Name** (e.g., `Google Chat Ops Space`), and paste the **Webhook URL**, then click **Save Webhook**. psLens automatically displays a **Google Chat**, **Slack**, or **MS Teams** badge next to the webhook.

Click the **Send Test** (paper-plane) button next to the webhook to send a test card to your channel or space and confirm connectivity.

Once registered, you can route notifications to this webhook in three places:

- **Global Alert Subscriptions**: On **Settings → Notifications**, add a subscription under **Notification Subscriptions**, set **Delivery Method** to `Webhook`, and select your webhook from the dropdown.
- **Database-Specific Alert Delivery**: On **Settings → Databases → [Database] → Alerts**, under **Notification Delivery Settings**, toggle **Webhook Delivery** on, select your webhook, and click **Save Delivery**.
- **Scheduled Reports**: On any report page under **Schedule & Notifications**, toggle **Webhook** delivery on and select your webhook.

### Via `config.yaml`

You can also define reusable webhooks and subscriptions directly in `config.yaml` (including `op://` 1Password secret references):

```yaml
notifications:
  webhooks:
    gchat_ops:
      name: "Google Chat Operations Space"
      url: "https://chat.googleapis.com/v1/spaces/AAAA.../messages?key=...&token=..."
    slack_alerts:
      name: "Slack Alert Channel"
      url: "https://hooks.slack.com/services/T000/B000/XXXX"
    teams_ops:
      name: "Teams Operations Channel"
      url: "https://default...powerautomate.../invoke"

  subscriptions:
    - id: "google-chat-prod"
      enabled: true
      alertTypes: ["*"]
      databases: ["PROD"]
      severityMin: "warning"
      type: "webhook"
      target: "gchat_ops"
```
