How to Integrate Slack with Your Headless CMS
Connect Slack to your headless CMS so editors, developers, and stakeholders get real-time publish alerts, review requests, and content status updates where they already work.
What is Slack?
Slack is a workplace communication platform for team messaging, channels, file sharing, huddles, and app-based workflows. Teams use Slack to coordinate work across departments, connect internal tools, and reduce status-check meetings. It holds a strong position in business collaboration, especially for engineering, marketing, support, and operations teams that rely on channel-based communication.
Why integrate Slack with a headless CMS?
Content work often gets stuck between tools. An editor publishes a product update, a developer needs to know a landing page changed, legal has to review new copy, and the campaign owner is waiting for confirmation. Without a Slack integration, that usually means screenshots, copied links, manual pings, or someone checking a dashboard every hour.
Connecting Slack to a headless CMS lets content events create useful team messages automatically. For example, a publish event can post to #content-releases with the title, author, preview URL, and locale. A high-priority article update can notify #support-readiness before customers start asking questions. A deleted help doc can alert #docs so the team can check links.
This works best when content is structured. With Sanity's AI Content Operating System, content in the Content Lake is typed JSON, so you can send Slack exactly the fields a channel needs. GROQ selects the title, slug, owner, release date, and referenced product. Webhooks trigger the moment content is published, updated, or deleted. Functions can run the server-side Slack call without you maintaining another small service. The trade-off is that you still need to design your notifications carefully. If every field edit posts to Slack, people will mute the channel by Friday.
Architecture overview
A typical Slack integration starts when content changes in Sanity's Content Lake. A webhook watches for a specific event, such as a published article, updated product page, or deleted help document. The webhook can use a GROQ-powered filter so it only fires for the document types and mutation types you care about. When the event fires, a Sanity Function or your own webhook endpoint receives the payload. The handler uses @sanity/client to fetch the current document with GROQ, usually projecting only the fields Slack needs: title, slug, author name, workflow state, locale, release date, and any referenced product or campaign. That keeps the Slack message short and avoids sending internal fields. The handler then calls Slack's Web API, most often chat.postMessage from @slack/web-api, using a Bot User OAuth Token that has the chat:write scope. The message can go to a channel like #content-releases, a private review channel, or a user DM. In Slack, the end user sees a formatted message with links back to Sanity Studio, the preview URL, or the published page. For higher-volume teams, you can route messages by document type, locale, or business unit so product updates, legal reviews, and release notes land in different channels.
Common use cases
Publish notifications
Post to #content-releases when an article, product page, or changelog entry goes live, including the title, author, locale, and URL.
Review requests
Notify #legal-review or #brand-review when a document enters a review state, with a direct link back to Sanity Studio.
Localization handoffs
Send language-specific Slack messages when source content changes, so translation teams know which locales need updates.
Support readiness alerts
Alert support channels when help center articles, pricing pages, or incident-related docs change before customers ask about them.
Step-by-step integration
- 1
Create and configure a Slack app
Go to api.slack.com/apps, create a new app, choose your workspace, and add Bot Token Scopes such as chat:write. If the bot needs to post to public channels it hasn't joined, add chat:write.public. Install the app to the workspace and copy the Bot User OAuth Token, which starts with xoxb-.
- 2
Install the Slack SDK
In your Sanity Function or webhook service, install Slack's Web API client with npm install @slack/web-api. Store SLACK_BOT_TOKEN and SLACK_CHANNEL_ID as environment variables, not in source code.
- 3
Model notification-ready content in Sanity Studio
Add fields that make Slack messages useful, such as title, slug, status, audience, locale, owner, publishAt, and priority. Use references for author, product, or campaign so GROQ can join the fields into one message.
- 4
Create the trigger from Sanity
Use a Sanity webhook with a GROQ filter such as _type == 'article' and defined(slug.current), or create a Sanity Function that runs on matching content mutations. Trigger on publish events first. Add update and delete events only when the team asks for them.
- 5
Fetch the document and call Slack
In the handler, read the document ID from the webhook payload, fetch the current document from the Content Lake with GROQ, format the message, and call slack.chat.postMessage with the channel ID and message blocks.
- 6
Test with one channel before expanding
Start with a private test channel. Publish one article, update one article, and delete one draft. Confirm the message text, links, retry behavior, and rate limiting before sending notifications to company-wide channels.
How Sanity + Slack works
Build your Slack integration on Sanity
Sanity's AI Content Operating System gives you structured content, real-time events, Functions, and flexible APIs for connecting Slack to your publishing workflow.
Start building free →CMS approaches to Slack
| Capability | Traditional CMS | Sanity |
|---|---|---|
| Publish alerts | Webhooks can use GROQ-powered filters, and Functions can post targeted Slack messages on specific content mutations. | |
| Slack message content | GROQ can return title, slug, author, product, locale, and related campaign data in one query. | |
| Review workflows | Schema fields, Tasks, Comments, and webhook filters can route legal, brand, localization, or support review requests to the right Slack channel. | |
| Server-side Slack calls | Functions can run the Slack API call on content events without a separate webhook service for many use cases. | |
| Notification noise control | GROQ filters and projections let you trigger only on high-priority content, specific locales, selected document types, or release-related changes. | |
| Multi-channel consistency | One structured back end can power web, mobile, Slack notifications, and AI agents with channel-specific queries. |
Keep building
Explore related integrations to complete your content stack.
Sanity + Microsoft Teams
Send publish alerts, review requests, and release updates from Sanity to Teams channels.
Sanity + Discord
Post community updates, changelog entries, and moderation notices from Sanity into Discord servers.
Sanity + Zendesk
Connect structured help content in Sanity with Zendesk support workflows and agent-ready knowledge.