# Send alerts to Slack from your code

> Send alerts and updates to Slack channels programmatically. Rich formatting, scheduled messages, thread replies, and message templates. $1 per 1,000 API calls.

Send rich notifications, alerts, and updates to Slack channels programmatically. Block Kit formatting, threads, and scheduled messages in one API.

Rich FormattingThread RepliesScheduled MessagesTemplates

[Send Your First Slack Notification](https://app.stack0.dev/)[View docs](https://www.stack0.dev/docs/sdk/integrations)

TypeScriptcURL

Copy

```
import { Stack0 } from '@stack0/sdk' const stack0 = new Stack0({ apiKey: process.env.STACK0_API_KEY }) // Send a simple alert to a Slack channelexport async function sendAlert(message: string) {  await stack0.integrations.communication.send({    provider: 'slack',    channel: '#alerts',    content: message,  })} // Send a rich notification with Block Kit formattingexport async function sendDeployNotification(deploy: Deploy) {  await stack0.integrations.communication.send({    provider: 'slack',    channel: '#deployments',    blocks: [      {        type: 'header',        text: `Deployment: ${deploy.service}`,      },      {        type: 'section',        fields: [          { label: 'Environment', value: deploy.env },          { label: 'Version', value: deploy.version },          { label: 'Status', value: deploy.status },          { label: 'Duration', value: `${deploy.durationMs}ms` },        ],      },      {        type: 'actions',        buttons: [          { text: 'View Logs', url: deploy.logsUrl },          { text: 'Rollback', url: deploy.rollbackUrl },        ],      },    ],  })} // Reply in a threadexport async function sendThreadReply(threadId: string, message: string) {  await stack0.integrations.communication.send({    provider: 'slack',    channel: '#incidents',    threadId,    content: message,  })}
```

## What's included

### Channel Routing

Send to any public or private channel. Route alerts by severity, team, or topic.

### Rich Formatting

Headers, fields, buttons, and dividers. Build informative messages with Block Kit.

### Scheduled Messages

Queue messages for future delivery. Daily digests, reminders, and delayed alerts.

### Thread Replies

Reply in threads to group related updates. Keep channels organized and searchable.

### User Mentions

Tag users and groups in messages. Ensure the right people see critical alerts.

### Message Templates

Reusable templates with variables. Consistent formatting across all notifications.

## Built for production

### No Slack app needed

Connect your workspace in one click. No bot tokens, OAuth flows, or app manifests to manage.

### Rich formatting

Send messages with headers, fields, buttons, and more. Our simplified block format handles the complexity.

### Thread support

Reply in threads to keep channels clean. Group related updates under a single parent message.

### Scheduled messages

Queue messages for future delivery. Send daily digests, scheduled reminders, or delayed alerts.

### TypeScript SDK

Full type safety for blocks, channels, and message options. Autocomplete for every field.

### Simple pricing

$1 per 1,000 API calls. No per-workspace fees or message limits.

## Common implementations

### Deploy Notifications

Alert your team on deployments with version, environment, and status details.

### Incident Alerts

Route error alerts to on-call channels with severity levels and runbook links.

### Sales Notifications

Notify the sales channel when new leads sign up or deals close.

### Scheduled Digests

Send daily or weekly summary reports to team channels automatically.

## Frequently asked questions

Do I need to create a Slack app?

No. Stack0 handles the Slack app setup for you. Connect your workspace in the dashboard with one click, select the channels you want to post to, and start sending messages immediately.

Can I send messages to private channels?

Yes. During workspace connection, you authorize access to specific channels. Once authorized, you can send to both public and private channels using the same API.

How do I format messages with blocks?

Use the blocks parameter to send rich messages with headers, sections, fields, buttons, and more. Our block format is a simplified version of Slack's Block Kit that handles the translation automatically.

Can I schedule messages for later?

Yes. Add a scheduledAt timestamp to your request. The message will be queued and sent at the specified time. Scheduled messages can be cancelled before they are sent.

What happens if the channel doesn't exist?

The API returns a clear error with the invalid channel name. Messages are not silently dropped. You can use the channels list endpoint to validate channel names before sending.

## Ready to build?

Get started in minutes.

[Get Started](https://app.stack0.dev/)

---

Source: https://www.stack0.dev/use-cases/slack-notifications
llms.txt: https://www.stack0.dev/llms.txt
Sitemap: https://www.stack0.dev/sitemap.xml
Documentation: https://www.stack0.dev/docs
OpenAPI spec: https://www.stack0.dev/openapi.json
MCP server: https://api.stack0.dev/mcp
