Enbbox Docs

Slack

Integrate Slack with Enbbox for chat notifications. Send rich notifications to Slack channels and direct messages with Block Kit formatting.

Overview

Slack is a team messaging platform. Enbbox can send notifications to Slack channels, groups, or direct messages using Incoming Webhooks.

Step 1: Create an Incoming Webhook

  1. Go to api.slack.com/apps and click Create New App
  2. Choose From scratch, enter an app name, and select your workspace
  3. In the app settings, navigate to Incoming Webhooks
  4. Toggle Activate Incoming Webhooks to On
  5. Click Add New Webhook to Workspace
  6. Select the channel where notifications should be posted
  7. Copy the Webhook URL (e.g., https://hooks.slack.com/services/T00/B00/xxx)

Step 2: Connect to Enbbox

  1. Navigate to Integrations in the Enbbox dashboard
  2. Click Add Provider → select ChatSlack
  3. No global credentials are needed — Slack uses per-subscriber webhook URLs
  4. Activate the integration

Step 3: Configure Subscriber Credentials

Store each subscriber's Slack webhook URL:

import { SubscriberCredentialsApi, Configuration } from "@enbbox/api";

const config = new Configuration({ accessToken: "your-api-key" });
const credentialsApi = new SubscriberCredentialsApi(config);

await credentialsApi.setCredentials("subscriber-123", "slack", {
  credentials: { webhook_url: "https://hooks.slack.com/services/T00/B00/xxx" },
});

Step 4: Send a Test Notification

import { EventsApi, Configuration } from "@enbbox/api";

const config = new Configuration({ accessToken: "your-api-key" });
const eventsApi = new EventsApi(config);

await eventsApi.triggerEvent({
  name: "deployment-alert",
  to: { subscriberId: "subscriber-123" },
  payload: { message: "🚀 Deployment to production completed successfully!" },
});

Advanced: Bot Token (for richer messages)

For richer features (ephemeral messages, Block Kit, user DMs), use a Bot Token:

  1. In your Slack app settings → OAuth & Permissions
  2. Add bot scopes: chat:write, chat:write.public
  3. Install the app to your workspace
  4. Copy the Bot User OAuth Token (xoxb-...)

Troubleshooting

IssueSolution
channel_not_foundThe webhook URL may have been revoked — regenerate it
invalid_payloadEnsure message content is valid UTF-8
Rate limitedSlack allows ~1 message/sec per webhook

On this page