How to Build an AI Agent App with the Slack Code API: The Beginner's Guide
CodexFuse Team · 2026-11-02T21:05:01.966Z · 13 min read min read
The Slack Code API lets your AI coding agent work inside temporary Slack code channels. This beginner's developer guide covers the manifest flag, channel creation, diffs and previews, session management, and the permissions lesson.
Your coding agent just fixed a bug, and right now that work is trapped inside your own direct messages — your teammates cannot see the diff, the plan, or the thinking that led there. The Slack Code API exists to change that. Say the mental model once, because it is the entire product: instead of your AI agent working inside one person's DMs, it opens a temporary shared channel per task — a code channel — where the people, files, context, and plan live in one room, the agent posts its diffs, previews, and thinking steps there, and anyone in the channel can pause, redirect, or stop it. The Slack Code API went generally available on October 28, 2026, on all Slack plans (Slack's announcement), and it is the developer interface for building these agent apps. This beginner's guide is the developer angle only: enable code channels in your app manifest, create a code channel when your agent is mentioned, show the work with diffs and previews, run the session, and learn the permissions lesson. If you are new to Slack itself, start with our Slack beginner's guide to channels and DMs — that covers channels, threads, and huddles; this page covers the API that lets your agent build inside them.
What Is a Slack Code Channel, Exactly?
A code channel is a dedicated space an agent creates for a particular task — Slack's own docs describe it as bringing together "the people, files, context and plan needed for the job" in one place. Your app controls the channel's title, status, context bar, and view tabs, and you use the Slack Code API to show code diffs, HTML previews, and the agent's thinking steps, so you never have to build your own review UI screens. Channels are semi-ephemeral: one channel per task, and when the session finishes the channel is archived — but the archived channel and its history remain viewable, searchable, and can be reopened if needed. Visibility follows the origin: a code channel matches the visibility of the channel it was created from. One disambiguation, said once: the user-side angle — a person mentioning a supported agent (Claude, GitHub Copilot, CodeRabbit, Devin, Lovable, Vercel, and the rest) in any channel or DM to kick off a temporary code channel where the team follows along — already has independent explainers; this guide is strictly for the developer building the agent app behind that experience.
How Do You Build an AI Agent App with the Slack Code API? The Five-Step Arc
Every code-channel integration follows the same five steps, in order — this is the numbered arc to follow from zero to a working agent:
- Turn on code channels in your app manifest: add the
code_channelsfeature flag to your app manifest so Slack knows your app can host agent sessions. - Listen for the mention: with the flag on, your app receives
app_mentionevents — your code decides whether the task deserves a reply in place or a brand-new code channel. - Create the channel: call
agents.conversations.createto open the code channel, linked back to the message that started it. - Show the work: use
agents.conversations.setViewto add diff, HTML, Block Kit, and canvas view tabs, andagents.sessions.setStatusto keep the status honest. - Run the session: rename, re-context, and finally archive the channel with a summary — the record stays searchable for the whole team.
Step 1: How Do You Enable Code Channels in the App Manifest?
You enable the code_channels feature in your app manifest with one flag — verified current as of November 3, 2026:
features:
code_channels:
enabled: true
# optional — only if you take slash commands over HTTPS:
slash_command_url: https://example.com/slack/code-channel-commands
The slash_command_url must be an https:// or http:// URL up to 3,000 characters, and you do not need it at all if your app runs in Socket Mode or is hosted — Slack notes that explicitly. Once the flag is true, your app starts receiving app_mention events, and that is the decision point: your agent decides per task whether to answer in the current conversation or to open a code channel for deeper work. For the agent's brain itself — the coding engine behind the Slack surface — see Claude Code, Anthropic's terminal-based AI coding agent, one of the agents that ships with Slack Code support on the user side.
Step 2: When Should Your Agent Open a Code Channel Instead of Replying in Place?
Your agent should open a code channel when the task is real work — a bug fix, a feature, a refactor — and reply in place when the answer is a sentence. The decision logic lives in your app_mention handler, and the creation call is one method: agents.conversations.create, which takes a name, a session id, the originating channel id, and the originating message timestamp. Linking the channel to the originating message matters — Slack unfurls the new code channel back in the original conversation and auto-invites the message author, so the task has a trail from request to workroom. After creation, teach your app to recognize channels it did not create: call conversations.info and check that properties.record_channel.record_type equals agent_channel. To hear what happens inside code channels and session threads, subscribe to the message.session event type (with channels:history / groups:history scopes) instead of the full firehose — you get only the session traffic your agent needs.
Step 3: How Do You Show Diffs, Previews, and Thinking Steps in a Code Channel?
You show the work with view tabs — agents.conversations.setView creates or updates them, and Slack renders the agent's thinking steps, diffs, and previews natively. There are exactly four view types, and each has one job:
| View type | What it shows | When to use it |
|---|---|---|
diff | A unified diff of the code your agent changed | Every code task — the review surface; one diff view per channel |
html | A live HTML preview | UI and front-end work — the team sees the result, not just the code |
block_kit | Native Slack Block Kit components | Structured summaries, checklists, approvals |
canvas | A collaborative canvas | Long-lived docs, plans, and artifacts the team edits with the agent |
Two mechanics beginners get wrong: pass a stable view_key so updates happen in place instead of spawning duplicate tabs, and remember each channel supports a single diff view — update it as the agent iterates rather than creating new ones. For everything around the views, agents.conversations.setProperties manages the context bar (repository, branch, PR link, and other agent-supplied items plus external resource details), agents.conversations.setCommands registers your agent's per-channel slash commands, and agents.conversations.listViews / removeView / getCanvas / setCanvasContent round out view management. If the unified-diff concept itself is new to you, our Git beginner's guide to branches and commits explains what a diff actually is.
Step 4: How Do You Run the Session — Status, Rename, and Archive?
You run the session with the agents.sessions.* family, which is unified across code channels and session threads (pass thread_ts for a thread session, omit it for a code channel). Two methods do the daily work: agents.sessions.setStatus keeps the channel's status honest — while your agent reports processing, Slack shows the standard "Working..." loading experience — and agents.sessions.rename renames the session as the task sharpens. When the task is done, agents.conversations.archive archives the channel, optionally recording a summary via summary_message_ts so the finished work has a one-line verdict attached. The archive is not deletion: the channel and its history stay viewable, searchable, and reopenable, which is what makes the code channel the team's permanent record of the task. The scopes are split by design — agents.sessions.* needs only chat:write, while agents.conversations.* needs code_channels:manage — so request the minimum your app actually uses. When the work ends in a pull request, the team flow that follows is exactly what our GitHub beginner's guide to opening your first pull request teaches.
What Is the Permissions Lesson Every Beginner Must Learn?
The permissions lesson is this, said once: your agent inherits the permissions and administrator controls of the channel where it works — the channel's member list is the blast radius. Slack states there is no separate access model for developers to build and nothing new for IT to configure; an agent working in a private channel sees what that channel sees, and one working in a public channel inherits that exposure. Enforce it in code too: the docs' authorization rule says the caller must be the agent bot assigned to the channel or a member of it — calls against a channel that is not a code channel fail with not_agent_channel, and calls from a bot that is not the channel's agent fail with not_authorized. And the compliance story is built in: EKM, DLP, and the Discovery APIs apply to agent messages just like human ones, which is why teams can let agents write in shared channels at all. One practical corollary: run the code your agent produces inside an isolated container before you trust it — our Docker beginner's guide to running code in isolated containers covers that habit.
Do You Have to Build the Agent Yourself? The Sample App and the Agent Landscape
No — start from Slack's own reference. The docs point to the Coding Agent for Slack sample app for Bolt for JavaScript and Bolt for Python: when mentioned with a task and a repo, it decides whether to answer in place or create a code channel, then makes changes to the repo with the user's approval. (The docs link the samples; this guide does not print repo URLs it did not independently verify.) On the user side, the launch stats are Slack's own claims, so report them as such: Slack says more than 150 customers and partners asked to build code-channel experiences for their agents, that over 70% of code channels spin up and close within a single day "from idea to merged pull request," and that GitHub Copilot opens a dedicated code channel in 30% of its agent sessions (that last figure is Copilot-specific, not all agents). The supported-agent list on the user side currently includes Claude, CodeRabbit, DataDog, Devin, Factory, GitHub Copilot, Lovable, Mistral Vibe, NanoClaw, Replit, Rhythms, and Vercel — know them as the competition and the compatibility surface your own agent app joins.
What Is Still "Available Soon" — and What Has No Price Yet?
Two things beginners should not present as live. First, the GitHub-side improvements — requesting reviews from Slack, bi-directional comment sync between Slack and the PR, and a merge prompt after approval and passing tests — are all still described by Slack as "available soon" as of November 3, 2026; do not build your launch demo around them. Second, pricing: Slack's announcement says the API is generally available on all Slack plans, and no per-seat or per-API-call pricing has been announced — do not call it free, and re-check before you budget anything. The ChatGPT-side integration was likewise described as "available soon" at launch; verify it exists before you promise it to users.
What Are the Beginner Mistakes with the Slack Code API?
Six traps beginners walk into, written against what the API actually does:
| Mistake | Why it hurts | What to do instead |
|---|---|---|
| Opening a code channel for every mention | Channels are per-task workrooms — spawning one for a one-sentence answer trains users to ignore them | Put the decision in your app_mention handler: reply in place for answers, create for work |
Forgetting features.code_channels.enabled | Nothing works — no channel creation, no session events — and the failure mode is silence | Verify the manifest flag first whenever code channels "don't work"; it is step zero |
| Creating a new diff view per iteration | Each channel supports one diff view — duplicates confuse reviewers | Update the same view with a stable view_key |
| Requesting both scopes "just in case" | code_channels:manage is powerful; over-scoping widens the blast radius the permissions lesson warns about | chat:write for session status, code_channels:manage only where you manage channels |
| Treating archive as delete | You lose nothing — but teams that expect deletion will be surprised the history survives | Use summary_message_ts on archive so the record has a verdict; tell users the history stays searchable |
| Demoing "available soon" features | GitHub review-requesting and comment sync are not live — your demo breaks on stage | Build against today's methods; watch the docs for the GA of the PR features |
Sources
Every fact in this guide was verified against a page fetched for this article on November 3, 2026:
- Slack Code API docs —
features.code_channels.enabled,agents.conversations.*/agents.sessions.*method names, scopes, view types,agent_channeldetection, authorization errors: docs.slack.dev/ai/slack-code/ - Slack dev blog walkthrough, "Build with Slack Code API" (2026-10-28): diff/HTML/thinking-step APIs, create-call parameters, unfurl + auto-invite: slack.dev/build-with-slack-code-api/
- GA coverage — "generally available on all plans," 150+ customers/partners claim, Copilot 30% stat: superpowerdaily.com
- GA coverage — permissions inheritance claim, 70%-within-a-day stat, "available soon" PR features: unite.ai
- Slack help article — user-side flow, session statuses (Working, Idle, Needs attention, Done, Inactive, Archived), supported agents: slack.com/help — Build with AI as a team using Slack Code
- Code-channel visibility rule (matches origin channel): Datadog Bits Code docs
- Slack features page — EKM, DLP, Discovery API compliance on agent messages: slack.com/features/code-channels
Frequently Asked Questions
Is the Slack Code API free?
Slack says the API is generally available on all Slack plans — but no per-seat or per-call pricing has been announced as of November 3, 2026. Do not assume it is free; re-check Slack's pricing page before budgeting.
What scopes does my app need for the Slack Code API?
Two, split by method family: chat:write covers agents.sessions.* (status and rename), and code_channels:manage covers agents.conversations.* (create, archive, views, properties, commands). Request the minimum your app uses.
Can my agent open a code channel from any channel?
Your app must be the channel's assigned agent bot or a member of the channel — calls against a non-code channel fail with not_agent_channel, and calls from a bot that is not the channel's agent fail with not_authorized. The agent inherits the channel's permissions, so the member list is your blast radius.
What happens to the code channel when the task is done?
It is archived, not deleted: the channel and its full history remain viewable, searchable, and reopenable. Pass summary_message_ts on archive to attach a one-line summary of what the session accomplished.
Can I request GitHub reviews from Slack with the Code API?
Not yet — GitHub review requesting, bi-directional comment sync, and the post-approval merge prompt are all still "available soon" as of November 3, 2026. Build your integration against the live methods and watch the docs for their GA.
