DEV Community

Alex Spinov
Alex Spinov

Posted on

Slack Has a Free Workspace With a Powerful API — Build Bots, Workflows, and Integrations

Slack Has a Free Workspace With a Powerful API — Build Bots, Workflows, and Integrations

Slack is where your team communicates. Its API is where automation lives. Build bots that respond to messages, workflows that automate processes, and integrations that pipe data from anywhere.

Free Tier

  • Unlimited users
  • 90-day message history
  • 10 app integrations
  • 1:1 huddles (audio/video)
  • Channels — unlimited

Bot Basics: Bolt Framework

const { App } = require('@slack/bolt');

const app = new App({
  token: process.env.SLACK_BOT_TOKEN,
  signingSecret: process.env.SLACK_SIGNING_SECRET
});

// Respond to messages
app.message('hello', async ({ message, say }) => {
  await say(\`Hey <@\${message.user}>! How can I help?\`);
});

// Slash commands
app.command('/deploy', async ({ command, ack, respond }) => {
  await ack();
  await respond({
    blocks: [{
      type: 'section',
      text: { type: 'mrkdwn', text: \`Deploying *\${command.text}* to production...\` }
    }]
  });
});

// Interactive buttons
app.action('approve_deploy', async ({ body, ack, say }) => {
  await ack();
  await say(\`Deploy approved by <@\${body.user.id}>! 🚀\`);
});

app.start(3000);
Enter fullscreen mode Exit fullscreen mode

Incoming Webhooks

// Send alerts without a bot — just a webhook URL
await fetch('https://hooks.slack.com/services/T.../B.../xxx', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    blocks: [
      {
        type: 'header',
        text: { type: 'plain_text', text: '🚨 Production Alert' }
      },
      {
        type: 'section',
        fields: [
          { type: 'mrkdwn', text: '*Service:* API Gateway' },
          { type: 'mrkdwn', text: '*Error Rate:* 5.2%' },
          { type: 'mrkdwn', text: '*P95 Latency:* 2.3s' },
          { type: 'mrkdwn', text: '*Status:* 🔴 Critical' }
        ]
      }
    ]
  })
});
Enter fullscreen mode Exit fullscreen mode

Web API

const { WebClient } = require('@slack/web-api');
const client = new WebClient(process.env.SLACK_TOKEN);

// Post a message
await client.chat.postMessage({
  channel: '#deployments',
  text: 'Deploy v2.4.1 complete',
  blocks: [/* rich blocks */]
});

// Search messages
const result = await client.search.messages({
  query: 'production incident',
  sort: 'timestamp',
  count: 10
});

// List channel members
const members = await client.conversations.members({
  channel: 'C0123456789'
});
Enter fullscreen mode Exit fullscreen mode

The Bottom Line

Slack's API turns your team chat into an automation platform. Bots, webhooks, workflows — the building blocks for any team integration you can imagine.


Need to extract team data, automate reporting, or build custom integrations? I create solutions.

📧 Email me: spinov001@gmail.com
🔧 My tools: Apify Store

Top comments (0)