Webhook: Slack

Send budget alert notifications to a Slack channel using incoming webhooks.

Overview

Grafient can POST a notification to a Slack channel whenever a budget alert triggers. This uses Slack's Incoming Webhooks feature — no custom Slack app or OAuth is required on the Grafient side. You create a webhook URL in Slack, paste it into your alert configuration, and you're done.

Prerequisites

  • A Slack workspace where you have permission to install apps.
  • At least one budget alert configured in Grafient (see Budget Alerts).

Step 1: Create a Slack App

  1. Go to Slack API: Your Apps and click Create New App.
  2. Choose From scratch.
  3. Enter a name (e.g. Grafient Alerts) and select your workspace.
  4. Click Create App.

If you already have a Slack app you use for notifications, skip to Step 2 and enable Incoming Webhooks on that existing app.

Step 2: Enable Incoming Webhooks

  1. In your app's settings page, click Incoming Webhooks in the left sidebar.
  2. Toggle Activate Incoming Webhooks to On.
  3. Scroll down and click Add New Webhook to Workspace.
  4. Select the channel where you want alerts to appear (e.g. #billing-alerts).
  5. Click Allow.

You'll see a new webhook URL that looks like:

https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX

Copy this URL.

Treat this URL like a secret. Anyone with the URL can post messages to your channel. Don't commit it to version control or share it publicly.

Step 3: Add the Webhook URL to Your Alert

  1. In Grafient, go to Alerts in the sidebar.
  2. Click Add Alert (or edit an existing alert).
  3. Set your threshold and period as usual.
  4. Paste the Slack webhook URL into the Webhook URL field.
  5. Click Create Alert.

What Gets Posted

When the alert triggers, Slack receives a JSON payload with a text field that renders as a formatted message:

Budget Alert: Your daily spend ($45.00) exceeded your $30.00 threshold

The payload also includes structured data for any downstream automation:

{
  "text": "Budget Alert: Your daily spend ($45.00) exceeded your $30.00 threshold",
  "alert": {
    "period": "daily",
    "threshold": 30.00,
    "currentSpend": 45.00
  }
}

Troubleshooting

Message doesn't appear in Slack

  • Verify the URL: Make sure the webhook URL starts with https://hooks.slack.com/services/. An incorrect URL will fail silently.
  • Check channel permissions: Ensure the Slack app still has access to the target channel. If the channel was made private after setup, you may need to re-add the webhook.
  • Confirm the alert triggered: Go to the Alerts page and check the "Last triggered" date. If it hasn't triggered, the spend hasn't exceeded the threshold yet.

Webhook was deleted in Slack

If someone removes the Incoming Webhook from the Slack app, notifications will stop silently. Create a new webhook in Slack and update the URL on your alert in Grafient.