Send alerts to Slack from your code

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

Rich FormattingThread RepliesScheduled MessagesTemplates
import { Stack0 } from '@stack0/sdk'
const stack0 = new Stack0({ apiKey: process.env.STACK0_API_KEY })
// Send a simple alert to a Slack channel
export async function sendAlert(message: string) {
await stack0.integrations.communication.send({
provider: 'slack',
channel: '#alerts',
content: message,
})
}
// Send a rich notification with Block Kit formatting
export 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 thread
export 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.


FAQ

Frequently asked questions

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.

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.

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.

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.

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